# HG changeset patch # User Flick # Date 1224287190 0 # Node ID 39265b16d20816ac7744eff64da27b93fc2c9d0f # Parent 567a885cdfadbbb128ab3be44bf5bba4ae8857e0 Fixed handling of pet buttons past 10 diff -r 567a885cdfad -r 39265b16d208 Bar.lua --- a/Bar.lua Fri Oct 17 23:13:44 2008 +0000 +++ b/Bar.lua Fri Oct 17 23:46:30 2008 +0000 @@ -162,6 +162,15 @@ ReAction:RefreshBar(self) end +function Bar:ClipNButtons( n ) + local cfg = self.config + local r = cfg.btnRows or 1 + local c = cfg.btnColumns or 1 + + cfg.btnRows = ceil(n/c) + cfg.btnColumns = min(n,c) +end + function Bar:GetName() return self.name end diff -r 567a885cdfad -r 39265b16d208 modules/ReAction_PetAction/ReAction_PetAction.lua --- a/modules/ReAction_PetAction/ReAction_PetAction.lua Fri Oct 17 23:13:44 2008 +0000 +++ b/modules/ReAction_PetAction/ReAction_PetAction.lua Fri Oct 17 23:46:30 2008 +0000 @@ -94,9 +94,15 @@ btnCfg[i] = {} end if btns[i] == nil then - local b = Button:New(bar,i,btnCfg[i]) - btns[i] = b - bar:AddButton(i,b) + local success, r = pcall(Button.New,Button,bar,i,btnCfg[i]) + if success and r then + btns[i] = r + bar:AddButton(i,r) + else + n = i - 1 + bar:ClipNButtons(n) + break + end end btns[i]:Refresh() end @@ -403,6 +409,7 @@ self.bar:PlaceButton(self, 30, 30) self:Update() self:UpdateHotkey() + self.frame:Show() end function Button:GetFrame()