diff --git a/api/config.lua b/api/config.lua index 5e8d07c8..3d67e00e 100644 --- a/api/config.lua +++ b/api/config.lua @@ -681,6 +681,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("chat", "bubbles", "alpha", ".75") pfUI:UpdateConfig("nameplates", nil, "use_unitfonts", "0") + pfUI:UpdateConfig("nameplates", nil, "legacy", "0") pfUI:UpdateConfig("nameplates", nil, "overlap", "0") pfUI:UpdateConfig("nameplates", nil, "showcastbar", "1") pfUI:UpdateConfig("nameplates", nil, "spellname", "0") diff --git a/modules/gui.lua b/modules/gui.lua index b5d4522d..a26036b2 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1196,6 +1196,7 @@ pfUI:RegisterModule("gui", function () CreateConfig(nil, this, T["Enable Spellname"], C.nameplates, "spellname", "checkbox") CreateConfig(nil, this, T["Enable Debuffs"], C.nameplates, "showdebuffs", "checkbox") CreateConfig(nil, this, T["Enable Clickthrough"], C.nameplates, "clickthrough", "checkbox") + CreateConfig(nil, this, T["Legacy Click Handlers (Breaks Vertical Position and Overlap)"], C.nameplates, "legacy", "checkbox") CreateConfig(nil, this, T["Enable Overlap"], C.nameplates, "overlap", "checkbox") CreateConfig(nil, this, T["Enable Mouselook With Right Click"], C.nameplates, "rightclick", "checkbox") CreateConfig(nil, this, T["Right Click Auto Attack Threshold"], C.nameplates, "clickthreshold") diff --git a/modules/nameplates.lua b/modules/nameplates.lua index ddd65309..089d3212 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -82,6 +82,7 @@ pfUI:RegisterModule("nameplates", function () this.nameplate = CreateFrame("Button", nil, this) this.nameplate.parent = this this.healthbar = this:GetChildren() + this.healthbar:SetScript("OnEnter", function() return nil end) this.border, this.glow, this.name, this.level, this.levelicon , this.raidicon = this:GetRegions() this.healthbar:SetParent(this.nameplate) this.border:SetParent(this.nameplate) @@ -93,11 +94,13 @@ pfUI:RegisterModule("nameplates", function () end -- init - this:SetFrameLevel(0) - this:EnableMouse(false) + if C.nameplates["legacy"] == "0" then + this:SetFrameLevel(0) + this:EnableMouse(false) + end -- enable plate overlap - if C.nameplates.overlap == "1" then + if C.nameplates.overlap == "1" and C.nameplates["legacy"] == "0" then this:SetWidth(1) this:SetHeight(1) else @@ -109,13 +112,23 @@ pfUI:RegisterModule("nameplates", function () this.nameplate:SetScale(UIParent:GetScale()) this.nameplate:SetWidth(plate_width) this.nameplate:SetHeight(plate_height) - this.nameplate:SetPoint("TOP", this, "TOP", 0, -tonumber(C.nameplates.vpos)) + if C.nameplates["legacy"] == "0" then + this.nameplate:SetPoint("TOP", this, "TOP", 0, -tonumber(C.nameplates.vpos)) + else + this.nameplate:SetPoint("TOP", this, "TOP", 0, 0) + end -- add click handlers if C.nameplates["clickthrough"] == "0" then - this.nameplate:SetScript("OnClick", function() this.parent:Click() end) + if C.nameplates["legacy"] == "0" then + this.nameplate:SetScript("OnClick", function() this.parent:Click() end) + else + this.nameplate:EnableMouse(false) + end + if C.nameplates["rightclick"] == "1" then - this.nameplate:SetScript("OnMouseDown", function() + local plate = C.nameplates["legacy"] == "0" and this.nameplate or this + plate:SetScript("OnMouseDown", function() if arg1 and arg1 == "RightButton" then MouselookStart() @@ -127,6 +140,7 @@ pfUI:RegisterModule("nameplates", function () end) end else + this:EnableMouse(false) this.nameplate:EnableMouse(false) end