nameplates: always set mouse state for both variants

This commit is contained in:
shagu
2024-12-25 23:06:35 +01:00
parent 77b8fb7513
commit 0b5407c5a8
+9 -16
View File
@@ -1033,7 +1033,8 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
local parent = self
local nameplate = self.nameplate
local plate = C.nameplates["overlap"] == "1" and nameplate or parent
local plate = (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") and nameplate or parent
local clickable = C.nameplates["clickthrough"] ~= "1" and true or false
if C.nameplates["vertical_offset"] ~= "0" then
nameplate:SetPoint("TOP", parent, "TOP", 0, tonumber(C.nameplates["vertical_offset"]))
@@ -1041,14 +1042,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
-- replace clickhandler
if C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0" then
parent:SetFrameLevel(0)
nameplate:SetScript("OnClick", function() parent:Click() end)
parent:EnableMouse(false)
nameplate:EnableMouse(true)
else
parent:EnableMouse(true)
nameplate:EnableMouse(false)
plate:SetScript("OnClick", function() parent:Click() end)
end
-- enable mouselook on rightbutton down
@@ -1058,13 +1052,12 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
plate:SetScript("OnMouseDown", nil)
end
-- disable click event on frames
if C.nameplates["clickthrough"] == "1" then
nameplate:EnableMouse(false)
plate:EnableMouse(false)
else
plate:EnableMouse(true)
end
-- disable all click events
parent:EnableMouse(false)
nameplate:EnableMouse(false)
-- make the actual plate clickable
plate:EnableMouse(clickable)
end
local hookOnUpdate = nameplates.OnUpdate