Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:ModulesLoadFromListFile

From RoR Wiki

UI Lua API · Module functions
Version: WAR 1.4.8

Loads the definitions of the UI modules listed in a text file.

ModulesLoadFromListFile(listFilePath, moduleType, allowLooseFiles)

Arguments

listFilePath
wstring – Path of the list file. It must be a wide string (L"...").
moduleType
number – A SystemData.UiModuleType value from 1 to 5. Every listed module is given this type.
allowLooseFiles
boolean – false: the list file must be inside the game archives. true: the client first looks for it on disk and then in the archives.

Returns

Nothing.

Details

  • The stock list file interface/default/EADefaultMods.txt contains one .mod path per line, for example interface/default\EASystem_DialogManager\EASystem_DialogManager.mod.
  • The modules are only registered with the client. Call ModulesInitializeAllEnabled afterwards to run them.
  • allowLooseFiles is also passed on to the loader. The stock UI passes IsInternalBuild(), which is always false.
  • allowLooseFiles must be a real boolean, and listFilePath 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 'ModulesLoadFromListFile': file %ls does not exist.
  • Error in function call 'ModulesLoadFromListFile': Module Type %d is invalid.

Example

From interfacecore/interfacecore.lua:

ModulesLoadFromListFile( SystemData.Directories.DefaultInterface..L"/EADefaultMods.txt", SystemData.UiModuleType.DEFAULT_INGAME, IsInternalBuild() )
ModulesLoadFromListFile( L"interface/MythicApprovedAddOns/MythicApprovedMods.txt", SystemData.UiModuleType.MYTHIC_APPROVED_ADDON, IsInternalBuild() )

See also