Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WildStar
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WildStar:AddOn loading process
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Inside loading the TOC file == Files within an AddOn are loaded in the order they're listed in the AddOn's [[TOC file]], named "toc.xml", and as a part of the AddOn itself, which is defined using the ''Addon'' attributes. See [[TOC file]] for reference. * AddOn attributes - When the ''Addon'' element XML in the [[TOC file]] is loaded, only the Apollo ''AddOn'' item itself is created and its meta data like name, author, version, are available immediately to any subsequent Lua code by Name attribute through Apollo API. * AddOn files - File are loaded through XML <Script file="src.lua" /> or <Form file="src.xml" /> and Script files are loaded at the time the tag is encountered while parsing. Form files are accounted for but not fully loaded and created until expressly requested in code. * AddOn Scripts - The TOC file, for regular AddOns, is responsible for loading a Lua file to define register its actual AddOn Lua instance. During Lua file execution in the AddOn load process, the world has already been loaded, and most of the game state is known and available through the [[UI API]]. * AddOn Forms - The TOC file, for regular AddOns, is responsible for itemizing Form .xml files to register AddOn relative Forms and UI widgets. Lua code can ask that an instance is generated from a registered form any time, which should normally be done during or after OnLoad. * TOC loaded - Once all of the Script and Form children have been loaded, if a Lua AddOn instance was created, registered, its OnLoad event handler is then executed if exists, giving the AddOn a chance to finish the loading process and register any handlers and otherwise thereafter operate like a proper and complete AddOn. After OnLoad, the AddOn's OnRestore settings load events are run. Both OnLoad and OnRestore are run before the client moves on to load another AddOn. To illustrate the loading order, consider the following AddOn code example: * toc.xml <?xml version="1.0" encoding="utf-8"?> <Addon Author="Bob" APIVersion="8" Name="LoadOrder" Description="Demo load order."> <Script Name="file1.lua"/> <Script Name="file2.lua"/> <Form Name="file3.xml"/> </Addon> * file1.lua Print("This loads first") * file2.lua Print("Files included in XML are executed as they are encountered") * file3.xml <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <Forms> <Form Class="Window" Template="CRB_NormalFrame" Name="BobForm"> <Control Class="Window" Template="Default" Name="Title"/> </Form> </Forms>
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)