<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AWindowRestoreDefaultSettings</id>
	<title>API:WindowRestoreDefaultSettings - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AWindowRestoreDefaultSettings"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowRestoreDefaultSettings&amp;action=history"/>
	<updated>2026-10-17T16:47:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:WindowRestoreDefaultSettings&amp;diff=30891&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowRestoreDefaultSettings&amp;diff=30891&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:47Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Window}}&lt;br /&gt;
Resets a window&amp;#039;s anchors, size and scale to the defaults from its definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowRestoreDefaultSettings(windowName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* If the window was created from a definition (XML), the client:&lt;br /&gt;
** removes all current anchors,&lt;br /&gt;
** restores the size from the definition, if the definition gives one,&lt;br /&gt;
** sets the scale of the window and its descendants to a client-wide default scale value, and&lt;br /&gt;
** adds the anchors from the definition again.&lt;br /&gt;
* After that the window and its descendants are laid out again.&lt;br /&gt;
* Finally, the client can call the window&amp;#039;s &amp;lt;code&amp;gt;OnInitializeCustomSettings&amp;lt;/code&amp;gt; core event handler (see [[API:WindowRegisterCoreEventHandler|WindowRegisterCoreEventHandler]]). This also happens for windows without a definition.&lt;br /&gt;
* Alpha, showing state and other settings are not reset by this function.&lt;br /&gt;
* There is no lock check in this function.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowRestoreDefaultSettings&amp;#039;: Window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
The layout editor&amp;#039;s &amp;quot;restore defaults&amp;quot; for a window, from &amp;lt;code&amp;gt;easystem_layouteditor/source/layoutframe.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function LayoutFrame:RestoreDefaults()&lt;br /&gt;
    WindowRestoreDefaultSettings( self.m_sourceWindowName )&lt;br /&gt;
    self:SetHidden( self.m_windowData.isDefaultHidden )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowClearAnchors|WindowClearAnchors]]&lt;br /&gt;
* [[API:WindowSetDimensions|WindowSetDimensions]]&lt;br /&gt;
* [[API:WindowSetScale|WindowSetScale]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>