From ad130af188540e3bbbb29d0e7e2aa9092917ca49 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Wed, 19 May 2021 19:30:32 +0200 Subject: [PATCH] click through frames health/power bar --- Frame.lua | 22 ++++++++++------------ Modules/Auras.lua | 1 + Modules/BuffsDebuffs.lua | 1 + Modules/Castbar.lua | 1 + Modules/Cooldowns.lua | 1 + Modules/Diminishings.lua | 1 + Modules/Powerbar.lua | 1 + Modules/Racial.lua | 1 + Modules/Trinket.lua | 1 + 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Frame.lua b/Frame.lua index 561c68f..ab7118e 100644 --- a/Frame.lua +++ b/Frame.lua @@ -32,7 +32,7 @@ function Gladdy:CreateFrame() self.frame = CreateFrame("Frame", "GladdyFrame", UIParent) self.frame:SetClampedToScreen(true) - self.frame:EnableMouse(true) + self.frame:EnableMouse(false) self.frame:SetMovable(true) self.frame:RegisterForDrag("LeftButton") @@ -187,7 +187,7 @@ function Gladdy:UpdateFrame() local button = self.buttons["arena" .. i] button:SetWidth(self.db.barWidth + extraBarWidth) button:SetHeight(self.db.healthBarHeight) - button.secure:SetWidth(self.db.barWidth + extraBarWidth) + button.secure:SetWidth(self.db.barWidth) button.secure:SetHeight(self.db.healthBarHeight + extraBarHeight) button:ClearAllPoints() @@ -195,18 +195,18 @@ function Gladdy:UpdateFrame() if (self.db.growUp) then if (i == 1) then button:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", self.db.padding + 2, 0) - button.secure:SetPoint("BOTTOMLEFT", self.frame, "BOTTOMLEFT", self.db.padding + 2, 0) + button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") else button:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin) - button.secure:SetPoint("BOTTOMLEFT", self.buttons["arena" .. (i - 1)], "TOPLEFT", 0, margin + self.db.bottomMargin) + button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") end else if (i == 1) then button:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.db.padding + 2, 0) - button.secure:SetPoint("TOPLEFT", self.frame, "TOPLEFT", self.db.padding + 2, 0) + button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") else button:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin) - button.secure:SetPoint("TOPLEFT", self.buttons["arena" .. (i - 1)], "BOTTOMLEFT", 0, -margin - self.db.bottomMargin) + button.secure:SetPoint("TOPLEFT", button.healthBar, "TOPLEFT") end end @@ -257,6 +257,7 @@ function Gladdy:CreateButton(i) end local button = CreateFrame("Frame", "GladdyButtonFrame" .. i, self.frame) + button:EnableMouse(false) button:SetAlpha(0) local secure = CreateFrame("Button", "GladdyButton" .. i, button, "SecureActionButtonTemplate") @@ -265,12 +266,9 @@ function Gladdy:CreateButton(i) secure:SetAttribute("*type1", "target") secure:SetAttribute("*type2", "focus") secure:SetAttribute("unit", "arena" .. i) - - button:RegisterEvent("UNIT_NAME_UPDATE") - button:RegisterEvent("ARENA_OPPONENT_UPDATE") - button:RegisterEvent("ARENA_COOLDOWNS_UPDATE") - button:RegisterEvent("ARENA_CROWD_CONTROL_SPELL_UPDATE") - button:RegisterUnitEvent("UNIT_CONNECTION", "arena" .. i) + --secure.texture = secure:CreateTexture(nil, "OVERLAY") + --secure.texture:SetAllPoints(secure) + --secure.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp") button.id = i button.unit = "arena" .. i diff --git a/Modules/Auras.lua b/Modules/Auras.lua index 064b159..16230d8 100644 --- a/Modules/Auras.lua +++ b/Modules/Auras.lua @@ -42,6 +42,7 @@ end function Auras:CreateFrame(unit) local auraFrame = CreateFrame("Frame", nil, Gladdy.modules.Classicon.frames[unit]) + auraFrame:EnableMouse(false) auraFrame:SetFrameStrata("MEDIUM") auraFrame:SetFrameLevel(3) diff --git a/Modules/BuffsDebuffs.lua b/Modules/BuffsDebuffs.lua index 5c811b8..1d7047e 100644 --- a/Modules/BuffsDebuffs.lua +++ b/Modules/BuffsDebuffs.lua @@ -506,6 +506,7 @@ function BuffsDebuffs:AddAura(unit, spellID, auraType, duration, timeLeft, stack aura = tremove(self.framePool, #self.framePool) else aura = CreateFrame("Frame") + aura:EnableMouse(false) aura:SetFrameLevel(3) aura.texture = aura:CreateTexture(nil, "BACKGROUND") aura.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") diff --git a/Modules/Castbar.lua b/Modules/Castbar.lua index 587661e..2a746f0 100644 --- a/Modules/Castbar.lua +++ b/Modules/Castbar.lua @@ -57,6 +57,7 @@ end function Castbar:CreateFrame(unit) local castBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate") + castBar:EnableMouse(false) castBar.unit = unit castBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.castBarBorderStyle), diff --git a/Modules/Cooldowns.lua b/Modules/Cooldowns.lua index 0a88960..9b587df 100644 --- a/Modules/Cooldowns.lua +++ b/Modules/Cooldowns.lua @@ -93,6 +93,7 @@ function Cooldowns:CreateFrame(unit) local button = Gladdy.buttons[unit] -- Cooldown frame local spellCooldownFrame = CreateFrame("Frame", nil, button) + spellCooldownFrame:EnableMouse(false) for x = 1, 14 do local icon = CreateFrame("Frame", nil, spellCooldownFrame) icon:EnableMouse(false) diff --git a/Modules/Diminishings.lua b/Modules/Diminishings.lua index d0c9d57..245e059 100644 --- a/Modules/Diminishings.lua +++ b/Modules/Diminishings.lua @@ -67,6 +67,7 @@ end function Diminishings:CreateFrame(unit) local drFrame = CreateFrame("Frame", nil, Gladdy.buttons[unit]) + drFrame:EnableMouse(false) for i = 1, 16 do local icon = CreateFrame("Frame", "GladdyDr" .. unit .. "Icon" .. i, drFrame) diff --git a/Modules/Powerbar.lua b/Modules/Powerbar.lua index c7a2e7a..ba3ac69 100644 --- a/Modules/Powerbar.lua +++ b/Modules/Powerbar.lua @@ -36,6 +36,7 @@ function Powerbar:CreateFrame(unit) local button = Gladdy.buttons[unit] local powerBar = CreateFrame("Frame", nil, Gladdy.buttons[unit], BackdropTemplateMixin and "BackdropTemplate") + powerBar:EnableMouse(false) powerBar:SetBackdrop({ edgeFile = Gladdy.LSM:Fetch("border", Gladdy.db.powerBarBorderStyle), edgeSize = Gladdy.db.powerBarBorderSize }) powerBar:SetBackdropBorderColor(Gladdy.db.powerBarBorderColor.r, Gladdy.db.powerBarBorderColor.g, Gladdy.db.powerBarBorderColor.b, Gladdy.db.powerBarBorderColor.a) diff --git a/Modules/Racial.lua b/Modules/Racial.lua index 1eb4659..f2ea005 100644 --- a/Modules/Racial.lua +++ b/Modules/Racial.lua @@ -77,6 +77,7 @@ end function Racial:CreateFrame(unit) local racial = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit]) + racial:EnableMouse(false) racial.texture = racial:CreateTexture(nil, "BACKGROUND") racial.texture:SetAllPoints(racial) racial.texture:SetMask("Interface\\AddOns\\Gladdy\\Images\\mask") diff --git a/Modules/Trinket.lua b/Modules/Trinket.lua index 538a62a..7fb96f5 100644 --- a/Modules/Trinket.lua +++ b/Modules/Trinket.lua @@ -71,6 +71,7 @@ end function Trinket:CreateFrame(unit) local trinket = CreateFrame("Button", "GladdyTrinketButton" .. unit, Gladdy.buttons[unit]) + trinket:EnableMouse(false) trinket.texture = trinket:CreateTexture(nil, "BACKGROUND") trinket.texture:SetAllPoints(trinket) trinket.texture:SetTexture("Interface\\Icons\\INV_Jewelry_TrinketPVP_02")