Mercurial > wow > reaction
changeset 281:2098dba4baf5
Merge
author | Flick |
---|---|
date | Wed, 11 May 2011 16:20:48 -0700 |
parents | 5b9c0164a491 (diff) b3c01452d395 (current diff) |
children | 7a9e82c0df15 |
files | PetActionButton.lua |
diffstat | 6 files changed, 27 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/Bar.lua Wed May 11 16:20:33 2011 -0700 +++ b/Bar.lua Wed May 11 16:20:48 2011 -0700 @@ -351,6 +351,9 @@ if w > 0 and h > 0 then self.config.btnWidth = w self.config.btnHeight = h + for _, b in pairs(self.buttons) do + b:Refresh() + end end end @@ -403,6 +406,7 @@ b:ShowGridTemp(mode) b:UpdateActionIDLabel(mode) end + self.buttonClass:SetupBar(self) -- force a full refresh end function Bar:SetKeybindMode(mode) @@ -667,10 +671,10 @@ end if enable then if not self.unitwatch then - RegisterUnitWatch(self:GetFrame(),true) + RegisterUnitWatch(f,true) end elseif self.unitwatch then - UnregisterUnitWatch(self:GetFrame()) + UnregisterUnitWatch(f) end self.unitwatch = enable self:RefreshSecureState()
--- a/Button.lua Wed May 11 16:20:33 2011 -0700 +++ b/Button.lua Wed May 11 16:20:48 2011 -0700 @@ -188,7 +188,9 @@ if not success then bar:ClipNButtons(n) cfgN = n - geterrorhandler()(r) + if r then + geterrorhandler()(r) + end end end end @@ -235,7 +237,8 @@ end if id == nil then if unique then - error(("All action IDs for bars of type '%s' are in use, cannot create any more buttons"):format(self.config.barType)) + ReAction:UserError(("All action IDs for bars of type '%s' are in use, cannot create any more buttons"):format(self.barType)) + error(nil) -- no error message, user has already been notified, so don't put in Lua error handler end pool.nWraps = nWraps + 1 end
--- a/PetActionButton.lua Wed May 11 16:20:33 2011 -0700 +++ b/PetActionButton.lua Wed May 11 16:20:48 2011 -0700 @@ -162,7 +162,7 @@ Super.SetupBar(self,bar) -- auto show/hide when pet exists - bar:RegisterUnitWatch("pet",true) + bar:RegisterUnitWatch("pet",not ReAction:GetConfigMode()) self:UpdateButtonLock(bar) end
--- a/ReAction.lua Wed May 11 16:20:33 2011 -0700 +++ b/ReAction.lua Wed May 11 16:20:48 2011 -0700 @@ -3,6 +3,7 @@ local pairs = pairs local type = type local geterrorhandler = geterrorhandler +local GetTime = GetTime local L = LibStub("AceLocale-3.0"):GetLocale("ReAction") local LKB = LibStub("LibKeyBound-1.0",true) if not LKB then @@ -171,8 +172,17 @@ ------ Methods ------ -function ReAction:UserError(msg) - UIErrorsFrame:AddMessage(msg) +do + local lastErrorMessage + local lastErrorTime + function ReAction:UserError(msg) + local t = GetTime() + if msg ~= lastErrorMessage or lastErrorTime == nil or (t - lastErrorTime > 10) then -- prevent spam + UIErrorsFrame:AddMessage(msg) + lastErrorMessage = msg + lastErrorTime = t + end + end end function ReAction:GetBar(arg)
--- a/StanceButton.lua Wed May 11 16:20:33 2011 -0700 +++ b/StanceButton.lua Wed May 11 16:20:48 2011 -0700 @@ -111,7 +111,7 @@ self.updatePending = false local idx = self:GetActionID() local f = self:GetFrame() - if idx > GetNumShapeshiftForms() then + if idx > GetNumShapeshiftForms() and not ReAction:GetConfigMode() then f:Hide() else f:SetAttribute("spell", select(2,GetShapeshiftFormInfo(idx)))
--- a/VehicleExitButton.lua Wed May 11 16:20:33 2011 -0700 +++ b/VehicleExitButton.lua Wed May 11 16:20:48 2011 -0700 @@ -94,12 +94,12 @@ -- auto show/hide when on a vehicle local config = bar:GetConfig() local f = bar:GetFrame() - if config.withControls then + if config.withControls or ReAction:GetConfigMode() then if bar.vehicleExitStateRegistered then UnregisterStateDriver(f, "unitexists") bar.vehicleExitStateRegistered = false end - bar:RegisterUnitWatch("vehicle",true) + bar:RegisterUnitWatch("vehicle",not ReAction:GetConfigMode()) else bar:RegisterUnitWatch("vehicle",false) if not bar.vehicleExitStateRegistered then