Quantcast GetItemIcon fails for Toys and this affects macros - WoWInterface
 
Thread Tools Display Modes
08-03-16, 07:58 AM   #1
Jarod24
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 66
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).
__________________
Author of IfThen, Links in Chat

Last edited by Jarod24 : 08-03-16 at 08:16 AM.
 
08-03-16, 10:37 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,059
GetItemInfoInstant gives the texture as the 5th return and doesn't rely on the cache (although it hopefully doesn't matter for toys).
 
 

WoWInterface » Site Forums » Archived Beta Forums » Legion Beta archived threads » GetItemIcon fails for Toys and this affects macros

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off