Mercurial > wow > ouroloot
changeset 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 |
files | AceGUIWidget-DoTimerEditBoxDropDown.lua core.lua gui.lua |
diffstat | 3 files changed, 43 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/AceGUIWidget-DoTimerEditBoxDropDown.lua Fri Apr 06 18:23:22 2012 +0000 +++ b/AceGUIWidget-DoTimerEditBoxDropDown.lua Sat Apr 07 04:59:27 2012 +0000 @@ -1,4 +1,4 @@ -local Type, Version = "EditBoxDropDown", 3 +local Type, Version = "EditBoxDropDown", 5 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -20,7 +20,7 @@ Version 3 adds the EditBoxDropDownOptionControl variant, specifically for use as a 'dialogControl' in AceConfig option tables. Details follow; the more -disappointing restrictions are because AceConfig never gives the end user any +disappointing restrictions are because AceConfig never gives the programmer any direct link to the widgets in use. - 'desc' option field ignored - 'name' field may contain an embedded tab ('\t') followed by more text to be @@ -29,10 +29,10 @@ OnTextEnterPressed callback; this is typically how new entries should be added to data - 'values' field must be a function, returning the usual list of entries, PLUS - the callback used for 'get', e.g., + the callback used for 'get' as a key, e.g., values = function() - local ret = build_real_dropdown_values() - ret[get_callback] = true -- assuming "function get_callback (widget, event, text)" + local ret = build_real_dropdown_table() + ret[get_callback] = true -- assuming "function get_callback (widget, event, text) .... end" return ret end The callback will be immediately removed from the table, but is required to @@ -40,6 +40,10 @@ - 'set' receives the key of the dropdown table, but that entry will already be removed by the time the 'set' function is called +Version 4 was never released. + +Version 5 adds the OnDropdownShown callback. + EditBoxDropDown API @@ -73,8 +77,11 @@ similar to a Dropdown widget's OnValueChanged, the key and value from the table given to :SetList are passed +OnDropdownShown + when the down arrow is clicked to display the list -farmbuyer + +farmbuyer@gmail.com ]] local button_hover_text_default = "Click on entries to remove them." @@ -142,6 +149,7 @@ local t = BuildList(button.obj) EasyMenu (t, button.obj.dropdown, button.obj.frame, 0, 0, "MENU") PlaySound("igMainMenuOptionCheckBoxOn") + button.obj:Fire("OnDropdownShown") end end @@ -153,6 +161,7 @@ end +--local base_SetWidth = AceGUI.WidgetBase.SetWidth local methods = { ["OnAcquire"] = function (self) self:SetHeight(20) @@ -164,7 +173,17 @@ maps = maps or {} maps[self.editbox.editbox] = self end, +--[=[ + ["SetWidth"] = function (self, width) + print("got",width) + base_SetWidth(self, width) + self.frame.width = width + 45 + end, + ["GetWidth"] = function (self) + return self.frame:GetWidth() + 45 + end, +]=] ["OnRelease"] = function (self) self.frame:ClearAllPoints() self.frame:Hide() @@ -239,7 +258,8 @@ local frame = editbox.frame editbox:SetHeight(20) editbox:SetWidth(100) - frame:SetWidth(frame:GetWidth()+6) + --frame:SetWidth(frame:GetWidth()+15) + --frame.width = frame:GetWidth() + 15 editbox:SetCallback("OnEnter", ddEditBox_OnMouseEnter) editbox:SetCallback("OnLeave", ddEditBox_OnMouseLeave) editbox:SetCallback("OnEnterPressed", ddEditBox_OnEnterPressed)
--- a/core.lua Fri Apr 06 18:23:22 2012 +0000 +++ b/core.lua Sat Apr 07 04:59:27 2012 +0000 @@ -7,7 +7,7 @@ - attend saved text from raid attendence window, default nil - printed.FOO last loot index formatted into text window FOO, default 0 -Common g_loot indices: +Common g_loot entry indices: - kind time/boss/loot - hour 0-23, on the *physical instance server*, not the realm server - minute 0-59, ditto @@ -34,14 +34,16 @@ - itemlink full clickable link - itexture icon path (e.g., Interface\Icons\INV_Misc_Rune_01) - quality ITEM_QUALITY_* number -- disposition offspec/gvault/shard; missing otherwise; can be set from extratext -- count e.g., "x3"; missing otherwise; can be set/removed from extratext; -- triggers only for a stack of items, not "the boss dropped double axes today" +- disposition offspec/gvault/shard; missing otherwise; can be set from +- the extratext field +- count e.g., "x3"; missing otherwise; can be set/removed from +- extratext; triggers only for a stack of items, not "the boss +- dropped double axes today" - is_heroic true if item is heroic; missing otherwise - cache_miss if GetItemInfo failed; SHOULD be missing (changes other fields) - bcast_from if rebroadcast from another player; missing otherwise - extratext text in Note column, including disposition and rebroadcasting -- extratext_byhand true if text was edited by player directly; missing otherwise +- extratext_byhand true if text edited by player directly; missing otherwise Functions arranged like this, with these lables (for jumping to). As a
--- a/gui.lua Fri Apr 06 18:23:22 2012 +0000 +++ b/gui.lua Sat Apr 07 04:59:27 2012 +0000 @@ -1744,10 +1744,13 @@ grp:AddChild(w) do local list = {} + local cache_warn, cache_warned = false, false for id in pairs(OuroLootSV_opts.itemfilter) do local iname, _, iquality = GetItemInfo(id) if iname then list[id] = ITEM_QUALITY_COLORS[iquality].hex .. iname .. "|r" + else + cache_warn = true end end w = GUI:Create("EditBoxDropDown") @@ -1771,6 +1774,12 @@ --addon:Print("No longer filtering out", ilink) addon:Print("No longer filtering out", val_name) end) + w:SetCallback("OnDropdownShown", function() + if cache_warn and not cache_warned then + cache_warned = true + 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.") + end + end) grp:AddChild(w) end