Mercurial > wow > ouroloot
diff core.lua @ 110:f93c1a93923b
Change how dropdown menus are built, and register "mark as" in the loot dropdowns.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Wed, 08 Aug 2012 23:13:04 -0400 |
parents | ce45011fab4c |
children | 67bf97136273 |
line wrap: on
line diff
--- a/core.lua Wed Aug 08 14:43:26 2012 -0400 +++ b/core.lua Wed Aug 08 23:13:04 2012 -0400 @@ -374,6 +374,7 @@ local g_uniques = nil -- memoization of unique loot events local g_unique_replace = nil local opts = nil +local g_gui = nil local error = addon.error local assert = addon.assert @@ -849,6 +850,7 @@ self:FINISH_SPECIAL_TABS() _init(self) self.dprint('flow', "version strings:", version_large, self.revision, self.status_text) + g_gui = self.gui_state_pointer self.gui_state_pointer = nil self.load_assert = nil self.OnInitialize = nil -- free up ALL the things! @@ -974,6 +976,27 @@ g_LOOT_ITEM_SELF_MULTIPLE_ss = LOOT_ITEM_SELF_MULTIPLE:gsub('%.$','%%.'):gsub('%%s','(.+)'):gsub('x%%d','(x%%d+)') --[[ + Throw in the default disposition types. This could be called during load + were it not for the need to talk to the GUI data (not set up yet). + + Args: code, rhex, ghex, bhex, + text_notes, opt_text_menu (uses notes if nil), opt_tooltip_txt, + can_reassign_p, do_history_p, from_notes_text_p + ]] + local norm = self:_add_loot_disposition ('normal', "ff","ff","ff", "", "normal", + [[This is the default. Selecting any 'Mark as <x>' action blanks out extra notes about who broadcast this entry, etc.]], + true, true, false) + self:_add_loot_disposition ('offspec', "c6","9b","6d", "offspec", nil, nil, + true, true, true) + self:_add_loot_disposition ('shard', "a3","35","ee", "shard", + "disenchanted", nil, false, false, true) + -- suddenly changing localization mid-phrase is horky, change this to a submenu: + self:_add_loot_disposition ('gvault', "33","ff","99", _G.GUILD_BANK:lower(), + nil, nil, false, false, true) + -- fix up the odd (!) standard case of having a nil disposition field + norm.arg2 = nil + + --[[ Stick something in the Blizzard addons options list, where most users will probably look these days. Try to be conservative about needless frame creation. @@ -2589,23 +2612,24 @@ function addon:_iter_dispositions (attrib) local r = {} for code,disp in next, alldisps do - if disp.attrib then + if disp[attrib] then r[code] = disp.text end end return next, r end - function addon:_add_loot_disposition (code, rhex, ghex, bhex, text, - can_reassign_p, do_history_p, from_notes_text_p + function addon:_add_loot_disposition (code, rhex, ghex, bhex, text_notes, + text_menu, tooltip_txt, can_reassign_p, do_history_p, from_notes_text_p ) assert(type(code)=='string' and #code>0) - assert(type(text)=='string') + assert(type(text_notes)=='string') assert(type(rhex)=='string') assert(type(bhex)=='string') assert(type(ghex)=='string') + self.disposition_colors[code] = { - text = text, + text = text_notes, -- for chat output by core code hex = "|cff" .. rhex .. ghex .. bhex, -- for lib-st @@ -2617,18 +2641,15 @@ -- not not = poor man's "toboolean", don't potentially hold arg -- objects from garbage collection alldisps[code] = { - text = text, + text = text_notes, can_reassign = not not can_reassign_p, affects_history = not not do_history_p, from_notes_text = not not from_notes_text_p, } + + return g_gui.add_dropdown_entry ('eoi_loot', "Mark as "..(text_menu or text_notes), + --[[function_table=]]nil, 'df_DISPOSITION', code, tooltip_txt) end - - -- reassign while tagged, affects history, copy from notes - addon:_add_loot_disposition ('normal', "ff","ff","ff", "", true, true, false) - addon:_add_loot_disposition ('offspec', "c6","9b","6d", "offspec", true, true, true) - addon:_add_loot_disposition ('shard', "a3","35","ee", "shard", false, false, true) - addon:_add_loot_disposition ('gvault', "33","ff","99", _G.GUILD_BANK:lower(), false, false, true) end -- In the rare case of items getting put into the loot table without current