* 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.
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 two new frame member functions: Frame:IsProtected() and Frame:CanChangeProtectedState()
* 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([table,] "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.
* There are several new secure templates that can be used by addons to create new functional buttons:
* SecureUnitButtonTemplate, protected, uses attribute "unit"
* SecureActionButtonTemplate, protected, uses attribute "type", which can be one of "action", "pet", "spell", "item", "target", "focus", and "menu", and uses an optional attribute "unit"
* SecureRaidGroupHeaderTemplate, protected, uses a number of attributes
* 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 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)
* 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)
* Instead of a single metatable shared by all frames, each frame type has it's own metatable, for faster member function lookups.
* 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")
* You can now bind keys directly to buttons: SetBindingClick("KEY", "buttonName"[, "mouseButton"])
* In addition to OnClick, buttons now have PreClick and PostClick scripts.
/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_TARGET is sent when a unit's target changes.
These events are obsolete:
There are a number of new events:
UNIT_SPELLCAST_SENT, "player", spell, rank, target
UNIT_SPELLCAST_SUCCEEDED, "player", spell, rank
There are also two new functions:
spell, rank, displayName, icon, startTime, endTime = UnitCastingInfo(unit)
spell, rank, displayName, icon, startTime, endTime = UnitChannelInfo(unit)
* SetActionSelfCastKey("SHIFT" or "CTRL" or "ALT")
* key = GetActionSelfCastKey()
* down = IsActionSelfCastKeyDown()
* state = GetAutoLootDefault()
* SetAutoLootToggleKey("SHIFT" or "CTRL" or "ALT")
* key = GetAutoLootToggleKey()
* down = IsAutoLootKeyDown()
Cork is becoming OOC-only (I may make the changes early so people get used to it too).
PTarg is gonna be display-only, which is fine by me :) I'll probably work with Clad to add some nice simple ToT frames to PRaid. I'm thinking something like highlighting the targets that are show on PTarg, and dimming out the deplicates.
These are some pretty drastic changes. I can't think of how much time was wasted between all of those developers out there making countless mods for casting scripts and frame/status modifying and monitoring. I'm glad I stopped playing a healing class a long time ago.
Action buttons and targeting frames are "protected", and may not be programmatically moved, shown or hidden, or have their action changed while in combat.[/b]
As a non LUA programmer, I am most likely showing alot of ignorance, but the logical person in me makes me think:
Does this mean that such simple things as Bar Switching in Actionbar addons for such things as Shapeshifting/Stances/Stealth are not going to work? Will this force all Druids/Warriors/Rogues to use the crappy default Action Bars?
luzienne you asked pretty much the same exact thing I was going to, I really hope this isn't true or else I will stop playing my Druid for the expansion. Im not going to have 3 sets of buttons on my screen at one time when I can only use 1 of them. =/
They'll infact implement a simple slash command for page changing.
* The old CURRENT_ACTIONBAR_PAGE variable is no longer used. There's a new slash command /changeactionbar <num>. Macros that used to do /script CURRENT_ACTIONBAR_PAGE=2 ChangeActionBarChange() can now simply do /changeactionbar 2
* The new /swapactionbar <numA> <numB> toggles between two action bars.