<?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%3AModuleInitialize</id>
	<title>API:ModuleInitialize - 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%3AModuleInitialize"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:ModuleInitialize&amp;action=history"/>
	<updated>2026-10-17T16:13:07Z</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:ModuleInitialize&amp;diff=30606&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:ModuleInitialize&amp;diff=30606&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:15Z</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=Module}}&lt;br /&gt;
Initializes one loaded UI module (addon) by name, together with its dependencies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ModuleInitialize(moduleName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;moduleName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – The module&amp;#039;s name as given in its &amp;lt;code&amp;gt;.mod&amp;lt;/code&amp;gt; file. The comparison is case-sensitive.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The module must already be known to the client, through [[API:ModuleLoad|ModuleLoad]], [[API:ModulesLoadFromDirectory|ModulesLoadFromDirectory]] or [[API:ModulesLoadFromListFile|ModulesLoadFromListFile]].&lt;br /&gt;
* A module that is already initialized, has already failed, or is disabled is left alone.&lt;br /&gt;
* The module&amp;#039;s dependencies are initialized first. If a required one is missing, disabled, fails, or leads back to a module that is still being set up, the module is not initialized, its load status records the failure (see &amp;lt;code&amp;gt;loadStatus&amp;lt;/code&amp;gt; in [[API:ModulesGetData|ModulesGetData]]) and an error is logged.&lt;br /&gt;
* Initializing a module loads its files and then creates the windows and calls the functions listed in its &amp;lt;code&amp;gt;OnInitialize&amp;lt;/code&amp;gt; section. While this happens the module is the client&amp;#039;s current module. When it is done, &amp;lt;code&amp;gt;UiMod %s Initialized.&amp;lt;/code&amp;gt; is written to the UI log.&lt;br /&gt;
* This is the single-module form of [[API:ModulesInitializeAllEnabled|ModulesInitializeAllEnabled]]. The stock UI never calls it.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
These are written to the UI log; the call returns normally.&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;ModuleInitialize&amp;#039;: %s is not a valid UiMod name.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error Loading UiMod %s: Required Dependency %s not found.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error Loading UiMod %s: Required Dependency %s is not Enabled.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error Loading UiMod %s: Required Dependency %s failed to Initialize.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error Loading UiMod %s: Circular Dependency detected with %s. Load Order = %s&amp;lt;/code&amp;gt; (see [[API:SetCheckForCircularDependencies|SetCheckForCircularDependencies]])&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
A minimal example built from the signature:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ModuleLoad( L&amp;quot;Interface/AddOns/MyAddon/MyAddon.mod&amp;quot;, SystemData.UiModuleType.USER_ADDON, true )&lt;br /&gt;
ModuleInitialize( &amp;quot;MyAddon&amp;quot; )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:ModulesInitializeAllEnabled|ModulesInitializeAllEnabled]]&lt;br /&gt;
* [[API:ModuleLoad|ModuleLoad]]&lt;br /&gt;
* [[API:ModulesGetData|ModulesGetData]]&lt;br /&gt;
* [[API:SetCheckForCircularDependencies|SetCheckForCircularDependencies]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>