This section describes how to use a Ui Module (or .mod file). The .mod file contains meta data about a portion of interface.
To add new elements to your Game interface, you must create a new ui module, or “UiMod”. Each UiMod is described by a single .mod file which tells the Interface System what files to load and how to initialize your component.
This format will eventual be expanded to include things such as keybindings and saved variables.
Ui Modules | This section describes how to use a Ui Module (or .mod file). |
.mod File Definition | The .mod file is an XML file with the following field.s |
.mod XML Description | |
ModuleFile | This is the top level xml-tag for each ui module xml file. |
UiMod | This is the top level xml-tag for each ui module xml file. |
Author | The element contains information about the module author. |
Description | This element contains a text description of the mod |
Dependencies | This element allows you require other mods to be loaded and initialized prior to initializing this mod. |
OnInitialize | This element allows you to provide initialization instructions for each mod. |
OnInitialize | This element allows you to provide initialization instructions for each mod. |
OnUpdate | This element allows you to provide update instructions for each mod. |
OnShutdown | This element allows you to provide shutdown instructions for each mod. |
CreateWindow | This element defines the command for creating a single window. |
CallScript | This element defines the command for calling a single script function. |
Functions | |
Functions | |
ModulesLoadFromDirectory() | Scans the specified directory and loads all of the .mod definition files. |
Functions | |
Functions | |
ModulesLoadFromListFile() | Loads a list of .mod files from a list. |
Functions | |
Functions | |
ModuleLoad() | Loads a single module path. |
Functions | |
Functions | |
ModuleRestrictedLoad() | This loads a restricted module that is not added to the the Mod Data. |
Functions | |
Functions | |
ModulesInitializeAllEnabled() | Loads all of the the lua/xml data and runs the initialization sequence for each enabled mod. |
Functions | |
Functions | |
ModulesInitializeRestricted() | Loads all of the the lua/xml data and runs the initialization sequence for each Restricted mod. |
Functions | |
Functions | |
ModulesGetData() | Returns a table containing the data for all loaded Ui Modules. |
Functions | |
Functions | |
ModuleSetEnabled() | Enables / Disables a single module. |
Functions | |
Functions | |
ModuleInitialize() | Initialize a single module. |
The .mod file is an XML file with the following field.s
.mod XML Description | |
ModuleFile | This is the top level xml-tag for each ui module xml file. |
UiMod | This is the top level xml-tag for each ui module xml file. |
Author | The element contains information about the module author. |
Description | This element contains a text description of the mod |
Dependencies | This element allows you require other mods to be loaded and initialized prior to initializing this mod. |
OnInitialize | This element allows you to provide initialization instructions for each mod. |
OnInitialize | This element allows you to provide initialization instructions for each mod. |
OnUpdate | This element allows you to provide update instructions for each mod. |
OnShutdown | This element allows you to provide shutdown instructions for each mod. |
CreateWindow | This element defines the command for creating a single window. |
CallScript | This element defines the command for calling a single script function. |
This is the top level xml-tag for each ui module xml file. All other elements must be contained within the ModuleFile tag
<?xml version="1.0" encoding="UTF-8"?>
<ModuleFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
...
</ModuleFile>
xmlns:xsi | The location of the xml language specification. |
This is the top level xml-tag for each ui module xml file. All other elements must be contained within the ModuleFile tag
<UiMod name="EA_TomeOfKnowledge" version="1.0" date="11/6/2007" >
...
</UiMod>
name | The name of the Module, this must be unique. |
version | The version number of this module. |
date | The date this module was last updated. |
The element contains information about the module author.
<Author name="EAMythic" email="" />
name | The name of the author. |
The email address of the author. |
none
This element contains a text description of the mod
<Description text="This module contains all of the code and data for the Tome Of Knowledge window." />
text | The description text. |
none
This element allows you require other mods to be loaded and initialized prior to initializing this mod.
<Dependencies>
<Dependency name="EA_TooltipSystem" />
</Dependencies>
name = The name of the module this mod depends on.
none
This element allows you to provide initialization instructions for each mod. There is no limit on the number of init actions you can perform, however it may make sense to
<OnInitialize>
<CreateWindow name="TomeWindow" show="false" />
</OnInitialize>
name = The name of the module this mod depends on.
none
This element allows you to provide initialization instructions for each mod.
<OnInitialize>
...
</OnInitialize>
none
This element allows you to provide update instructions for each mod.
<OnUpdate>
...
</OnUpdate>
You can improve performance by reducing the number of Update callbacks that you include. If you only need updates when a particular window is showing, it is better to add an OnUpdate callback to the window itself, rather than the entire mod. This is designed for ‘System’ updates that do not correspond to a single window and are needed at all times.
This element allows you to provide shutdown instructions for each mod.
<OnShutdown>
...
</OnShutdown>
none
This element defines the command for creating a single window.
<CreateWindow name="TomeWindow" show="true"/>
name | A valid window defintion name. |
show | Should the window be shown after it is created? |
none
This element defines the command for calling a single script function.
<CreateWindow name="TomeWindow" show="true"/>
name | A valid window defintion name. |
show | Should the window be shown after it is created? |
When included in a OnInitialize or OnShutdown section, this is called with no parameters. When included in an OnUpdate section, this is called with a single ‘seconds elapsed’ variable.
Functions | |
ModulesLoadFromDirectory() | Scans the specified directory and loads all of the .mod definition files. |
Scans the specified directory and loads all of the .mod definition files. This does NOT actually load any of the lua/xml code create the windows. This just loads the UI-Module meta data.
directory | (string) The directory from which to search for modules. |
setName | (wstring) The name to use to describe this set of modules. For example, “EA Default” or “Add Ons” |
nil | no return value |
none
Functions | |
ModulesLoadFromListFile() | Loads a list of .mod files from a list. |
Loads a list of .mod files from a list.
listFilePath | (string) The file path for the list of mod files. |
setName | (wstring) The name to use to describe this set of modules. For example, “EA Default” or “Add Ons” |
allowRaw | (wstring) Are raw versions of this file permitted? |
nil | no return value |
none
Functions | |
ModuleLoad() | Loads a single module path. |
Loads a single module path.
modFilePath | (string) The file path for the mod file. |
setName | (wstring) The name to use to describe this set of modules. For example, “EA Default” or “Add Ons” |
allowRaw | (wstring) Are raw versions of this mod permitted? |
nil | no return value |
none
Functions | |
ModuleRestrictedLoad() | This loads a restricted module that is not added to the the Mod Data. |
This loads a restricted module that is not added to the the Mod Data.
modFilePath | (string) The file path for the mod file. |
allowRaw | (wstring) Are raw versions of this mod permitted? |
nil | no return value |
none
Functions | |
ModulesInitializeAllEnabled() | Loads all of the the lua/xml data and runs the initialization sequence for each enabled mod. |
Loads all of the the lua/xml data and runs the initialization sequence for each enabled mod.
none
nil | no return value |
none
Functions | |
ModulesInitializeRestricted() | Loads all of the the lua/xml data and runs the initialization sequence for each Restricted mod. |
Loads all of the the lua/xml data and runs the initialization sequence for each Restricted mod.
none
nil | no return value |
none
Functions | |
ModulesGetData() | Returns a table containing the data for all loaded Ui Modules. |
Returns a table containing the data for all loaded Ui Modules.
none
modDataTable | (table) A table of Ui Modules |
Format as follows...
modDataTable[1...n].name | (wstring) The name of the module |
modDataTable[1...n].setName | (wstring) The name of the set that this module is in. |
modDataTable[1...n].author | (table) A table containing the author information |
modDataTable[1...n].author.name | (wstring) The name of the author |
modDataTable[1...n].author.email | (wstring) The email of the author |
modDataTable[1...n].description | (table) A table containing the description information |
modDataTable[1...n].description.text | (wstring) The description text |
modDataTable[1...n].dependencies | (table) A table containing the dependencies information |
modDataTable[1...n].dependencies[1..n].name | (wstring) The name of the dependency mod. |
local modsData = ModulesGetData()
Functions | |
ModuleSetEnabled() | Enables / Disables a single module. |
Enables / Disables a single module.
moduleName | (string) The name of the module. |
enabled | (boolean) Should this module be enabled? |
nil | no return value |
ModuleSetEnabled( “EA_BackpackWindow”, true )
Functions | |
ModuleInitialize() | Initialize a single module. |