Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
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
WoW:SecureUnitButtonTemplate
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!
{{uitech}} '''SecureUnitButtonTemplate''' is one of the SecureTemplates introduced in Patch 2.0. It's purpose is to allow creation of unit frames, executing certain protected actions from secure code in response to clicks. This template's behavior differs only slightly from [[SecureActionButtonTemplate]], and can be thought of as a special case. The only difference is in how the menu function is handled: the template allows spells currently being targeted to be cancelled before calling the menu function. == Supporting API == FrameXML defines a convenience method to interact with this template: '''SecureUnitButton_OnLoad'''(self, unit, menufunc) :; self : Frame - frame inheriting from SecureUnitButtonTemplate. :; unit : String - unit this unit frame is showing/acting on. :; menuFunc : Function - menu function to show when the frame is right clicked. The function sets a limited number of attributes on a frame to make it behave like the default unit frames: left clicks target the unit, and right clicks open the menu by calling menuFunc(self, unit, button). Another useful function is {{api|RegisterUnitWatch}}(frame), which controls the visibility of a protected frame based on whether the unit specified by the frame's "unit" attribute exists. == Supported Attributes == The template supports all of the attributes supported by [[SecureActionButtonTemplate]], and behaves in similar fashion. There is a single special case: if the value of the [[SecureActionButtonTemplate#Modified attributes|modified attribute]] "type" is "menu" (with no unit remapping performed), the OnClick cancels any spell being targeted and calls menuFunc(). [[SecureActionButtonTemplate#Other attributes|Some attributes]] may be used to enable automatic vehicle unit remapping for the frame: making the player frame behave as a vehicle frame, and a pet frame behave as a player frame when the player is in a vehicle. {{API Trail Secure}}
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)
Templates used on this page:
Template:API Trail Secure
(
edit
)
Template:Api
(
edit
)
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Navbar
(
edit
)
Template:Navbox
(
edit
)
Template:Tcl
(
edit
)
Template:Uitech
(
edit
)