49
edits
| Line 25: | Line 25: | ||
To illustrate the loading order, consider the following addon code example: | To illustrate the loading order, consider the following addon code example: | ||
'''LoadingOrder.toc''' | |||
##Interface: 30000 | ##Interface: 30000 | ||
##Title: Loading Order Demo | ##Title: Loading Order Demo | ||
| Line 31: | Line 32: | ||
file2.xml | file2.xml | ||
file3.lua | file3.lua | ||
'''file1.lua''' | |||
print("This loads first") | print("This loads first") | ||
'''file2.xml''' | |||
<Ui> | <Ui> | ||
<Frame name="TemplateFrame" virtual="true"> | <Frame name="TemplateFrame" virtual="true"> | ||
<Frames> | <Frames> | ||
| Line 46: | Line 52: | ||
</Frames> | </Frames> | ||
</Frame> | </Frame> | ||
<Frame inherits="TemplateFrame"> | <Frame inherits="TemplateFrame"> | ||
<Frames> | <Frames> | ||
<Frame> | <Frame> | ||
<Scripts> | <Scripts> | ||
| Line 55: | Line 63: | ||
</Scripts> | </Scripts> | ||
</Frame> | </Frame> | ||
<Frame> | <Frame> | ||
<Scripts> | <Scripts> | ||
| Line 62: | Line 71: | ||
</Scripts> | </Scripts> | ||
</Frame> | </Frame> | ||
</Frames> | |||
<Scripts> | |||
<OnLoad> | |||
print("Parent frame's OnLoad fires after its children's.") | |||
</OnLoad> | |||
</Scripts> | |||
</Frame> | |||
<Script file="file2.5.lua"/> | <Script file="file2.5.lua"/> | ||
</Ui> | </Ui> | ||
'''file2.5.lua''' | |||
print("Files included in XML are executed as they are encountered"); | print("Files included in XML are executed as they are encountered"); | ||
'''file3.lua''' | |||
print("This concludes this presentation"); | print("This concludes this presentation"); | ||