# HG changeset patch # User Flick # Date 1305155957 25200 # Node ID 5b9c0164a49172996bd90a31e825d555291be08e # Parent 4e325f1ea6e1796ccd9fa74e1798eb9f9d9ad972 Fixed a number of problems with drag corners in config mode - Fixed button resizing via dragging not updating until a reload - Fixed pet/stance/vehicle buttons not always displaying in config mode - Fixed error spam when making too many pet/bag buttons diff -r 4e325f1ea6e1 -r 5b9c0164a491 Bar.lua --- a/Bar.lua Wed May 11 11:27:36 2011 -0700 +++ b/Bar.lua Wed May 11 16:19:17 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() diff -r 4e325f1ea6e1 -r 5b9c0164a491 Button.lua --- a/Button.lua Wed May 11 11:27:36 2011 -0700 +++ b/Button.lua Wed May 11 16:19:17 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 diff -r 4e325f1ea6e1 -r 5b9c0164a491 PetActionButton.lua --- a/PetActionButton.lua Wed May 11 11:27:36 2011 -0700 +++ b/PetActionButton.lua Wed May 11 16:19:17 2011 -0700 @@ -160,7 +160,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 diff -r 4e325f1ea6e1 -r 5b9c0164a491 ReAction.lua --- a/ReAction.lua Wed May 11 11:27:36 2011 -0700 +++ b/ReAction.lua Wed May 11 16:19:17 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) diff -r 4e325f1ea6e1 -r 5b9c0164a491 StanceButton.lua --- a/StanceButton.lua Wed May 11 11:27:36 2011 -0700 +++ b/StanceButton.lua Wed May 11 16:19:17 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))) diff -r 4e325f1ea6e1 -r 5b9c0164a491 VehicleExitButton.lua --- a/VehicleExitButton.lua Wed May 11 11:27:36 2011 -0700 +++ b/VehicleExitButton.lua Wed May 11 16:19:17 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