-- Rewrites Button.HandleEvent to trigger OnClick when the mouse is clicked, not released.
-- Makes construction feel more responsive and fixes "dropped clicks".
function CustomHandleEvent(self, event)
local eventHandled = false
if event.Type == 'MouseEnter' then
if self.mAltToggledFlag then
self:SetTexture(self.mAltHighlight)
else
self:SetTexture(self.mHighlight)
end
self:OnRolloverEvent('enter')
self:Play()
if self.mRolloverCue then
local sound = Sound({Cue = self.mRolloverCue, Bank = "Interface",})
PlaySound(sound)
end
self.mMouseOver = true
eventHandled = true
elseif event.Type == 'MouseExit' then
if self.mAltToggledFlag then
self:SetTexture(self.mAltNormal)
else
self:SetTexture(self.mNormal)
end
self:OnRolloverEvent('exit')
self:Play()
self.mMouseOver = false
eventHandled = true
elseif event.Type == 'ButtonPress' or event.Type == 'ButtonDClick' then
self:OnClick(event.Modifiers)
if self.mClickCue then
local sound = Sound({Cue = self.mClickCue, Bank = "Interface",})
PlaySound(sound)
end
self:Play()
eventHandled = true
end
return eventHandled
end
taken from azui modStatistics: Posted by SeraphimLeftNut — 17 May 2016, 21:02
]]>