View Single Post
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.