comparison classes/ActionButton.lua @ 132:16048f516f5e

More Button refactoring
author Flick <flickerstreak@gmail.com>
date Sat, 07 Mar 2009 00:11:03 +0000
parents e39d80bb0b7a
children 1f36187a94cf
comparison
equal deleted inserted replaced
131:e39d80bb0b7a 132:16048f516f5e
227 227
228 function Action:Destroy() 228 function Action:Destroy()
229 local f = self:GetFrame() 229 local f = self:GetFrame()
230 local c = self:GetConfig() 230 local c = self:GetConfig()
231 231
232 f:UnregisterAllEvents()
233
234 f:SetAttribute("_childupdate-vehicle",nil) 232 f:SetAttribute("_childupdate-vehicle",nil)
235 233 f:SetAttribute("action",c.actionID) -- so that Destroy releases the right one
236 self:ReleaseActionID(c.actionID) 234
237 if c.pageactions then 235 if c.pageactions and #c.pageActions > 1 then
238 for _, id in ipairs(c.pageactions) do 236 for i = 2, #c.pageActions do
237 self:ReleaseActionID(c.pageactions[i])
239 self:ReleaseActionID(id) 238 self:ReleaseActionID(id)
240 end 239 end
241 end 240 end
242 241
243 Super.Destroy(self) 242 Super.Destroy(self)