Addons&Macro Upcoming 2.3 Changes
This is a consolidated list of the announced (andsometimes observed) changes in the User Interface API's andfunctionality for the 2.3 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!
Macro Commands
* NEW - /petautocasttoggle <slot or spell name>
* NEW - /targetlastenemy, /targetlastfriend
* NEW - /targetexact <name>
* UPDATED - /cancelform will be recognized instantly (as /dismount is currently)
* Added the following macro conditional abbreviations; modifier-> mod, button -> btn, actionbar -> bar, equipped -> worn ,stance -> form(e.g. [mod:SELFCAST])
Frame methods
* NEW - registered = Frame:IsEventRegistered("event")
* NEW - FontString:SetFormattedText(format, ...) -- Like settingthe text to be the result of a string.format call, but without thegarbage overhead of creating a temporary lua string for the result.
* NEW - Button:SetFormattedText(format, ...)
* NEW - height = FontString:GetStringHeight()
* UPDATED - width = FontString:GetWidth([explicitOnly]) -- Addednew optional parameter which, if provided and true, returns 0 if thewidth has not been explicitly set rather than returning the effectivewidth. Defaults to false.
* UPDATED - height = FontString:GetHeight([explicitOnly]) -- as above, but for height
Frame Support
* NEW - frame1, frame2, ... = GetFramesRegisteredForEvent("event")
API Methods
* NEW - PickupItem(itemID or "item")
* UPDATED - count = GetItemCount(item, includeBank,[ includeUses])-- new includeUses flag that returns the same value thatGetActionCount() would for that item
* NEW - count = GetSpellCount("name" or slot [,book]) -- Returnsthe same value that GetActionCount() would return for that spell
* NEW - selected = IsSelectedSpell(slot) -- Replaces IsCurrentCast()
* REMOVED - IsCurrentCast(slot) -- Replaced with IsSelectedSpell
* NEW - current = IsCurrentSpell("name" or slot [,book]) -- Consistent with IsCurrentAction
* NEW - isConsumable = IsConsumableSpell("name" or slot [,book]) -- Consistent with IsConsumableAction
* NEW - helpful = IsHelpfulItem(item) - Contains a right clickability that targets friendly units (Note that a few spells are neitherhelpful nor harmful and can be cast on anyone.)
* NEW - harmful = IsHarmfulItem(item) - Contains a right click ability that targets enemy units (See note above)
* NEW - helpful = IsHelpfulSpell("name" or slot,"book") - The spell targets friendly units (See note above)
* NEW - harmful = IsHarmfulSpell("name" or slot,"book") - The spell targets enemy units (See note above)
* NEW - item, link = GetMacroItem(macro)
* NEW - spell, rank = GetMacroSpell(macro)
Garbage Collection
* in 2.3 the game will be performing extra garbage collection outside of combat to keep memory use down.
As always, the game will perform better if you don't generate any garbage, and here are some tips to do that:
* If you're composing a formatted string to display in a button orfont string, use the new FontString:SetFormattedText(fmt, ...) API
* If you write a function that returns many values, considerreturning them directly instead of creating a table and returning thattable.
* If returning a table from a function really is most convenient,have the caller of that function pass in the table to be filled outinstead of creating a new table inside the function so that the callercan re-cycle that table later.
Auction API
* UPDATED - QueryAuctionItems([getAll]) -- Added a new booleanargument, setting it to true will retrieve all auction house data (notjust 50 items). This can only be used once every 15 minutes. This isintended to reduce our load from add-ons such as auctioneer that aregoing to download the entire auction house anyways.
* UPDATED - canQuery, canQueryAll = CanSendAuctionQuery() -- Nowreturns two results. First (bool) is if you can send a regular query,second (bool) is if you can ask for all auction house data.
* UPDATED - isReversed, isReversedUsed = IsAuctionSortReversed()-- Now returns two results. First (bool) is true if the sort isreversed, second (bool) is true if the current sort supports reversal
* NEW - sort, reversed = GetAuctionSort(type, index) -- Enumerateswhat sorts are being currently used on the table and in what order.
. o 'type' – string – which table to retrieve the sort for (ie. “owner”, “bidder” or “list”).
. o 'index' - number – the index of the sort to retrieve (1 for the first sort, 2 for the second sort, etc).
. o 'sort' – string - the sort being used (nil if there isn’t a sort at this index)
. o 'reversed' – bool – true if the sort is reversed
* NEW - SortAuctionClearSort(type) -- Clears all sorts on a specific table.
* NEW - SortAuctionSetSort(type, sort, reverse) -- Prepends a newsort to an auction table pushing all other sorts down (the new sort isnot applied automatically).
. o 'type' – string – which table to clear the sorts on (ie. “owner”, “bidder”, or “list”).
. o 'sort' – string – the sort to add (ie. “quality”, “level”,“duration”, “status”, “bid”, “name”, “buyout”, “seller”,“buyoutthenbid”, “quantity”).
. o 'reverse' – bool – true if this sort should be applied in reverse order.
* NEW - SortAuctionApplySort(type) - Applies the sort that has been configured for a specific table.
NOTE: There is a new sort type “quantity”, which allows sorts by the number of items.
Mail API
When composing mail, there are now “slots”, that you can drag itemsinto (1 is the first slot, 2 is the second slot, etc). Once the mailarrives, you use an “index” to refer to each attachment.
* UPDATED - ClickSendMailItemButton(attachSlot) -- Added a numeric“attachSlot” argument to this existing function specifying which slotwas clicked on.
* UPDATED - GetSendMailItem(attachSlot) -- Added the new attachSlot argument
* UPDATED - GetSendMailItemLink(attachSlot) -- Added th new attachSlot argument
* NOTE - GetSendMailPrice() -- The price of mail depends on how many items are attached
* UPDATED - GetInboxItem(messageIndex, attachIndex) -- Added the new attachSlot argument
* UPDATED - GetInboxItemLink(messageIndex, attachIndex) -- Added the new attachSlot argument
* UPDATED - TakeInboxItem(messageIndex, attachIndex) -- Added the new attachSlot argument 阅.
. e...之前有modifier:SELFCAST?
取值不是只有ctrl alt shift么 /targetlastenemy 这个好像不是新的宏命令吧 我记得用好久了 我的blz风格的蓝字高亮咋没了5555 /targetlastenemy
我在2.1.4上就没有成功使用过...
2.1.3的时候倒是可以
页:
[1]