changeset 11:952c3ac0e783

GetItemQualityColor change and TOC bump for 4.2
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Tue, 28 Jun 2011 19:18:07 +0000
parents 67b8537e8432
children 40ff9c63badc
files Ouro_Loot.toc core.lua gui.lua text_tabs.lua
diffstat 4 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/Ouro_Loot.toc	Tue Jun 28 07:36:26 2011 +0000
+++ b/Ouro_Loot.toc	Tue Jun 28 19:18:07 2011 +0000
@@ -1,4 +1,4 @@
-## Interface: 40100
+## Interface: 40200
 ## Title: Ouro Loot
 ## Version: @project-version@
 ## Notes: Raid loot tracking and text generation
--- a/core.lua	Tue Jun 28 07:36:26 2011 +0000
+++ b/core.lua	Tue Jun 28 19:18:07 2011 +0000
@@ -134,12 +134,9 @@
 
 	requesting		= nil   -- for prompting for additional rebroadcasters
 
-	thresholds, quality_hexes = {}, {}
+	thresholds = {}
 	for i = 0,6 do
-		local hex = _G.select(4,_G.GetItemQualityColor(i))
-		local desc = _G["ITEM_QUALITY"..i.."_DESC"]
-		quality_hexes[i] = hex
-		thresholds[i] = hex .. desc .. "|r"
+		thresholds[i] = _G.ITEM_QUALITY_COLORS[i].hex .. _G["ITEM_QUALITY"..i.."_DESC"] .. "|r"
 	end
 
 	_G.setfenv (1, _G)
@@ -170,7 +167,7 @@
 
 	function addon.format_hypertext (code, text, color)
 		return hypertext_format_str:format (code,
-			type(color)=='number' and addon.quality_hexes[color] or color,
+			type(color)=='number' and ITEM_QUALITY_COLORS[color].hex or color,
 			text)
 	end
 
@@ -524,6 +521,7 @@
 				return
 			end
 		end
+		-- Throttle the checks fired by common events.
 		if docheck and not InCombatLockdown() then
 			now = time()
 			if difftime(now,lastevent) > 45 then
--- a/gui.lua	Tue Jun 28 07:36:26 2011 +0000
+++ b/gui.lua	Tue Jun 28 19:18:07 2011 +0000
@@ -48,7 +48,7 @@
 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber
 
 local pprint, tabledump = addon.pprint, flib.tabledump
-local GetItemInfo = GetItemInfo 
+local GetItemInfo, ITEM_QUALITY_COLORS = GetItemInfo, ITEM_QUALITY_COLORS
 
 -- En masse forward decls of symbols defined inside local blocks
 local _generate_text, _populate_text_specials
@@ -184,7 +184,7 @@
 			-- actually needs to be replaced is even worse.  We'll live with
 			-- garbage for now.
 			if e.kind == 'loot' then
-				local textured = eoi_st_textured_item_format:format (e.itexture, self.quality_hexes[e.quality], e.itemname, e.count or "")
+				local textured = eoi_st_textured_item_format:format (e.itexture, ITEM_QUALITY_COLORS[e.quality].hex, e.itemname, e.count or "")
 				e.cols = {
 					{value = textured},
 					{value = e.person},
@@ -298,10 +298,10 @@
 				local textured
 				if itexture and iname then
 					textured = eoi_st_textured_item_format:format (itexture,
-						self.quality_hexes[iquality], iname, loot.count or "")
+						ITEM_QUALITY_COLORS[iquality].hex, iname, loot.count or "")
 				else
 					textured = eoi_st_textured_item_format:format ([[ICONS\INV_Misc_QuestionMark]],
-						self.quality_hexes[ITEM_QUALITY_COMMON], 'UNKNOWN - TRY AGAIN', "")
+						ITEM_QUALITY_COLORS[ITEM_QUALITY_COMMON].hex, 'UNKNOWN - TRY AGAIN', "")
 					cache_okay = false
 				end
 				col2.value = textured
@@ -1551,7 +1551,7 @@
 			for id in pairs(OuroLootSV_opts.itemfilter) do
 				local iname, _, iquality = GetItemInfo(id)
 				if iname then
-					list[id] = addon.quality_hexes[iquality] .. iname .. "|r"
+					list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r"
 				end
 			end
 			w = GUI:Create("EditBoxDropDown")
@@ -1565,7 +1565,7 @@
 					return addon:Print("Error:  %s is not a valid item name/link!", text)
 				end
 				local id = tonumber(ilink:match("item:(%d+)"))
-				list[id] = addon.quality_hexes[iquality] .. iname .. "|r"
+				list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r"
 				OuroLootSV_opts.itemfilter[id] = true
 				addon:Print("Now filtering out", ilink)
 			end)
@@ -1589,7 +1589,7 @@
 			grp:AddChild(w)
 			w = GUI:Create("Label")
 			w:SetRelativeWidth(0.4)
-			w:SetText(addon.quality_hexes[3].."Echo from latest ping:|r\n"..senders)
+			w:SetText(ITEM_QUALITY_COLORS[3].hex .."Echo from latest ping:|r\n"..senders)
 			grp:AddChild(w)
 		end
 
--- a/text_tabs.lua	Tue Jun 28 07:36:26 2011 +0000
+++ b/text_tabs.lua	Tue Jun 28 19:18:07 2011 +0000
@@ -46,7 +46,7 @@
 local warning_text
 do
 	local red = '|cffff0505'
-	local green = addon.quality_hexes[ITEM_QUALITY_UNCOMMON]
+	local green = ITEM_QUALITY_COLORS[ITEM_QUALITY_UNCOMMON].hex
 	warning_text = ([[%sWARNING:|r  Heroic items sharing the same name as normal items often display incorrectly on forums that use the item name as the identifier.  Recommend you change the %sItem markup|r dropdown in the right-hand side to %s"[item] by ID"|r and regenerate this loot.]]):format(red, green, green)
 end