diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ItemData.class.lua	Fri Dec 24 21:55:11 2010 +0100
@@ -0,0 +1,30 @@
+local addon = select(2, ...);
+
+-- Define the class
+
+addon.ItemData = {};
+addon.ItemData.__index = addon.ItemData;
+
+-- Construct
+function addon.ItemData:New(itemId)
+	local self = {};
+	
+	setmetatable(self, addon.ItemData);
+	
+	local itemName, itemLink, itemRarity, _, _, _, _, _, _, itemTexture = GetItemInfo(itemId);
+	
+	-- Standard info everything needs
+	self.id = itemId;
+	self.name = itemName;
+	self.link = itemLink;
+	self.rarity = itemRarity;
+	self.icon = itemTexture;
+	
+	-- Detailed stuff
+	self.value = -3;
+	self.globalCount = -3;
+	self.localCount = -3;
+	self.set = {};
+	
+	return self;
+end