Mercurial > wow > inventory
comparison ItemData.class.lua @ 74:8d11fc88ecab
Default summary width is now 700 pixels (up from 650).
Changed the item data table into a class which is now also used at the custom widgets.
| author | Zerotorescue |
|---|---|
| date | Fri, 24 Dec 2010 21:55:11 +0100 |
| parents | |
| children | 958aba5f3297 |
comparison
equal
deleted
inserted
replaced
| 73:6216b754350d | 74:8d11fc88ecab |
|---|---|
| 1 local addon = select(2, ...); | |
| 2 | |
| 3 -- Define the class | |
| 4 | |
| 5 addon.ItemData = {}; | |
| 6 addon.ItemData.__index = addon.ItemData; | |
| 7 | |
| 8 -- Construct | |
| 9 function addon.ItemData:New(itemId) | |
| 10 local self = {}; | |
| 11 | |
| 12 setmetatable(self, addon.ItemData); | |
| 13 | |
| 14 local itemName, itemLink, itemRarity, _, _, _, _, _, _, itemTexture = GetItemInfo(itemId); | |
| 15 | |
| 16 -- Standard info everything needs | |
| 17 self.id = itemId; | |
| 18 self.name = itemName; | |
| 19 self.link = itemLink; | |
| 20 self.rarity = itemRarity; | |
| 21 self.icon = itemTexture; | |
| 22 | |
| 23 -- Detailed stuff | |
| 24 self.value = -3; | |
| 25 self.globalCount = -3; | |
| 26 self.localCount = -3; | |
| 27 self.set = {}; | |
| 28 | |
| 29 return self; | |
| 30 end |
