comparison classes/Button.lua @ 235:1663c78a7f31

Don't blow away config for buttons the current character doesn't have yet
author Flick
date Thu, 24 Mar 2011 12:58:27 -0700
parents 0e20f65375d5
children dcdc0235d489
comparison
equal deleted inserted replaced
234:0e20f65375d5 235:1663c78a7f31
153 end 153 end
154 local btnCfg = config.buttons 154 local btnCfg = config.buttons
155 155
156 local r, c = bar:GetButtonGrid() 156 local r, c = bar:GetButtonGrid()
157 local n = r*c 157 local n = r*c
158 local cfgN = n
158 159
159 local hint = nil 160 local hint = nil
160 local i = 1 161 local i = 1
161 repeat 162 repeat
162 local b = bar:GetButton(i) 163 local b = bar:GetButton(i)
163 if b then 164 if b then
164 if i > n then 165 if i > n then
165 bar:RemoveButton(b) 166 bar:RemoveButton(b)
166 b:Destroy() 167 b:Destroy()
167 btnCfg[i] = nil 168 if i > cfgN then
169 btnCfg[i] = nil
170 end
168 else 171 else
169 b:Refresh() 172 b:Refresh()
170 hint = b:GetActionID() 173 hint = b:GetActionID()
171 end 174 end
172 elseif i <= n then 175 elseif i <= n then