totem plates fix UpdateFrameOnce

This commit is contained in:
Sumsebrum 2021-06-16 14:11:34 +02:00
parent 993de572cd
commit cbf8c1a13b

View File

@ -282,8 +282,7 @@ function TotemPlates:UpdateFrameOnce()
nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE") nameplate.gladdyTotemFrame.totemName:SetFont(Gladdy.LSM:Fetch("font", Gladdy.db.npTremorFont), Gladdy.db.npTremorFontSize, "OUTLINE")
nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "") nameplate.gladdyTotemFrame.totemName:SetText(Gladdy.db.npTotemColors["totem" .. totemDataEntry.id].customText or "")
self:SetTotemAlpha(nameplate.gladdyTotemFrame, k) self:SetTotemAlpha(nameplate.gladdyTotemFrame, k)
nameplate.UnitFrame.selectionHighlight:SetPoint("TOPLEFT", nameplate.gladdyTotemFrame, "TOPLEFT", Gladdy.db.npTotemPlatesSize/16, -Gladdy.db.npTotemPlatesSize/16) self:ToggleAddon(nameplate)
nameplate.UnitFrame.selectionHighlight:SetPoint("BOTTOMRIGHT", nameplate.gladdyTotemFrame, "BOTTOMRIGHT", -Gladdy.db.npTotemPlatesSize/16, Gladdy.db.npTotemPlatesSize/16)
end end
for i,gladdyTotemFrame in ipairs(self.totemPlateCache) do for i,gladdyTotemFrame in ipairs(self.totemPlateCache) do
gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor) gladdyTotemFrame:SetWidth(Gladdy.db.npTotemPlatesSize * Gladdy.db.npTotemPlatesWidthFactor)
@ -344,8 +343,7 @@ function TotemPlates:PLAYER_TARGET_CHANGED()
end end
end end
function TotemPlates:ToggleAddon(nameplate, show) function TotemPlates:ToggleAddon(nameplate)
if not show then
if self.addon == "Blizzard" then if self.addon == "Blizzard" then
nameplate.UnitFrame:Hide() nameplate.UnitFrame:Hide()
elseif self.addon == "Plater" then elseif self.addon == "Plater" then
@ -363,7 +361,6 @@ function TotemPlates:ToggleAddon(nameplate, show)
end end
end end
end end
end
function TotemPlates.OnUpdate(self) function TotemPlates.OnUpdate(self)
if (UnitIsUnit("mouseover", self.unitID) or UnitIsUnit("target", self.unitID)) then if (UnitIsUnit("mouseover", self.unitID) or UnitIsUnit("target", self.unitID)) then
@ -413,7 +410,7 @@ function TotemPlates:NAME_PLATE_UNIT_ADDED(...)
nameplate.gladdyTotemFrame.parent = nameplate nameplate.gladdyTotemFrame.parent = nameplate
nameplate.gladdyTotemFrame:Show() nameplate.gladdyTotemFrame:Show()
TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID) TotemPlates:SetTotemAlpha(nameplate.gladdyTotemFrame, unitID)
self:ToggleAddon(nameplate, false) self:ToggleAddon(nameplate)
self.activeTotemNameplates[unitID] = nameplate self.activeTotemNameplates[unitID] = nameplate
end end
end end