API:WindowRestoreDefaultSettings
From RoR Wiki
UI Lua API · Window functions
Version: WAR 1.4.8
Resets a window's anchors, size and scale to the defaults from its definition.
WindowRestoreDefaultSettings(windowName)
Arguments
- windowName
string– Name of the window.
Returns
Nothing.
Details
- If the window was created from a definition (XML), the client:
- removes all current anchors,
- restores the size from the definition, if the definition gives one,
- sets the scale of the window and its descendants to a client-wide default scale value, and
- adds the anchors from the definition again.
- After that the window and its descendants are laid out again.
- Finally, the client can call the window's
OnInitializeCustomSettingscore event handler (see WindowRegisterCoreEventHandler). This also happens for windows without a definition. - Alpha, showing state and other settings are not reset by this function.
- There is no lock check in this function.
Errors
Error in function call 'WindowRestoreDefaultSettings': Window %s does not exist
Example
The layout editor's "restore defaults" for a window, from easystem_layouteditor/source/layoutframe.lua:
function LayoutFrame:RestoreDefaults()
WindowRestoreDefaultSettings( self.m_sourceWindowName )
self:SetHidden( self.m_windowData.isDefaultHidden )
end
