Thread Tools Display Modes
10-06-06, 07:02 PM   #1
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
UI mods and the Burning Crusade

UI mods and the Burning Crusade - Tyren, 10/06/2006

Hi there, this notification is meant to inform you of some significant changes regarding the way we're handling UI addons. Over the last few years, we've seen a number of awesome, gameplay-enhancing UI mods along with a fair number of UI mods that run counter to our philosophies regarding what addons should and shouldn't be able to do.

Essentially, we don't want UI mods to make combat-sensitive decisions for players and as such, we've made some changes that block functionality that we feel is counter to the spirit of these philosophies. As such, AddOns and macros can't make decisions on who to target or what spells to cast.

That being said, our programmers have implemented a host of new functionality in order to allow many popular and benign UI mods to continue to function (once those mods are updated to take advantage of the new functionality), and will be providing some follow-up information on these forums as to how to take advantage of the new functionality.


Just to clarify, AddOns and macros will still be able to cast spells (with user interaction of course), they just won't be able to use logic to intelligently pick spells or targets. - Slouken, 10/07/2006

Full details below (as posted by Iriel in his standard "Upcoming changes" thread).

Discuss the changes here.

You can read the original post by Tyren here.

Last edited by Dolby : 11-01-06 at 08:15 PM.
  Reply With Quote
10-06-06, 07:08 PM   #2
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Coroutines
* The Lua 5.1 coroutine library is now available.
* Each coroutine creates a new Lua state, so they should be used sparingly to reduce memory usage.

String Functions
... = strsplit(delimiters, string, [, limit])
string = strjoin(delimiter, ...)
string = strconcat(...)

strjoin(strsplit()) will always give you the original string.
strconcat(...) is equivalent to strjoin("", ...)

Protected Functions
* Addons and macro scripts may not use any movement, spell casting, or targeting functions. They also may not complete a trade transaction.
* Addons and macro scripts may only change macros, key bindings, and action buttons while you are not in combat.
* Action buttons and targeting frames are "protected", and may not be programmatically moved, shown or hidden, or have their action changed while in combat.
* There are several new frame member functions: Frame:IsProtected(), Frame:SetProtected(), and Frame:CanChangeProtectedState()

Security
* Added a script function secure(), which returns false for addon and macro scripts.
* Added a script function securecall("function" [, arguments]), which allows secure code to safely call functions which may be modified by addons. In general, use of this function breaks the script security model, so it should only be used in carefully controlled circumstances.
* Added a script function hooksecurefunc("function", hookfunc), which allows addons to hook secure functions without affecting the flow of execution. The hook function will be called after the secure function with the same arguments as the secure function. The return value of the hook function will be discarded. Note that this is the only safe way to hook functions that execute protected functionality.
* Secure XML templates remain secure when they are inherited. Any scripts which are overridden by an addon are no longer secure, of course.

Secure Templates
* There are several new secure templates that can be used by addons to create new functional buttons:
* SecureActionButtonTemplate
* SecureUnitButtonTemplate
* SecureStateHeaderTemplate
* SecureAnchorButtonTemplate
* SecureStanceStateDriverTemplate
* SecureRaidGroupHeaderTemplate
* SecureTradeButtonTemplate

Multiple Inheritance
* You can now specify multiple comma separated templates in the "inherits" XML attribute for frames, and in the inherits parameter for dynamically created frames. Each template will be inherited in the order specified, later templates overlaying earlier templates.

Frame Handlers
* Frame handlers now get local variables in addition to global variables. Accessing local variables is faster than accessing global variables, and is recommended.
* Script handlers defined in XML are implicitly wrapped with a function signature depending on the actual handler:
* default: function(self)
* OnAttributeChanged: function(self,name,value)
* OnChar: function(self,text)
* OnCharComposition: function(self,text)
* OnClick: function(self,button)
* OnColorSelect: function(self,r,g,b)
* OnCursorChanged: function(self,x,y,w,h)
* OnDoubleClick: function(self,button)
* OnDragStart: function(self,button)
* OnEvent: function(self,event,...)
* OnHorizontalScroll: function(self,offset)
* OnHyperlinkClick: function(self,link,text,button)
* OnHyperlinkEnter: function(self,link,text)
* OnHyperlinkLeave: function(self,link,text)
* OnInputLanguageChanged: function(self,language)
* OnKeyDown: function(self,key)
* OnKeyUp: function(self,key)
* OnMouseDown: function(self,button)
* OnMouseUp: function(self,button)
* OnMouseWheel: function(self,delta)
* OnMovieShowSubtitle: function(self,text)
* OnScrollRangeChanged: function(self,xrange,yrange)
* OnSizeChanged: function(self,w,h)
* OnTooltipAddMoney: function(self,cost)
* OnUpdate: function(self,elapsed)
* OnValueChanged: function(self,value)
* OnVerticalScroll: function(self,offset)
* PostClick: function(self,button)
* PreClick: function(self,button)

Frame Metatables
* Instead of a single metatable shared by all frames, each frame type has it's own metatable, for faster member function lookups.

Region Methods
* minx,miny,width,height = Region:GetRect()

Frame Methods
* minx,miny,width,height = Frame:GetBoundsRect()

Frame Attributes
* Frames can store attributes internally for use with secure templates. Setting an attribute is a protected function.
* Frame:SetAttribute("name", value)
* value = Frame:GetAttribute("name")

Frame Keybindings
* You can now bind keys directly to frames: SetBindingClick("KEY", "frameName"[, "mouseButton"])

The click is implemented as a mouse down when the key is pressed, and a mouse up when the key is released.

Override Keybindings
SetOverrideBinding(owner, isPriority, "KEY"[, "COMMAND"])
SetOverrideBindingSpell(owner, isPriority, "KEY", "spellname")
SetOverrideBindingClick(owner, isPriority, "KEY", "buttonName"[, "mouseButton"])
ClearOverrideBindings(owner)
Added optional checkOverride parameter to GetBindingAction()

Button Scripts
* In addition to OnClick, buttons now have PreClick and PostClick scripts.

Unit Focus
/focus unit (unit defaults to target)

The specified unit becomes the "focus" unit, and can be used anywhere a unit token can normally be used. When the focus changes, the "PLAYER_FOCUS_CHANGED" event is sent, and you begin to get normal unit events for the focus unit.

There are keybindings for setting your focus to your current target, and setting your current target to your focus. There is also a "focus" action in the secure action button template.

Unit Events
UNIT_TARGET is sent when a unit's target changes.

Spellcasting Events
These events are obsolete:
SPELLCAST_START
SPELLCAST_STOP
SPELLCAST_FAILED
SPELLCAST_INTERRUPTED
SPELLCAST_DELAYED
SPELLCAST_CHANNEL_START
SPELLCAST_CHANNEL_UPDATE
SPELLCAST_CHANNEL_STOP
There are a number of new events:
UNIT_SPELLCAST_SENT, "player", spell, rank, target
UNIT_SPELLCAST_START, unit
UNIT_SPELLCAST_STOP, unit
UNIT_SPELLCAST_FAILED, unit
UNIT_SPELLCAST_INTERRUPTED, unit
UNIT_SPELLCAST_DELAYED, unit
UNIT_SPELLCAST_SUCCEEDED, "player", spell, rank
UNIT_SPELLCAST_CHANNEL_START, unit
UNIT_SPELLCAST_CHANNEL_UPDATE, unit
UNIT_SPELLCAST_CHANNEL_STOP, unit
There are also two new functions:
spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(unit)

Self Casting
* SetActionSelfCastKey("SHIFT" or "CTRL" or "ALT")
* key = GetActionSelfCastKey()
* down = IsActionSelfCastKeyDown()

Auto Looting
* SetAutoLootDefault(state)
* state = GetAutoLootDefault()
* SetAutoLootToggleKey("SHIFT" or "CTRL" or "ALT")
* key = GetAutoLootToggleKey()
* down = IsAutoLootKeyDown()

Last edited by Cairenn : 10-10-06 at 11:05 AM.
  Reply With Quote

WoWInterface » Site Forums » News » UI mods and the Burning Crusade


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off