comparison gui.lua @ 149:df0ca8ed1aff

Be smarter when joining a raid. Add some more flow-control debug printing. Given (A) joining a raid, which triggers a delayed addon load, and seeing the "what to do next" popup, and (B) restoring previous data which contains only a raid roster or generated text, fix the interaction in which the activation from (B) overrides the user's choice in (A)'s popup.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Thu, 08 Jan 2015 15:22:27 -0500
parents 113dd7c86222
children 63bda09d88fe
comparison
equal deleted inserted replaced
148:113dd7c86222 149:df0ca8ed1aff
2192 b:SetFullWidth(true) 2192 b:SetFullWidth(true)
2193 b:SetLabel("On/Off:") 2193 b:SetLabel("On/Off:")
2194 b:SetList{"Full Tracking", "Broadcasting", "Disabled"} 2194 b:SetList{"Full Tracking", "Broadcasting", "Disabled"}
2195 b:SetValue(self.enabled and 1 or (self.rebroadcast and 2 or 3)) 2195 b:SetValue(self.enabled and 1 or (self.rebroadcast and 2 or 3))
2196 b:SetCallback("OnValueChanged", function(_w,event,choice) 2196 b:SetCallback("OnValueChanged", function(_w,event,choice)
2197 if choice == 1 then self:Activate() 2197 if choice == 1 then self:Activate("dropdown")
2198 elseif choice == 2 then self:Activate(nil,true) 2198 elseif choice == 2 then self:Activate("dropdownbc",nil,true)
2199 else self:Deactivate() 2199 else self:Deactivate()
2200 end 2200 end
2201 _w = display:GetUserData('comm_ident') 2201 _w = display:GetUserData('comm_ident')
2202 if _w and _w:IsVisible() then 2202 if _w and _w:IsVisible() then
2203 _w:SetDisabled(self.enabled or self.rebroadcast) 2203 _w:SetDisabled(self.enabled or self.rebroadcast)
2576 text = "Do you wish to activate Ouro Loot?|n|n(Hit the Escape key to close this window without clicking; Enter is the same as Activate)", 2576 text = "Do you wish to activate Ouro Loot?|n|n(Hit the Escape key to close this window without clicking; Enter is the same as Activate)",
2577 button1 = "Activate recording", -- "accept", left 2577 button1 = "Activate recording", -- "accept", left
2578 button2 = "Broadcast Only", -- "cancel", middle 2578 button2 = "Broadcast Only", -- "cancel", middle
2579 button3 = HELP_LABEL, -- "alt", right 2579 button3 = HELP_LABEL, -- "alt", right
2580 OnAccept = function (dialog, addon) 2580 OnAccept = function (dialog, addon)
2581 addon:Activate() 2581 pprint('remind', "OnAccept")
2582 addon:Activate("remind")
2582 end, 2583 end,
2583 noCancelOnEscape = true, 2584 noCancelOnEscape = true,
2585 noCancelOnReuse = true,
2586 closeButton = true,
2584 OnCancel = function (dialog, addon) 2587 OnCancel = function (dialog, addon)
2585 addon:Activate(nil,true) 2588 pprint('remind', "OnCancel")
2589 addon:Activate("remindbc",nil,true)
2586 end, 2590 end,
2587 OnAlt = function (dialog, addon) 2591 OnAlt = function (dialog, addon)
2592 pprint('remind', "OnAlt")
2588 -- hitting escape also calls this, but the 3rd arg would be "clicked" 2593 -- hitting escape also calls this, but the 3rd arg would be "clicked"
2589 -- in both cases, not useful here. 2594 -- in both cases, not useful here.
2590 if MouseIsOver(dialog.button3) then 2595 if MouseIsOver(dialog.button3) then
2591 -- they actually clicked the button (or at least the mouse was over "Help" 2596 -- they actually clicked the button (or at least the mouse was over "Help"
2592 -- when they hit escape... sigh) 2597 -- when they hit escape... sigh)
2593 addon:BuildMainDisplay('help') 2598 addon:BuildMainDisplay('help')
2594 else 2599 else
2595 addon.popped = true 2600 addon.popped = true
2596 end 2601 end
2597 end, 2602 end,
2603 --@debug@
2604 OnHide = function (dialog, addon)
2605 pprint('remind', "OnHide")
2606 end,
2607 --@end-debug@
2598 } 2608 }
2599 2609
2600 -- Callback for each Next/Accept stage of inserting a new loot or boss row via 2610 -- Callback for each Next/Accept stage of inserting a new loot or boss row via
2601 -- dropdown. Thanks to noCancelOnReuse, each Show done here will technically 2611 -- dropdown. Thanks to noCancelOnReuse, each Show done here will technically
2602 -- Hide and redisplay the same dialog, passing along the same 'data' structure 2612 -- Hide and redisplay the same dialog, passing along the same 'data' structure