<?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%3AModuleLoad</id>
	<title>API:ModuleLoad - 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%3AModuleLoad"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:ModuleLoad&amp;action=history"/>
	<updated>2026-10-17T16:47:38Z</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:ModuleLoad&amp;diff=30607&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:ModuleLoad&amp;diff=30607&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:16Z</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;
Loads the definition of a single UI module from its &amp;lt;code&amp;gt;.mod&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ModuleLoad(modFilePath, moduleType, allowLooseFiles)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;modFilePath : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – Path of the &amp;lt;code&amp;gt;.mod&amp;lt;/code&amp;gt; file. It must be a wide string (&amp;lt;code&amp;gt;L&amp;quot;...&amp;quot;&amp;lt;/code&amp;gt;).&lt;br /&gt;
;moduleType : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – A &amp;lt;code&amp;gt;SystemData.UiModuleType&amp;lt;/code&amp;gt; value from 1 to 5 (&amp;lt;code&amp;gt;PREGAME&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;DEFAULT_INGAME&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CUSTOM_INGAME&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;MYTHIC_APPROVED_ADDON&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;USER_ADDON&amp;lt;/code&amp;gt;).&lt;br /&gt;
;allowLooseFiles : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;: the file must be inside the game archives. &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;: the client first looks for the file on disk and then in the archives.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The module is only registered with the client. Its files are not run yet. Call [[API:ModulesInitializeAllEnabled|ModulesInitializeAllEnabled]] or [[API:ModuleInitialize|ModuleInitialize]] afterwards.&lt;br /&gt;
* The module type is stored with the module and reported as &amp;lt;code&amp;gt;moduleType&amp;lt;/code&amp;gt; by [[API:ModulesGetData|ModulesGetData]].&lt;br /&gt;
* &amp;lt;code&amp;gt;allowLooseFiles&amp;lt;/code&amp;gt; is also passed on to the loader. The stock UI passes &amp;lt;code&amp;gt;IsInternalBuild()&amp;lt;/code&amp;gt;, which is always &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;allowLooseFiles&amp;lt;/code&amp;gt; must be a real boolean, and &amp;lt;code&amp;gt;modFilePath&amp;lt;/code&amp;gt; a wide string, or an &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; error is raised.&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;ModuleLoad&amp;#039;: file %ls does not exist.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;ModuleLoad&amp;#039;: Module Type %d is invalid.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Loading the pregame modules one by one, from &amp;lt;code&amp;gt;interfacecore/interfacecore.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for _, modFilePath in ipairs( PREGAME_MODS )&lt;br /&gt;
do&lt;br /&gt;
    ModuleLoad( modFilePath, SystemData.UiModuleType.PREGAME, IsInternalBuild() )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
ModulesInitializeAllEnabled()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:ModulesLoadFromDirectory|ModulesLoadFromDirectory]]&lt;br /&gt;
* [[API:ModulesLoadFromListFile|ModulesLoadFromListFile]]&lt;br /&gt;
* [[API:ModulesInitializeAllEnabled|ModulesInitializeAllEnabled]]&lt;br /&gt;
* [[API:ModuleInitialize|ModuleInitialize]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>