From e6423785444f01efd80583ffaadf81d7593b71e3 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sun, 12 Aug 2018 19:58:16 +0300 Subject: [PATCH] update np --- ElvUI/Modules/NamePlates/Elements/HealthBar.lua | 12 ++++++++---- ElvUI/Modules/NamePlates/NamePlates.lua | 9 +++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ElvUI/Modules/NamePlates/Elements/HealthBar.lua b/ElvUI/Modules/NamePlates/Elements/HealthBar.lua index 45378a9..cbef134 100644 --- a/ElvUI/Modules/NamePlates/Elements/HealthBar.lua +++ b/ElvUI/Modules/NamePlates/Elements/HealthBar.lua @@ -118,12 +118,16 @@ function mod:ConfigureElement_HealthBar(frame, configuring) local healthBar = frame.HealthBar healthBar:SetPoint("TOP", frame, "CENTER", 0, self.db.units[frame.UnitType].castbar.height + 3) + + local width, height = self.db.clickableWidth + ((E.PixelMode and 2) or 6), self.db.clickableHeight + self.db.units[frame.UnitType].castbar.height + 3 if self.db.motionType ~= "OVERLAP" then - frame:GetParent():SetWidth(self.db.clickableWidth + ((E.PixelMode and 2) or 6)) - frame:GetParent():SetHeight(self.db.clickableHeight + self.db.units[frame.UnitType].castbar.height + 3) + frame:GetParent():SetWidth(width) + frame:GetParent():SetHeight(height) + else + frame:GetParent():SetHitRectInsets(-.5*width, -.5*width, -.5*height, -.5*height) end - frame:SetWidth(self.db.clickableWidth + ((E.PixelMode and 2) or 6)) - frame:SetHeight(self.db.clickableHeight + self.db.units[frame.UnitType].castbar.height + 3) + frame:SetWidth(width) + frame:SetHeight(height) if frame.isTarget and self.db.useTargetScale then healthBar:SetHeight(self.db.units[frame.UnitType].healthbar.height * ((frame.CustomScale and frame.CustomScale * self.db.targetScale) or self.db.targetScale)) diff --git a/ElvUI/Modules/NamePlates/NamePlates.lua b/ElvUI/Modules/NamePlates/NamePlates.lua index 9c6bc4f..459df4e 100644 --- a/ElvUI/Modules/NamePlates/NamePlates.lua +++ b/ElvUI/Modules/NamePlates/NamePlates.lua @@ -529,14 +529,11 @@ function mod:OnCreated(frame) end) ]] - frame.UnitFrame:SetScript("OnMouseDown", function() + frame:SetScript("OnMouseDown", function() if arg1 == "RightButton" then MouselookStart() end end) - frame.UnitFrame:SetScript("OnClick", function() - frame:Click() - end) frame.UnitFrame.moveUp = CreateAnimationGroup(frame.UnitFrame) local moveUp = frame.UnitFrame.moveUp:CreateAnimation("Move") @@ -772,7 +769,7 @@ function mod:PLAYER_REGEN_ENABLED() end end -function mod:ClassCacheQueryResult(_, name, class) +function mod:ClassCache_ClassUpdated(_, name, class) if queryList[name] then local frame = queryList[name] @@ -819,7 +816,7 @@ function mod:Initialize() --self:RegisterEvent("UNIT_AURA") --self:RegisterEvent("PLAYER_COMBO_POINTS") - self:RegisterMessage("ClassCacheQueryResult") + self:RegisterMessage("ClassCache_ClassUpdated") self:ScheduleRepeatingTimer("ForEachVisiblePlate", 0.1, "SetTargetFrame")