comparison gui.lua @ 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 5ee4edd24c13
comparison
equal deleted inserted replaced
10:67b8537e8432 11:952c3ac0e783
46 local g_generated = nil 46 local g_generated = nil
47 47
48 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber 48 local pairs, ipairs, tinsert, tremove, tonumber = pairs, ipairs, table.insert, table.remove, tonumber
49 49
50 local pprint, tabledump = addon.pprint, flib.tabledump 50 local pprint, tabledump = addon.pprint, flib.tabledump
51 local GetItemInfo = GetItemInfo 51 local GetItemInfo, ITEM_QUALITY_COLORS = GetItemInfo, ITEM_QUALITY_COLORS
52 52
53 -- En masse forward decls of symbols defined inside local blocks 53 -- En masse forward decls of symbols defined inside local blocks
54 local _generate_text, _populate_text_specials 54 local _generate_text, _populate_text_specials
55 local _tabtexts, _taborder -- filled out in gui block scope 55 local _tabtexts, _taborder -- filled out in gui block scope
56 56
182 -- XXX FIXME a major weakness here is that we're constantly replacing 182 -- XXX FIXME a major weakness here is that we're constantly replacing
183 -- what's already been created. Lots of garbage. Trying to detect what 183 -- what's already been created. Lots of garbage. Trying to detect what
184 -- actually needs to be replaced is even worse. We'll live with 184 -- actually needs to be replaced is even worse. We'll live with
185 -- garbage for now. 185 -- garbage for now.
186 if e.kind == 'loot' then 186 if e.kind == 'loot' then
187 local textured = eoi_st_textured_item_format:format (e.itexture, self.quality_hexes[e.quality], e.itemname, e.count or "") 187 local textured = eoi_st_textured_item_format:format (e.itexture, ITEM_QUALITY_COLORS[e.quality].hex, e.itemname, e.count or "")
188 e.cols = { 188 e.cols = {
189 {value = textured}, 189 {value = textured},
190 {value = e.person}, 190 {value = e.person},
191 { color = eoi_st_lootrow_col3_colortable_func } 191 { color = eoi_st_lootrow_col3_colortable_func }
192 } 192 }
296 local itexture = GetItemIcon(loot.id) 296 local itexture = GetItemIcon(loot.id)
297 local iname, ilink, iquality = GetItemInfo(loot.id) 297 local iname, ilink, iquality = GetItemInfo(loot.id)
298 local textured 298 local textured
299 if itexture and iname then 299 if itexture and iname then
300 textured = eoi_st_textured_item_format:format (itexture, 300 textured = eoi_st_textured_item_format:format (itexture,
301 self.quality_hexes[iquality], iname, loot.count or "") 301 ITEM_QUALITY_COLORS[iquality].hex, iname, loot.count or "")
302 else 302 else
303 textured = eoi_st_textured_item_format:format ([[ICONS\INV_Misc_QuestionMark]], 303 textured = eoi_st_textured_item_format:format ([[ICONS\INV_Misc_QuestionMark]],
304 self.quality_hexes[ITEM_QUALITY_COMMON], 'UNKNOWN - TRY AGAIN', "") 304 ITEM_QUALITY_COLORS[ITEM_QUALITY_COMMON].hex, 'UNKNOWN - TRY AGAIN', "")
305 cache_okay = false 305 cache_okay = false
306 end 306 end
307 col2.value = textured 307 col2.value = textured
308 308
309 local dotcols = new (col1, col2, col3) 309 local dotcols = new (col1, col2, col3)
1549 do 1549 do
1550 local list = {} 1550 local list = {}
1551 for id in pairs(OuroLootSV_opts.itemfilter) do 1551 for id in pairs(OuroLootSV_opts.itemfilter) do
1552 local iname, _, iquality = GetItemInfo(id) 1552 local iname, _, iquality = GetItemInfo(id)
1553 if iname then 1553 if iname then
1554 list[id] = addon.quality_hexes[iquality] .. iname .. "|r" 1554 list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r"
1555 end 1555 end
1556 end 1556 end
1557 w = GUI:Create("EditBoxDropDown") 1557 w = GUI:Create("EditBoxDropDown")
1558 w:SetRelativeWidth(0.4) 1558 w:SetRelativeWidth(0.4)
1559 w:SetText("Item filter") 1559 w:SetText("Item filter")
1563 local iname, ilink, iquality = GetItemInfo(strtrim(text)) 1563 local iname, ilink, iquality = GetItemInfo(strtrim(text))
1564 if not iname then 1564 if not iname then
1565 return addon:Print("Error: %s is not a valid item name/link!", text) 1565 return addon:Print("Error: %s is not a valid item name/link!", text)
1566 end 1566 end
1567 local id = tonumber(ilink:match("item:(%d+)")) 1567 local id = tonumber(ilink:match("item:(%d+)"))
1568 list[id] = addon.quality_hexes[iquality] .. iname .. "|r" 1568 list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r"
1569 OuroLootSV_opts.itemfilter[id] = true 1569 OuroLootSV_opts.itemfilter[id] = true
1570 addon:Print("Now filtering out", ilink) 1570 addon:Print("Now filtering out", ilink)
1571 end) 1571 end)
1572 w:SetCallback("OnListItemClicked", function(_w, _, key_id, val_name) 1572 w:SetCallback("OnListItemClicked", function(_w, _, key_id, val_name)
1573 --local ilink = select(2,GetItemInfo(key_id)) 1573 --local ilink = select(2,GetItemInfo(key_id))
1587 w:SetFullWidth(true) 1587 w:SetFullWidth(true)
1588 w:SetHeight(20) 1588 w:SetHeight(20)
1589 grp:AddChild(w) 1589 grp:AddChild(w)
1590 w = GUI:Create("Label") 1590 w = GUI:Create("Label")
1591 w:SetRelativeWidth(0.4) 1591 w:SetRelativeWidth(0.4)
1592 w:SetText(addon.quality_hexes[3].."Echo from latest ping:|r\n"..senders) 1592 w:SetText(ITEM_QUALITY_COLORS[3].hex .."Echo from latest ping:|r\n"..senders)
1593 grp:AddChild(w) 1593 grp:AddChild(w)
1594 end 1594 end
1595 1595
1596 scroll:AddChild(grp) 1596 scroll:AddChild(grp)
1597 1597