API:PageWindowUpdatePages
From RoR Wiki
UI Lua API · PageWindow functions
Version: WAR 1.4.8
Lays out a PageWindow's content across its pages and recounts the pages.
PageWindowUpdatePages(pageWindowName)
Arguments
- pageWindowName
string– Name of the PageWindow.
Returns
Nothing.
Details
- Call this after changing the content of a PageWindow (text, shown windows, page breaks). The page count is not updated until you do.
- The child windows of the PageWindow's content are placed page by page, top to bottom:
- A window that starts on a page but runs past its bottom is moved to the top of the next page, together with everything below it. A window that already starts at the top of a page is left where it is, even if it is taller than the page.
- A window registered with PageWindowAddPageBreak always starts a new page.
- A window registered with PageWindowAddSplitableWindow is not moved; a copy named windowName
_pgbrkis created instead. - Some Labels are split instead of moved: the lines that fit stay on the page, and the rest of the text goes into a new Label named labelName
_pgbrkat the top of the next page. That new Label is also added to the page-break list.
- After the layout, the page count is recalculated (see PageWindowGetNumPages) and the content is resized so that all pages sit side by side.
- The current page is then set again, which clamps it to the new page count (see PageWindowSetCurrentPage).
Errors
Error in function call 'PageWindowUpdatePages': Window %s does not existError in function call 'PageWindowUpdatePages': Window %s is not a PageWindow
Example
From default/ea_tomeofknowledge/source/tomewindow_bestiary.lua:
PageWindowRemovePageBreak( "BestiarySpeciesInfoPageWindow", "BestiarySpeciesTaskAnchor" ) PageWindowUpdatePages( "BestiarySpeciesInfoPageWindow" ) ... PageWindowSetCurrentPage( "BestiarySpeciesInfoPageWindow", 1 )
