Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:WindowRestoreDefaultSettings

From RoR Wiki
Revision as of 19:51, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 OnInitializeCustomSettings core 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

See also