WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Legion Beta archived threads (https://www.wowinterface.com/forums/forumdisplay.php?f=177)
-   -   GetItemIcon fails for Toys and this affects macros (https://www.wowinterface.com/forums/showthread.php?t=54109)

Jarod24 08-03-16 07:58 AM

GetItemIcon fails for Toys and this affects macros
 
Tested on Live servers, EU
GetBuildInfo() ==> 7.0.3, 22293, Jul 22 2016, 70000

Tested on Beta server
GetBuildInfo() ==> 7.0.3, 22324, Jul 28 2016, 70000


Problem 1: GetItemIcon() does not return a icon for Toys.

Code:

local a = GetItemIcon("Conjured Mana Cake"); --an item in our bag, returns a number
local b = GetItemIcon("Loot-A-Rang");--an item in your toybox, returns nil

Workaround: Get the icon for Toys by using GetItemInfo().

Code:

local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, icon = GetItemInfo("Loot-A-Rang");



Update: Seems that SetMacroItem does not set icons for neither items nor toys.

Problem 2: SetMacroItem() Does not set an icon for the macro when using it with a Item or toy.

Code:

SetMacroItem("MyMacro", "Conjured Mana Cake"); --Macro's icon fails to match the item
SetMacroItem("MyMacro", "Loot-A-Rang"); --Macro fails to set icon when used with a Toy.


Workaround: Call EditMacro() and use the numerical icon value from GetItemInfo() to set the icon

Code:

local icon = "123456";
EditMacro(macroIndex, nil, icon, macroBody);

EditMacro() also works with old style texture strings like "INV_MISC_QUESTIONMARK" (for now).

semlar 08-03-16 10:37 AM

GetItemInfoInstant gives the texture as the 5th return and doesn't rely on the cache (although it hopefully doesn't matter for toys).


All times are GMT -6. The time now is 10:02 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI