API:WindowSetShowing
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Shows or hides a window.
WindowSetShowing(windowName, show)
Arguments
- windowName
string– Name of the window.- show
boolean–trueto show the window,falseto hide it.
Returns
Nothing.
Details
- If the window is already in the requested state, its showing flag and
STATEare left alone. - With
show = true, a popable window that is not on the background layer is brought to the front of its siblings on the same layer. This happens on every call, even if the window was already showing, so callingWindowSetShowing(name, true)again is a way to raise a window. - For windows with state tracking enabled, the client writes the new value to
windowName.STATE.SHOWING(see WindowGetShowing). showmust be a real boolean. Passingnilor a number raises an Invalid Parameters error.- The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.
Errors
Error in function call 'WindowSetShowing': Window %s does not existError in function call 'WindowSetShowing': Window %s is currently locked and may not be modified from lua. This window, or one of its relatives has a registered GameAction.
This check exists in the client but never triggers: the lock flag it tests is never set.
Example
Toggling a window, as done by WindowUtils.ToggleShowing in easystem_windowutils/source/windowutils.lua:
local showing = WindowGetShowing( windowName ) WindowSetShowing( windowName, not showing )
Showing a dialog button only when it has text, from easystem_dialogmanager/source/dialogmanager.lua:
WindowSetShowing( "TwoButtonDlg"..dlgIndex.."BoxButton1", button1Text ~= L"" )
