comparison gui.lua @ 54:6d5fcbdc0590

DoTimerEditBoxDropDown widget to ver 5, warn (once) about missing item cache entries in the filter list dropdown.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Sat, 07 Apr 2012 04:59:27 +0000
parents 7af58a7dce7d
children ac57a4342812
comparison
equal deleted inserted replaced
53:7af58a7dce7d 54:6d5fcbdc0590
1742 w:SetFullWidth(true) 1742 w:SetFullWidth(true)
1743 w:SetHeight(20) 1743 w:SetHeight(20)
1744 grp:AddChild(w) 1744 grp:AddChild(w)
1745 do 1745 do
1746 local list = {} 1746 local list = {}
1747 local cache_warn, cache_warned = false, false
1747 for id in pairs(OuroLootSV_opts.itemfilter) do 1748 for id in pairs(OuroLootSV_opts.itemfilter) do
1748 local iname, _, iquality = GetItemInfo(id) 1749 local iname, _, iquality = GetItemInfo(id)
1749 if iname then 1750 if iname then
1750 list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r" 1751 list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r"
1752 else
1753 cache_warn = true
1751 end 1754 end
1752 end 1755 end
1753 w = GUI:Create("EditBoxDropDown") 1756 w = GUI:Create("EditBoxDropDown")
1754 w:SetRelativeWidth(0.4) 1757 w:SetRelativeWidth(0.4)
1755 w:SetText("Item filter") 1758 w:SetText("Item filter")
1768 w:SetCallback("OnListItemClicked", function(_w, _, key_id, val_name) 1771 w:SetCallback("OnListItemClicked", function(_w, _, key_id, val_name)
1769 --local ilink = select(2,GetItemInfo(key_id)) 1772 --local ilink = select(2,GetItemInfo(key_id))
1770 OuroLootSV_opts.itemfilter[tonumber(key_id)] = nil 1773 OuroLootSV_opts.itemfilter[tonumber(key_id)] = nil
1771 --addon:Print("No longer filtering out", ilink) 1774 --addon:Print("No longer filtering out", ilink)
1772 addon:Print("No longer filtering out", val_name) 1775 addon:Print("No longer filtering out", val_name)
1776 end)
1777 w:SetCallback("OnDropdownShown", function()
1778 if cache_warn and not cache_warned then
1779 cache_warned = true
1780 addon:Print("At least one of the items in the filter list was not in your game client's cache. This is okay. Just wait a few seconds, display some other Ouro Loot tab, and then display Options again.")
1781 end
1773 end) 1782 end)
1774 grp:AddChild(w) 1783 grp:AddChild(w)
1775 end 1784 end
1776 1785
1777 addon.sender_list.sort() 1786 addon.sender_list.sort()