Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ModuleLoad

From RoR Wiki
Revision as of 19:47, 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 · Module functions
Version: WAR 1.4.8

Loads the definition of a single UI module from its .mod file.

ModuleLoad(modFilePath, moduleType, allowLooseFiles)

Arguments

modFilePath
wstring – Path of the .mod file. It must be a wide string (L"...").
moduleType
number – A SystemData.UiModuleType value from 1 to 5 (PREGAME, DEFAULT_INGAME, CUSTOM_INGAME, MYTHIC_APPROVED_ADDON, USER_ADDON).
allowLooseFiles
boolean – false: the file must be inside the game archives. true: the client first looks for the file on disk and then in the archives.

Returns

Nothing.

Details

  • The module is only registered with the client. Its files are not run yet. Call ModulesInitializeAllEnabled or ModuleInitialize afterwards.
  • The module type is stored with the module and reported as moduleType by ModulesGetData.
  • allowLooseFiles is also passed on to the loader. The stock UI passes IsInternalBuild(), which is always false.
  • allowLooseFiles must be a real boolean, and modFilePath a wide string, or an Invalid Parameters error is raised.

Errors

These are written to the UI log; the call returns normally.

  • Error in function call 'ModuleLoad': file %ls does not exist.
  • Error in function call 'ModuleLoad': Module Type %d is invalid.

Example

Loading the pregame modules one by one, from interfacecore/interfacecore.lua:

for _, modFilePath in ipairs( PREGAME_MODS )
do
    ModuleLoad( modFilePath, SystemData.UiModuleType.PREGAME, IsInternalBuild() )
end

ModulesInitializeAllEnabled()

See also