mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +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])
|
local r, g, b, a = unpack(unitcolors[unittype])
|
||||||
|
|
||||||
if class then
|
if class and (
|
||||||
if unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1" then
|
(unittype == "ENEMY_PLAYER" and C.nameplates["enemyclassc"] == "1") or
|
||||||
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
|
(unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1")
|
||||||
elseif unittype == "FRIENDLY_PLAYER" and C.nameplates["friendclassc"] == "1" then
|
) then
|
||||||
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
|
r, g, b, a = PFUI_CLASS_COLORS[class]:GetRGBA()
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if unitstr and UnitIsTapped(unitstr) and not UnitIsTappedByPlayer(unitstr) then
|
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
|
plate.cache.namecolor = r + g + b
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update combopoints
|
|
||||||
for i=1, 5 do plate.combopoints[i]:Hide() end
|
|
||||||
if target and C.nameplates.cpdisplay == "1" then
|
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
|
end
|
||||||
|
|
||||||
-- update debuffs
|
-- update debuffs
|
||||||
|
|||||||
Reference in New Issue
Block a user