2.2 API更新 - 简要列表 (en版本)
原帖发布于[url]http://forums.worldofwarcraft.com/thread.html?topicId=102909678&[/url];sid=1This is a consolidated list of the announced (andsometimes observed) changes in the User Interface API's andfunctionality for the 2.2.0 release. Please note that this thread is todiscuss the upcoming changes and any clarifications or features thatare a direct result of those changes, or things which we've been askedto remind slouken of.
IMPORTANT: Off-topic or entirely redundant posts are liable to getdeleted. It is however in everyone's best interest to not post them inthe first place - We'd rather slouken could spend his time coding uscool things than moderating this thread!
[b]Key Bindings[/b]
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, ALTmodifiers. The default UI will not set L/R modifiers and will continueto 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 modifierindividually: 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 name="DRESSUP" default="CTRL-BUTTON1"/>
These click actions are context sensitive, and Lua code chooses which action is appropriate based on the current context.
Script API:
* 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 normalkey bindings, so if you make changes you'll need to save them with:
SaveBindings(GetCurrentBindingSet()) ;
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"/>
This system replaces the following functions:
SetAutoLootToggleKey(), GetAutoLootToggleKey(), IsAutoLootKeyDown()
SetActionSelfCastKey(), GetActionSelfCastKey(), IsActionSelfCastKeyDown()
[b]Settings[/b]
* The pitchLimit setting will be re-enabled.
[b]Bug Fixes[/b]
* 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.
[b]Targetting[/b]
* If you specify a target for a spell cast in a macro that does notexist, it will show an error instead of defaulting to your currenttarget.
[b]Macros[/b]
* 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 highlyoptimized C++ for 2.2, resulting in a roughly 100x speedup (That'stimes, not percent). [b]Please keep an eye out for bugs in macrooptions and dynamic feedback, since it's all completely rewritten fromscratch. TEST COMPLEX MACROS THOROUGHLY IN THE PTR[/b]
* 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 isthat it will work even if you don't currently have the item, as long asit is in your item cache (e.g. GetItemInfo("item:N") returns non-nil)
* [b]All macro conditionals are now lower-case only.[/b] -Previously mixed case conditionals (e.g. Stance) were allowed, now theywill only be recognized in their lower case form (e.g. stance).
[b]Frame Support[/b]
* Frame:RegisterEvent() and Frame:UnregisterEvent() have beenoptimized and can be used in conjunction with OnShow() and OnHide() togreatly improve performance of the UI. This technique has been used tooptimize the bank, bags, inventory, spellbook, and unit frames for adecent speed improvement in 2.2.0.
* The game tooltip now handles periodic updates directly insteadof requiring OnUpdate functions in each button that might have atooltip. [b]Many of the related OnEnter functions now take a 'self' parameter, so AddOns will need to be updated to reflect this change.[/b]
* Frame positions are saved relative to the nearest corner ratherthan the upper left corner, so that they don't move when changingresolution 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.
[b]Events[/b]
* All UNIT_SPELLCAST_* events now have the name and rank of the spell as arg2 and arg3.
[b]Protected Functions[/b]
* Picking up pet actions, spells, actions, and macros are allprotected actions while in combat. This fixes a macro conditional logicexploit. BLZ官方人员又对此增加的内容 如下
In 2.2 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 name="DRESSUP" default="CTRL-BUTTON1"/>
These click actions are context sensitive, and Lua code chooses which action is appropriate based on the current context.
Script API:
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:
SaveBindings(GetCurrentBindingSet()) ;
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"/>
This system replaces the following functions:
SetAutoLootToggleKey(), GetAutoLootToggleKey(), IsAutoLootKeyDown()
SetActionSelfCastKey(), GetActionSelfCastKey(), IsActionSelfCastKeyDown()
页:
[1]