WoW:XML/Script: Difference between revisions

311 bytes added ,  15 August 2023
m
Move page script moved page XML/Script to WoW:XML/Script without leaving a redirect
m (Move page script moved page XML/Script to WoW:XML/Script without leaving a redirect)
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{uixmltype}}
{{uixmlprop}}
 
[[XML/Script|Script]] is way to add handler code to a UI element. Script is base type that is not used directly, but added to <[[XML/Scripts|Scripts]]> using one of the specific handler types such as 'OnClick'. The Script type provides a base type for all of the hander types.
[[XML/Script|Script]] is way to add handler code to a UI element. Script is base type that is not used directly, but added to <[[XML/Scripts|Scripts]]> using one of the specific handler types such as 'OnClick'. The Script type provides a base type for all of the hander types.


Line 12: Line 11:
== Attributes ==
== Attributes ==
* function {{attrtype|string}} (optional)
* function {{attrtype|string}} (optional)
*:global name of function to call, in lieu of inline text.
*: named function to call using a simple global name. Can be used instead of in payload with inline script text.
* method {{attrtype|string}} (optional)
* method {{attrtype|string}} (optional)
*:this frame Lua object or 'mixin' name of function to call, in lieu of inline text.
*: named method to call using this frame's Lua table or 'mixin' name of function to call, in lieu of inline text or 'function'.
* inherit ([[XML types#SCRIPTINHERITTYPE|SCRIPTINHERITTYPE]]) (optional)
* inherit ([[XML types#SCRIPTINHERITTYPE|SCRIPTINHERITTYPE]]) (optional)
*: order to run this script relative to any inherited scripts for this event. Default is 'none'.
*: order to run this script relative to any other scripts for this event including any 'inherited'. Default is 'none'.
* intrinsicOrder ([[XML types#SCRIPTINTRINSICORDERTYPE|SCRIPTINTRINSICORDERTYPE]]) (optional)
* intrinsicOrder ([[XML types#SCRIPTINTRINSICORDERTYPE|SCRIPTINTRINSICORDERTYPE]]) (optional)
*: order to run this script relative to any implementation scripts for this event. Used only in an intrinsic definition. Default is 'none'.  
*: order to run this script relative to any implementation scripts for this event. Used only in an intrinsic definition. Default is 'none'.  
Line 24: Line 23:
== Payload ==
== Payload ==
* (optional) - Lua script as plain text called as a Lua function.
* (optional) - Lua script as plain text called as a Lua function.
 
<pre>
=== Lua parameters ===
<Frame name="Frame1">
* self - (table) the container table. For a Frame is the scripts Lua frame table itself
<Scripts>
<OnMouseUp>
print(self:GetName(), event, ...) -- payload
</OnMouseUp>
</Scripts>
</Frame>
</pre>
=== Parameters ===
Lua script parameters set by the engine for use by the inline script.
* self - (table) the Lua table automatically genmerated for the frame  
* event - (string) the name of the wow event
* event - (string) the name of the wow event
* ... - the remaining Lua args list including any event arguments
* ... - the remaining Lua args list including any event arguments
Anonymous user