WoW:SecureTemplates: Difference between revisions
Jump to navigation
Jump to search
(added link) |
m (Move page script moved page SecureTemplates to WoW:SecureTemplates without leaving a redirect) |
||
| (4 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
{{uitech}} | |||
'''SecureTemplates''' are a family of protected frame and button templates defined as part of FrameXML. Through attribute-based configuration, they allow addons to access some of the protected functionality. The templates are defined in FrameXML/SecureTemplates.xml, and functionality supporting them resides in FrameXML/SecureTemplates.lua | |||
{| class="darktable" | |||
|+ SecureTemplates | |||
|- | |||
! Template | |||
! Widget Type | |||
! Function | |||
|- | |||
| [[SecureActionButtonTemplate]] || Button || Perform protected actions. | |||
|- | |||
| style="padding-left: 2em" | [[SecureUnitButtonTemplate]] || Button || Unit frames. | |||
|- class="row1" | |||
| [[SecureGroupHeaderTemplate]] || Frame || Managing group members. | |||
|- | |||
| style="padding-left: 2em" | [[SecurePartyHeaderTemplate]] || Frame || Managing party members. | |||
|- | |||
| style="padding-left: 2em" | [[SecureRaidGroupHeaderTemplate]] || Frame || Managing raid group members. | |||
|- | |||
| [[SecureGroupPetHeaderTemplate]] || Frame || Managing group pets. | |||
|- | |||
| style="padding-left: 2em" | [[SecurePartyPetHeaderTemplate]] || Frame || Managing party pets. | |||
|- | |||
| style="padding-left: 2em" | [[SecureRaidPetHeaderTemplate]] || Frame || Managing raid group pets. | |||
|} | |||
== An example == | |||
Suppose we wanted to create a button that, when clicked, would cast Thorns on the player. This can be solved by inheriting from SecureActionButtonTemplate and setting the relevant attributes. For example, using only XML: | |||
<Ui> | |||
<Button name="MyThornsButton" inherits="SecureActionButtonTemplate" parent="UIParent"> | |||
<Attributes> | |||
<Attribute name="type" type="string" value="spell"/> | |||
<Attribute name="spell" type="string" value="Thorns"/> | |||
<Attribute name="unit" type="string" value="player"/> | |||
</Attributes> | |||
<Size x="64" y="64"/> | |||
<Layers><Layer level="OVERLAY"> | |||
<Texture name="$parentIcon" file="Interface\Icons\Spell_Nature_Thorns" setAllPoints="true" /> | |||
</Layer></Layers> | |||
<Anchors><Anchor point="CENTER" /></Anchors> | |||
</Button> | |||
</Ui> | |||
{{API Trail Secure}} | |||
[[Category:UI technical details]] | |||
Latest revision as of 04:48, 15 August 2023
SecureTemplates are a family of protected frame and button templates defined as part of FrameXML. Through attribute-based configuration, they allow addons to access some of the protected functionality. The templates are defined in FrameXML/SecureTemplates.xml, and functionality supporting them resides in FrameXML/SecureTemplates.lua
| Template | Widget Type | Function |
|---|---|---|
| SecureActionButtonTemplate | Button | Perform protected actions. |
| SecureUnitButtonTemplate | Button | Unit frames. |
| SecureGroupHeaderTemplate | Frame | Managing group members. |
| SecurePartyHeaderTemplate | Frame | Managing party members. |
| SecureRaidGroupHeaderTemplate | Frame | Managing raid group members. |
| SecureGroupPetHeaderTemplate | Frame | Managing group pets. |
| SecurePartyPetHeaderTemplate | Frame | Managing party pets. |
| SecureRaidPetHeaderTemplate | Frame | Managing raid group pets. |
An example
Suppose we wanted to create a button that, when clicked, would cast Thorns on the player. This can be solved by inheriting from SecureActionButtonTemplate and setting the relevant attributes. For example, using only XML:
<Ui>
<Button name="MyThornsButton" inherits="SecureActionButtonTemplate" parent="UIParent">
<Attributes>
<Attribute name="type" type="string" value="spell"/>
<Attribute name="spell" type="string" value="Thorns"/>
<Attribute name="unit" type="string" value="player"/>
</Attributes>
<Size x="64" y="64"/>
<Layers><Layer level="OVERLAY">
<Texture name="$parentIcon" file="Interface\Icons\Spell_Nature_Thorns" setAllPoints="true" />
</Layer></Layers>
<Anchors><Anchor point="CENTER" /></Anchors>
</Button>
</Ui>
| |||||||||||||||||