Mercurial > wow > ouroloot
diff options.lua @ 101:f7162a1cadc7
Unify remote/local change notifications, and allow option toggles for each. When passing entry tables to the registered callbacks, make proxies for them first (the goal is to prevent accidents, not fraud).
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Wed, 01 Aug 2012 06:51:52 +0000 |
| parents | a57133ee3c9b |
| children | fe04f5c4114a |
line wrap: on
line diff
--- a/options.lua Mon Jul 30 19:25:46 2012 +0000 +++ b/options.lua Wed Aug 01 06:51:52 2012 +0000 @@ -250,38 +250,50 @@ local chatgroup = AceGUI:Create("InlineGroup") chatgroup:SetLayout("List") chatgroup:SetRelativeWidth(0.75) - chatgroup:SetTitle("Remote Changes Chat") + chatgroup:SetTitle("Notify on Changes Chat") local toggle, editbox toggle = mktoggle('chatty_on_remote_changes', "Be chatty on remote changes", 1, [[Print something to chat when other users change recorded loot.]], function (_w,_,value) opts.chatty_on_remote_changes = value - editbox:SetDisabled(not opts.chatty_on_remote_changes) + editbox:SetDisabled((not opts.chatty_on_remote_changes) and + (not opts.chatty_on_local_changes)) end) toggle:SetFullWidth(true) chatgroup:AddChild(toggle) + toggle = mktoggle('chatty_on_local_changes', "Be chatty on your own changes", 1, + [[Print something to chat when you change recorded loot (as a reminder).]], + function (_w,_,value) + opts.chatty_on_local_changes = value + editbox:SetDisabled((not opts.chatty_on_remote_changes) and + (not opts.chatty_on_local_changes)) + end) + toggle:SetFullWidth(true) + chatgroup:AddChild(toggle) + w = AceGUI:Create("Label") w:SetFullWidth(true) - w:SetText("This controls the output of the |cff00ffff'Be chatty on remote changes'|r option. If this field is a number, it designates which chat frame to use. Otherwise it is the Lua variable name of a frame with AddMessage capability.") + w:SetText("This controls the output of the |cff00ffff'Be chatty on <X> changes'|r options. If this field is a number, it designates which chat frame to use. Otherwise it is the Lua variable name of a frame with AddMessage capability.") chatgroup:AddChild(w) - editbox = mkbutton("EditBox", nil, opts.chatty_on_remote_changes_frame, + editbox = mkbutton("EditBox", nil, opts.chatty_on_changes_frame, [[1 = default chat frame, 2 = combat log, etc]]) editbox:SetFullWidth(true) editbox:SetLabel("Output Chatframe") editbox:SetCallback("OnTextChanged", adv_careful_OnTextChanged) editbox:SetCallback("OnEnterPressed", function(_w,event,value) - local prev = opts.chatty_on_remote_changes_frame + local prev = opts.chatty_on_changes_frame value = value:trim() value = tonumber(value) or value - if addon:_set_remote_change_chatframe (value) then - opts.chatty_on_remote_changes_frame = value + if addon:_set_chatty_change_chatframe (value) then + opts.chatty_on_changes_frame = value _w:SetText(tostring(value)) _w.editbox:ClearFocus() else _w:SetText(tostring(prev)) end end) - editbox:SetDisabled(not opts.chatty_on_remote_changes) + editbox:SetDisabled((not opts.chatty_on_remote_changes) and + (not opts.chatty_on_local_changes)) chatgroup:AddChild(editbox) w = mkbutton("Chat Frame Numbers", [[Print each chat window number in its own frame, for easy reference in the editing field.]])
