From 2dfaa651682bcd24d911d6e3d74af9a44e33a364 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 9 Aug 2026 13:01:29 -0500 Subject: [PATCH] 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. --- modules/nameplates.lua | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/nameplates.lua b/modules/nameplates.lua index a1ccd34c..3dee7d30 100644 --- a/modules/nameplates.lua +++ b/modules/nameplates.lua @@ -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