API:LoadResources
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Loads an interface definition XML file from a folder.
LoadResources(directory, xmlFile, flag)
Arguments
- directory
string– Folder the file and the files it refers to are read from, for example"Interface/InterfaceCore".- xmlFile
string– Name of the XML file in that folder, for example"InterfaceCore.xml".- flag
boolean– Passed on to the loader. The stock UI always passesIsInternalBuild().
Returns
Nothing.
Details
- The client reads and processes the XML file. The stock UI uses it for the font definitions and for
InterfaceCore.xml, an<Interface>file that pulls in the pre-game windows with<Include file="..." />entries relative todirectory. flagmust be a real boolean;nilor a number raises the generic Invalid Parameters message.- The function needs at least three arguments and only reads the last three.
- The stock UI only calls it from
interfacecore/interfacecore.lua, during start-up.
Errors
None besides the generic Invalid Parameters message when an argument has the wrong type.
Example
From interfacecore/interfacecore.lua:
LoadResources( "interface/interfacecore/fonts", fontDirectory.."/fonts.xml", IsInternalBuild() ) LoadResources( "Interface/InterfaceCore", "InterfaceCore.xml", IsInternalBuild() )
