WoW:API and scripting quirks: Difference between revisions

m
Move page script moved page API and scripting quirks to WoW:API and scripting quirks without leaving a redirect
m (LUA -> Lua, it is word, not abbreviation. Get rid of "code". Remove unnecessary _ in article title.)
m (Move page script moved page API and scripting quirks to WoW:API and scripting quirks without leaving a redirect)
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{cleanup|Mostly out of date and misguided; merge into relevant articles and delete}}
== World of Warcraft Scripting Quirks ==
== World of Warcraft Scripting Quirks ==
* [[Macros]]
* [[Macros]]
Line 13: Line 15:
** OnUpdate handlers are only called when the frame is visible.  
** OnUpdate handlers are only called when the frame is visible.  
** OnUpdate handles are called ''every'' frame. Use with care.
** OnUpdate handles are called ''every'' frame. Use with care.
** When nesting frames, you can access the parent frame name in XML names with with $parent, this is a textual substitution and cannot be used in Lua. The Lua equivalent to $parent is the GetParent() method of the frame (e.g. getglobal(Frame:GetParent():GetName().."Button") is the same as $parentButton).
** When nesting frames, you can access the parent frame name in XML names with $parent, this is a textual substitution and cannot be used in Lua. The Lua equivalent to $parent is the GetParent() method of the frame (e.g. getglobal(Frame:GetParent():GetName().."Button") is the same as $parentButton).
** All [[Frames]] have a GetID() function which will obtain the ID specified in the XML.  ID's must be positive integers enclosed in quotes: ie. id="1" or id="20"
** All [[Frames]] have a GetID() function which will obtain the ID specified in the XML.  ID's must be positive integers enclosed in quotes: ie. id="1" or id="20"
** If you don't specify parent="UIParent" in your top-level frames, your frames won't be scaled according to the currently active UI scale.  This can lead to some hair-pulling as you try to figure out why your fonts are so huge.  (But, in some cases, not having that scaling might be desirable.)
** If you don't specify parent="UIParent" in your top-level frames, your frames won't be scaled according to the currently active UI scale.  This can lead to some hair-pulling as you try to figure out why your fonts are so huge.  (But, in some cases, not having that scaling might be desirable.)
Line 20: Line 22:
* Output to the outside world
* Output to the outside world
** The only file output allowed is when the UI engine saves variables before it exits or reloads. Addons use the "<tt>## [[SavedVariables]]:</tt>" header to indicate which data they wish to save.
** The only file output allowed is when the UI engine saves variables before it exits or reloads. Addons use the "<tt>## [[SavedVariables]]:</tt>" header to indicate which data they wish to save.
** Another way to output data is to save certain variables using the SetCVar() function.  This will immediatly do an export of the config.wtf file that contains various in game variables.  This will not allow you to create new variables to export out, just set non default values to certain in game variables.


* [[World of Warcraft API|Functions]]
* [[World of Warcraft API|Functions]]
Line 36: Line 37:
** See [[Lua Scope]] for a complete description of the implications of Lua's variable scoping.
** See [[Lua Scope]] for a complete description of the implications of Lua's variable scoping.


== Also See ==
[[Category:Interface customization]]
 
* [[Interface Customization FAQ]]
 
 
<br>
<br>
[[Category:Interface Customization]]
Anonymous user