From 1360b749c48813a3721598b9c99ad7e2bf71de74 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Mon, 27 May 2013 22:42:46 +0200 Subject: [PATCH] Allow click bypass for 3rd party support --- Molinari.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Molinari.lua b/Molinari.lua index 2d68f23..326be6a 100644 --- a/Molinari.lua +++ b/Molinari.lua @@ -13,6 +13,22 @@ local function ScanTooltip(self, spells) end end +local scripts = {'OnClick', 'OnMouseUp', 'OnMouseDown'} + +local function ParentClick(self, button, ...) + if(button ~= 'LeftButton') then + local _, parent = self:GetPoint() + if(parent) then + for _, script in pairs(scripts) do + local handler = parent:GetScript(script) + if(handler) then + handler(parent, button, ...) + end + end + end + end +end + local function ApplyButton(itemLink, spell, r, g, b) local slot = GetMouseFocus() local bag = slot:GetParent():GetID() @@ -60,9 +76,11 @@ function button:PLAYER_LOGIN() end end) + self:RegisterForClicks('AnyUp') self:SetFrameStrata('TOOLTIP') self:SetAttribute('alt-type1', 'spell') self:SetScript('OnLeave', self.MODIFIER_STATE_CHANGED) + self:HookScript('OnClick', ParentClick) self:RegisterEvent('MODIFIER_STATE_CHANGED') self:Hide() -- 1.7.9.5