comparison options.lua @ 102:fe04f5c4114a

- expiring cache callback arg, handle new entries coming in during the same loop at the previous ones ALL being removed TODO: rework other "candidate" caches to use this instead - raider snapshots use string tokens for 'online' field - document callback args - CheckBoxSmallLabel preemptively apply proposed fix for ace3 ticket 304 - now that option toggles are not wedged into tight space, revert to using standard CheckBox widget instead of small-label variant (go back if ticket 304 is not fixed for release)
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Sat, 04 Aug 2012 22:03:05 +0000
parents f7162a1cadc7
children dc8a23a47b03
comparison
equal deleted inserted replaced
101:f7162a1cadc7 102:fe04f5c4114a
67 local opts 67 local opts
68 68
69 local error, assert = addon.error, addon.assert 69 local error, assert = addon.error, addon.assert
70 70
71 local function mktoggle (opt, label, width, desc, opt_func) 71 local function mktoggle (opt, label, width, desc, opt_func)
72 local w = mkbutton("CheckBoxSmallLabel", nil, "", desc) 72 local w = mkbutton("CheckBox", nil, "", desc)
73 w:SetRelativeWidth(width) 73 w:SetRelativeWidth(width)
74 w:SetType("checkbox") 74 w:SetType("checkbox")
75 w:SetLabel(label) 75 w:SetLabel(label)
76 if opt then 76 if opt then
77 w:SetValue(opts[opt]) 77 w:SetValue(opts[opt])
508 local grp = AceGUI:Create("InlineGroup") 508 local grp = AceGUI:Create("InlineGroup")
509 grp:SetLayout("List") 509 grp:SetLayout("List")
510 grp:SetRelativeWidth(0.60) 510 grp:SetRelativeWidth(0.60)
511 grp:SetTitle("Output of debugging messages") 511 grp:SetTitle("Output of debugging messages")
512 512
513 w = AceGUI:Create("CheckBoxSmallLabel") 513 w = AceGUI:Create("CheckBox")
514 w:SetFullWidth(true) 514 w:SetFullWidth(true)
515 w:SetType("checkbox") 515 w:SetType("checkbox")
516 w:SetLabel("master toggle") 516 w:SetLabel("master toggle")
517 w:SetValue(addon.DEBUG_PRINT) 517 w:SetValue(addon.DEBUG_PRINT)
518 w:SetCallback("OnValueChanged", function(_w,event,value) 518 w:SetCallback("OnValueChanged", function(_w,event,value)
519 addon.DEBUG_PRINT = value 519 addon.DEBUG_PRINT = value
520 addon:redisplay() 520 addon:redisplay()
521 end) 521 end)
522 grp:AddChild(w) 522 grp:AddChild(w)
523 for d,v in pairs(addon.debug) do 523 for d,v in pairs(addon.debug) do
524 w = AceGUI:Create("CheckBoxSmallLabel") 524 w = AceGUI:Create("CheckBox")
525 w:SetFullWidth(true) 525 w:SetFullWidth(true)
526 w:SetType("checkbox") 526 w:SetType("checkbox")
527 w:SetLabel(d) 527 w:SetLabel(d)
528 if d == "notraid" then 528 if d == "notraid" then
529 w:SetDescription[[Tick this before enabling to make the addon work outside of raid groups]] 529 w:SetDescription[[Tick this before enabling to make the addon work outside of raid groups]]
547 547
548 do 548 do
549 local simple = AceGUI:Create("SimpleGroup") 549 local simple = AceGUI:Create("SimpleGroup")
550 simple:SetLayout("List") 550 simple:SetLayout("List")
551 simple:SetRelativeWidth(0.35) 551 simple:SetRelativeWidth(0.35)
552 w = AceGUI:Create("CheckBoxSmallLabel") 552 w = AceGUI:Create("CheckBox")
553 --w:SetRelativeWidth(0.35) 553 --w:SetRelativeWidth(0.35)
554 w:SetFullWidth(true) 554 w:SetFullWidth(true)
555 w:SetType("checkbox") 555 w:SetType("checkbox")
556 w:SetLabel("GOP history mode") 556 w:SetLabel("GOP history mode")
557 w:SetValue(addon.history_suppress) 557 w:SetValue(addon.history_suppress)
618 addon:Print("Now tracking ID",mod.creatureId) 618 addon:Print("Now tracking ID",mod.creatureId)
619 else 619 else
620 addon:Print("Can do nothing; DBM testing mod wasn't loaded.") 620 addon:Print("Can do nothing; DBM testing mod wasn't loaded.")
621 end 621 end
622 end) 622 end)
623 w:SetDisabled(addon.bossmod_registered ~= 'DBM') 623 w:SetDisabled(addon.bossmod_registered ~= 'DBM') -- set by :Activate
624 container:AddChild(w) 624 container:AddChild(w)
625 625
626 w = mkbutton("GC", [[full GC cycle]]) 626 w = mkbutton("GC", [[full GC cycle]])
627 w:SetRelativeWidth(0.2) 627 w:SetRelativeWidth(0.2)
628 w:SetCallback("OnClick", function() 628 w:SetCallback("OnClick", function()
822 822
823 823
824 --[[ 824 --[[
825 PLUGIN is the module table itself. (This does not actually have to be 825 PLUGIN is the module table itself. (This does not actually have to be
826 a plugin created with :[Constrained]NewModule, as long as it has a 826 a plugin created with :[Constrained]NewModule, as long as it has a
827 GetName method and other parameters here are used appropriately.) 827 GetName method and
828 - TEXT is passed
829 - if OPTIONS is a table, then OPTIONS.args.name exists
828 PARENT is nil to register in the tree list directly. 830 PARENT is nil to register in the tree list directly.
829 TEXT is either the text to display in the tree list, or nil to use the 831 TEXT is either the text to display in the tree list, or nil to use the
830 moduleName field out of PLUGIN (not :GetName()). 832 moduleName field out of PLUGIN (not :GetName()).
831 OPTIONS is either 833 OPTIONS is either
832 I) a function to call directly 834 I) an aceconfig-style options table
833 II) an aceconfig-style options table 835 II) a function to call directly
834 836
835 (I) Will augment options.args.name with coloring/sizing, if it exists. 837 (I) Will augment options.args.name with coloring/sizing, if it exists.
836 (Set options.args.name.name before registering.) Will create it if not 838 (Set options.args.name.name before registering.) Will create it if not
837 present. 839 present.
838 840
849 --if parent 851 --if parent
850 852
851 text = text or plugin.moduleName 853 text = text or plugin.moduleName
852 854
853 local handler 855 local handler
854 local pdb = self.db:GetNamespace (plugin.moduleName, --[[silent=]]true) 856 local pdb = plugin.moduleName and
857 self.db:GetNamespace (plugin.moduleName, --[[silent=]]true)
858
855 if type(options) == 'table' then 859 if type(options) == 'table' then
856 -- AceConfig-style options table 860 -- AceConfig-style options table
857 aceconfig_list[code] = true 861 aceconfig_list[code] = true
858 if not options.args.name then 862 if not options.args.name then
859 options.args.name = { 863 options.args.name = {