Hi everyone,
I have a bug which I cannot seem to fix or figure out what is causing it. I have this code:
Lua Code:
local function updateIcons()
if not PaperDollFrame:IsShown() then return end
for i, slot in next, slots do
if i == 18 then i = 19 end
local link = GetInventoryItemLink("player", i)
local slotName = _G["Character"..slot.."Slot"]
local iconBorder = _G["mui_" .. "Character" .. slot .. "Slot"]
if link then
slotName.icon:SetAlpha(1)
local r, g, b, _ = GetItemQualityColor(select(3, GetItemInfo(link)))
iconBorder:SetBackdropBorderColor(r, g, b, 1)
iconBorder:SetBackdropColor(r,g,b,0.2)
end
end
end
running with this:
Lua Code:
PaperDollFrame:HookScript("OnShow", updateIcons)
ef:RegisterEvent("UNIT_INVENTORY_CHANGED")
ef:SetScript("OnEvent", updateIcons)
in a PLAYER_LOGIN event. However this line:
Lua Code:
local r, g, b, _ = GetItemQualityColor(select(3, GetItemInfo(link)))
shows this lua error each time I login:
Code:
Message: Interface\AddOns\MayronUI_Core\Skinning.lua:174: Usage: GetItemQualityColor(index)
Time: 05/04/14 22:10:48
Count: 15
Stack: [C]: ?
[C]: in function `GetItemQualityColor'
Interface\AddOns\MayronUI_Core\Skinning.lua:174: in function <Interface\AddOns\MayronUI_Core\Skinning.lua:163>
Locals:
It is just to get item icons fro mthe character frame and color the border depending on the items rarity value. I am not sure why this is happening because the player has logged in and it does actually work, but I get the error saying I'm using it incorrectly? I'm not sure and hopefully the code makes sense to know what I am trying to do. If anyone has any advice or a fix for me then that would be brilliant but if you need extra information let me know. Thanks in advance guys!
Usage: GetItemQualityColor(index)