comparison modules/ReAction_PetAction/ReAction_PetAction.lua @ 94:39265b16d208

Fixed handling of pet buttons past 10
author Flick <flickerstreak@gmail.com>
date Fri, 17 Oct 2008 23:46:30 +0000
parents 567a885cdfad
children 168cae4aa8bd
comparison
equal deleted inserted replaced
93:567a885cdfad 94:39265b16d208
92 for i = 1, n do 92 for i = 1, n do
93 if btnCfg[i] == nil then 93 if btnCfg[i] == nil then
94 btnCfg[i] = {} 94 btnCfg[i] = {}
95 end 95 end
96 if btns[i] == nil then 96 if btns[i] == nil then
97 local b = Button:New(bar,i,btnCfg[i]) 97 local success, r = pcall(Button.New,Button,bar,i,btnCfg[i])
98 btns[i] = b 98 if success and r then
99 bar:AddButton(i,b) 99 btns[i] = r
100 bar:AddButton(i,r)
101 else
102 n = i - 1
103 bar:ClipNButtons(n)
104 break
105 end
100 end 106 end
101 btns[i]:Refresh() 107 btns[i]:Refresh()
102 end 108 end
103 for i = n+1, #btns do 109 for i = n+1, #btns do
104 if btns[i] then 110 if btns[i] then
401 407
402 function Button:Refresh() 408 function Button:Refresh()
403 self.bar:PlaceButton(self, 30, 30) 409 self.bar:PlaceButton(self, 30, 30)
404 self:Update() 410 self:Update()
405 self:UpdateHotkey() 411 self:UpdateHotkey()
412 self.frame:Show()
406 end 413 end
407 414
408 function Button:GetFrame() 415 function Button:GetFrame()
409 return self.frame 416 return self.frame
410 end 417 end