mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 10:26:02 +00:00
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:
+13
-9
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user