comparison classes/ActionButton.lua @ 238:8bde290d300c

Chase away Lua errors when clicking 4.0 flyout actions (e.g. call pet, teleport)
author Flick
date Thu, 24 Mar 2011 14:27:56 -0700
parents 704f4a05a1d7
children
comparison
equal deleted inserted replaced
237:704f4a05a1d7 238:8bde290d300c
121 end 121 end
122 ]] 122 ]]
123 123
124 local _onReceiveDrag = -- function(self, button, kind, value, ...) 124 local _onReceiveDrag = -- function(self, button, kind, value, ...)
125 [[ 125 [[
126 if kind ~= "spell" and kind ~= "item" and kind ~= "macro" then 126 if kind ~= "spell" and kind ~= "item" and kind ~= "macro" and kind ~= "flyout" then
127 return kind, value, ... 127 return kind, value, ...
128 else 128 else
129 if showgrid_event and showgrid_event > 0 then 129 if showgrid_event and showgrid_event > 0 then
130 self:SetAttribute("showgrid-clicked",true) 130 self:SetAttribute("showgrid-clicked",true)
131 end 131 end
235 f:RegisterForClicks("AnyUp") 235 f:RegisterForClicks("AnyUp")
236 for _, evt in pairs(eventList) do 236 for _, evt in pairs(eventList) do
237 f:RegisterEvent(evt) 237 f:RegisterEvent(evt)
238 end 238 end
239 239
240 f.action = config.actionID -- need this to support silly ActionButton_UpdateFlyout. Should not taint anything anymore.
241
240 -- secure handlers 242 -- secure handlers
241 f:SetAttribute("_childupdate", _childupdate) 243 f:SetAttribute("_childupdate", _childupdate)
242 f:SetAttribute("_childupdate-showgrid",_childupdate_showgrid) 244 f:SetAttribute("_childupdate-showgrid",_childupdate_showgrid)
243 barFrame:WrapScript(f, "OnDragStart", _onDragStart) 245 barFrame:WrapScript(f, "OnDragStart", _onDragStart)
244 barFrame:WrapScript(f, "OnReceiveDrag", _onReceiveDrag) 246 barFrame:WrapScript(f, "OnReceiveDrag", _onReceiveDrag)
682 684
683 function Action:OnAttributeChanged( attr, value ) 685 function Action:OnAttributeChanged( attr, value )
684 if attr ~= "statehidden" then 686 if attr ~= "statehidden" then
685 self:UpdateAction() 687 self:UpdateAction()
686 end 688 end
689 local f = self:GetFrame()
690 f.action = f:GetAttribute("action") -- support ActionButton_UpdateFlyout
687 end 691 end
688 692
689 function Action:PostClick( ) 693 function Action:PostClick( )
690 self:UpdateCheckedState() 694 self:UpdateCheckedState()
691 end 695 end