Mercurial > wow > askmrrobot
comparison 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 |
comparison
equal
deleted
inserted
replaced
30:55906ac875ae | 31:44c285acfff0 |
---|---|
29 table.insert(item.bonusIds, tonumber(parts[i])) | 29 table.insert(item.bonusIds, tonumber(parts[i])) |
30 end | 30 end |
31 end | 31 end |
32 | 32 |
33 return item | 33 return item |
34 end | |
35 | |
36 -- item link format: |cffa335ee|Hitem:itemID:enchant:gem1:gem2:gem3:gem4:suffixID:uniqueID:level:upgradeId:instanceDifficultyID:numBonusIDs:bonusID1:bonusID2...|h[item name]|h|r | |
37 | |
38 function AskMrRobot.createItemLink(itemObj) | |
39 | |
40 if itemObj == nil or itemObj.id == nil or itemObj.id == 0 then return nil end | |
41 | |
42 local parts = {} | |
43 table.insert(parts, "item") | |
44 table.insert(parts, itemObj.id) | |
45 table.insert(parts, itemObj.enchantId) | |
46 table.insert(parts, itemObj.gemIds[1]) | |
47 table.insert(parts, itemObj.gemIds[2]) | |
48 table.insert(parts, itemObj.gemIds[3]) | |
49 table.insert(parts, itemObj.gemIds[4]) | |
50 table.insert(parts, -math.abs(itemObj.suffixId)) | |
51 table.insert(parts, 0) | |
52 table.insert(parts, UnitLevel("player")) | |
53 table.insert(parts, itemObj.upgradeId) | |
54 table.insert(parts, 0) | |
55 | |
56 if itemObj.bonusIds then | |
57 table.insert(parts, #itemObj.bonusIds) | |
58 for i,v in ipairs(itemObj.bonusIds) do | |
59 table.insert(parts, v) | |
60 end | |
61 end | |
62 | |
63 return table.concat(parts, ":") | |
64 end | |
65 | |
66 function AskMrRobot.createGemLink(gemId) | |
67 | |
34 end | 68 end |
35 | 69 |
36 -- convenience to get just the item id (or 0 if not a valid link) from an item link | 70 -- convenience to get just the item id (or 0 if not a valid link) from an item link |
37 function AskMrRobot.getItemIdFromLink(itemLink) | 71 function AskMrRobot.getItemIdFromLink(itemLink) |
38 if not itemLink then return 0 end | 72 if not itemLink then return 0 end |
221 [3] = _G["SHOULDERSLOT"], | 255 [3] = _G["SHOULDERSLOT"], |
222 [5] = _G["CHESTSLOT"], | 256 [5] = _G["CHESTSLOT"], |
223 [6] = _G["WAISTSLOT"], | 257 [6] = _G["WAISTSLOT"], |
224 [7] = _G["LEGSSLOT"], | 258 [7] = _G["LEGSSLOT"], |
225 [8] = _G["FEETSLOT"], | 259 [8] = _G["FEETSLOT"], |
226 [9] = _G["WROSTSLOT"], | 260 [9] = _G["WRISTSLOT"], |
227 [10] = _G["HANDSSLOT"], | 261 [10] = _G["HANDSSLOT"], |
228 [11] = _G["FINGER0SLOT"], | 262 [11] = _G["FINGER0SLOT"] .. " 1", |
229 [12] = _G["FINGER1SLOT"], | 263 [12] = _G["FINGER1SLOT"] .. " 2", |
230 [13] = _G["TRINKET0SLOT"], | 264 [13] = _G["TRINKET0SLOT"] .. " 1", |
231 [14] = _G["TRINKET1SLOT"], | 265 [14] = _G["TRINKET1SLOT"] .. " 2", |
232 [15] = _G["BACKSLOT"], | 266 [15] = _G["BACKSLOT"], |
233 [16] = _G["MAINHANDSLOT"], | 267 [16] = _G["MAINHANDSLOT"], |
234 [17] = _G["SECONDARYHANDSLOT"] | 268 [17] = _G["SECONDARYHANDSLOT"] |
235 } | 269 } |
236 | 270 |