Gate combopoint updates and fold player class-color branches

- combopoints: only ever show on the target's plate, so re-issue Show/Hide
  only when the target's combo count changes, and skip non-target plates once
  cleared (they start hidden) -- instead of hiding all five every tick on every
  plate. plate.cpShown tracks the shown count and stays in sync with the frames.
- player class color: merge the identical ENEMY_PLAYER / FRIENDLY_PLAYER
  branches into one condition.
This commit is contained in:
Brues
2026-08-09 13:01:29 -05:00
parent 97ef039d3a
commit 2dfaa65168
+13 -9
View File
@@ -1226,12 +1226,11 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
local r, g, b, a = unpack(unitcolors[unittype])
if class then
if unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1" then
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
elseif unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1" then
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
end
if class and (
(unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1") or
(unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1")
) then
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
end
if unitstr and UnitIsTapped(unitstr) and not UnitIsTappedByPlayer(unitstr) then
@@ -1257,10 +1256,15 @@ nameplates:RegisterEvent("PLAYER_GUILD_UPDATE")
plate.cache.namecolor = r + g + b
end
-- update combopoints
for i=1, 5 do plate.combopoints[i]:Hide() end
if target and C.nameplates.cpdisplay == "1" then
for i=1, GetComboPoints("target") do plate.combopoints[i]:Show() end
local cp = GetComboPoints("target")
if plate.cpShown ~= cp then
for i=1, 5 do plate.combopoints[i]:SetShown(i <= cp) end
plate.cpShown = cp
end
elseif plate.cpShown then
for i=1, 5 do plate.combopoints[i]:Hide() end
plate.cpShown = nil
end
-- update debuffs