Ad blocker interference detected!
Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers
Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.
|This article documents API changes made in patch 2.2.0.
← API change summaries
Key Bindings Edit
The game will distinguish between right and left modifier keys:
- Key bindings and modified clicks may optionally specify LSHIFT, RSHIFT, LCTRL, RCTRL, LALT, RALT instead of the normal SHIFT, CTRL, ALT modifiers. The default UI will not set L/R modifiers and will continue to use the normal (either side) modifiers.
- Macro conditionals may use lshift, rshift, lctrl, rctrl, lalt, ralt in addition to the normal modifiers.
- There are several new API functions to query each modifier individually: IsLeftShiftKeyDown(), IsRightShiftKeyDown(), IsLeftControlKeyDown(), IsRightControlKeyDown(), IsLeftAltKeyDown(), IsRightAltKeyDown()
There will be a unified system for customizing modified clicks in the UI:
Modified Clicks are specified using a new section in Bindings.xml, e.g.
<ModifiedClick action="DRESSUP" default="CTRL-BUTTON1"/>
These click actions are context sensitive, and Lua code chooses which action is appropriate based on the current context.
- count = GetNumModifiedClickActions()
- action = GetModifiedClickAction(index)
- SetModifiedClick("action", "binding")
- binding = GetModifiedClick("action")
- active = IsModifiedClick(["action"])
A "binding" is in the form of MOD-BUTTONX, e.g. CTRL-BUTTON1, or a simple modifier, e.g. CTRL
These modified click bindings are loaded and saved with the normal key bindings, so if you make changes you'll need to save them with:
The Blizzard code has been reworked to use the following modified click actions:
- <ModifiedClick action="SELFCAST" default="ALT"/>
- <ModifiedClick action="AUTOLOOTTOGGLE" default="SHIFT"/>
- <ModifiedClick action="STICKYCAMERA" default="CTRL"/>
- <ModifiedClick action="CHATLINK" default="SHIFT-BUTTON1"/>
- <ModifiedClick action="DRESSUP" default="CTRL-BUTTON1"/>
- <ModifiedClick action="SOCKETITEM" default="SHIFT-BUTTON2"/>
- <ModifiedClick action="SPLITSTACK" default="SHIFT"/>
- <ModifiedClick action="PICKUPACTION" default="SHIFT"/>
- <ModifiedClick action="COMPAREITEMS" default="SHIFT"/>
- <ModifiedClick action="OPENALLBAGS" default="SHIFT"/>
- <ModifiedClick action="QUESTWATCHTOGGLE" default="SHIFT"/>
- The pitchLimit setting will be re-enabled.
Bug Fixes Edit
- Fixed issue where frame sizes/positions aren't correctly recalculated on demand.
- Fixed unnecessary chopping of FontString contents when scaled.
- Fixed mishandling of doublewide frames when opening game menu.
- If you specify a target for a spell cast in a macro that does not exist, it will show an error instead of defaulting to your current target.
- Conditional macros with multiple targets will use the appropriate context sensitive target for visual range feedback.
- The entire dynamic macro update system has been moved into highly optimized C++ for 2.2, resulting in a roughly 100x speedup (That's times, not percent). Please keep an eye out for bugs in macro options and dynamic feedback, since it's all completely rewritten from scratch.
- You will be able to use item:N, where N is the ID of the item, instead of the item name in macros. One of the advantages of this is that it will work even if you don't currently have the item, as long as it is in your item cache (e.g. GetItemInfo("item:N") returns non-nil)
- All macro conditional names are now lower-case only. - Previously mixed case conditionals (e.g. Stance) were allowed, now they will only be recognized in their lower case form (e.g. stance).
- The modifier conditional supports the new named conditionals, these are case sensitive and the standard UI ones are all uppercase (e.g. [modifier:SELFCAST])
Frame Support Edit
- Frame:RegisterEvent() and Frame:UnregisterEvent() have been optimized and can be used in conjunction with OnShow() and OnHide() to greatly improve performance of the UI. This technique has been used to optimize the bank, bags, inventory, spellbook, and unit frames for a decent speed improvement in 2.2.0.
- The game tooltip now handles periodic updates directly instead of requiring OnUpdate functions in each button that might have a tooltip. Many of the related OnEnter functions now take a 'self' parameter, so AddOns will need to be updated to reflect this change.
- Frame positions are saved relative to the nearest corner rather than the upper left corner, so that they don't move when changing resolution and screen aspect ratio.
- NEW - Frame:SetClampRectInsets(left, right, top, bottom) -- Set the portion of a frame which is clamped to the screen.
- NEW - left, right, top, bottom = Frame:GetClampRectInsets() - Get the portion of a frame which is clamped to the screen.
- NEW VERSION - value = Frame:GetAttribute(prefix, name, suffix) - Performs an attribute wildcard search (prefix..name..suffix, "*"..name..suffix, prefix..name.."*", "*"..name.."*", name) and returns the first result found (Added to optimize SecureButton_GetModifiedAttrbute)
- Extra notes on the new Frame positioning
Frame positions are actually saved relative to the following points: TOPLEFT, TOP, TOPRIGHT, LEFT, CENTER, RIGHT, BOTTOMLEFT, BOTTOM and BOTTOMRIGHT not only the corners. To fix the frame positioning in your addons save the relativepoint argument in addition to the X and Y coordinates from GetPoint()
- All UNIT_SPELLCAST_* events now have the name and rank of the spell as arg2 and arg3.
Protected Functions Edit
- Picking up pet actions, spells, actions, and macros are all protected actions while in combat. This fixes a macro conditional logic exploit.
Secure Drivers Edit
- RegisterStateDriver can be used with a state of "visibility" to show and hide frames based on arbitrary macro conditionals, e.g. RegisterStateDriver(MyBadTargetFrame, "visibility", "[exists,harm] show; hide")
- The unit setting support in SecureStateHeader now uses "clear" instead of "none" to specify that the unit attribute should be set to nil, to resolve a conflict with use of "none" as a valid unit.