Mercurial > wow > askmrrobot
diff amr-constants.lua @ 31:44c285acfff0 v8
fixed item display bug on summary tab
author | yellowfive |
---|---|
date | Sat, 18 Oct 2014 10:33:33 -0700 |
parents | 4317e56e0a91 |
children | 4ba69d2ee252 |
line wrap: on
line diff
--- a/amr-constants.lua Fri Oct 17 02:44:16 2014 -0700 +++ b/amr-constants.lua Sat Oct 18 10:33:33 2014 -0700 @@ -33,6 +33,40 @@ return item end +-- item link format: |cffa335ee|Hitem:itemID:enchant:gem1:gem2:gem3:gem4:suffixID:uniqueID:level:upgradeId:instanceDifficultyID:numBonusIDs:bonusID1:bonusID2...|h[item name]|h|r + +function AskMrRobot.createItemLink(itemObj) + + if itemObj == nil or itemObj.id == nil or itemObj.id == 0 then return nil end + + local parts = {} + table.insert(parts, "item") + table.insert(parts, itemObj.id) + table.insert(parts, itemObj.enchantId) + table.insert(parts, itemObj.gemIds[1]) + table.insert(parts, itemObj.gemIds[2]) + table.insert(parts, itemObj.gemIds[3]) + table.insert(parts, itemObj.gemIds[4]) + table.insert(parts, -math.abs(itemObj.suffixId)) + table.insert(parts, 0) + table.insert(parts, UnitLevel("player")) + table.insert(parts, itemObj.upgradeId) + table.insert(parts, 0) + + if itemObj.bonusIds then + table.insert(parts, #itemObj.bonusIds) + for i,v in ipairs(itemObj.bonusIds) do + table.insert(parts, v) + end + end + + return table.concat(parts, ":") +end + +function AskMrRobot.createGemLink(gemId) + +end + -- convenience to get just the item id (or 0 if not a valid link) from an item link function AskMrRobot.getItemIdFromLink(itemLink) if not itemLink then return 0 end @@ -223,12 +257,12 @@ [6] = _G["WAISTSLOT"], [7] = _G["LEGSSLOT"], [8] = _G["FEETSLOT"], - [9] = _G["WROSTSLOT"], + [9] = _G["WRISTSLOT"], [10] = _G["HANDSSLOT"], - [11] = _G["FINGER0SLOT"], - [12] = _G["FINGER1SLOT"], - [13] = _G["TRINKET0SLOT"], - [14] = _G["TRINKET1SLOT"], + [11] = _G["FINGER0SLOT"] .. " 1", + [12] = _G["FINGER1SLOT"] .. " 2", + [13] = _G["TRINKET0SLOT"] .. " 1", + [14] = _G["TRINKET1SLOT"] .. " 2", [15] = _G["BACKSLOT"], [16] = _G["MAINHANDSLOT"], [17] = _G["SECONDARYHANDSLOT"]