API:DoesWindowExist
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Returns whether a window with the given name exists.
exists = DoesWindowExist(windowName)
Arguments
- windowName
string– Name of the window.
Returns
- exists
boolean–trueif the window exists and is not waiting to be destroyed.
Details
- A window that has been passed to
DestroyWindowis removed later, not at once. Until then it can still be found by name, butDoesWindowExistalready returnsfalsefor it. - This is the usual way to avoid the Window %s does not exist errors of the other window functions.
- Exactly one argument must be passed. With a missing or non-string argument the function raises the generic Invalid Parameters message and returns nothing.
Errors
None besides the generic Invalid Parameters message.
Example
From default/easystem_eventtext/source/system_eventtext.lua:
if( EA_System_EventText.loading or ( DoesWindowExist( "LoadingWindow" ) and WindowGetShowing( "LoadingWindow" ) ) )
