Skip to content

Fix: Boss Frame's "Name > Target" shows red instead of class color for the target - #2070

Open
svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:boss-unit-frames-not-showing-correct-class-colouring
Open

Fix: Boss Frame's "Name > Target" shows red instead of class color for the target#2070
svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:boss-unit-frames-not-showing-correct-class-colouring

Conversation

@svart2521

Copy link
Copy Markdown
Contributor

Bug: https://discord.com/channels/585577383847788554/1547869283634126909

Boss Frames with a text zone set to "Name > Target" and Class Color enabled show the boss's own name correctly in its reaction color (red, hostile), but the target's name after the separator also shows red instead of its real class color -- unlike the options-panel preview, which correctly shows the boss name red and the target name class-colored (the boss's own red is expected/by design: NPCs have no class, so their name always uses reaction color, matching the health bar and border).

Issue:

A boss's current target ("bossNtarget") is an identity-restricted compound unit, the same category as Target-of-Target/focus-target: UnitClass hands back a SECRET token for it. TagFns.tgtcol (the tag coloring the target segment) could not turn that into the literal hex escape the shared "Name > Target" string needs, so it silently returned "" -- leaving that segment to inherit whatever color came before it in the string, the boss's own hostile-red base color.

Fix:

tgtcol now tries Blizzard's own hex-color generator (ColorMixin:GenerateHexColor, pcall-guarded) on the secret class token first -- it is allowed to declassify a secret color into literal text where plain string.format is not, giving the real class color. If that's ever refused, it falls back to the target's plain reaction color (friend/neutral/hostile, not secret) instead of emitting nothing.

…r the target

Bug:

Boss Frames with a text zone set to "Name > Target" and Class Color enabled
show the boss's own name correctly in its reaction color (red, hostile),
but the target's name after the separator also shows red instead of its
real class color -- unlike the options-panel preview, which correctly
shows the boss name red and the target name class-colored (the boss's own
red is expected/by design: NPCs have no class, so their name always uses
reaction color, matching the health bar and border).

Issue:

A boss's current target ("bossNtarget") is an identity-restricted compound
unit, the same category as Target-of-Target/focus-target: UnitClass hands
back a SECRET token for it. TagFns.tgtcol (the tag coloring the target
segment) could not turn that into the literal hex escape the shared
"Name > Target" string needs, so it silently returned "" -- leaving that
segment to inherit whatever color came before it in the string, the
boss's own hostile-red base color.

Fix:

tgtcol now tries Blizzard's own hex-color generator
(ColorMixin:GenerateHexColor, pcall-guarded) on the secret class token
first -- it is allowed to declassify a secret color into literal text
where plain string.format is not, giving the real class color. If that's
ever refused, it falls back to the target's plain reaction color
(friend/neutral/hostile, not secret) instead of emitting nothing.
Confirmed live: the target now shows its real class color on an actual
boss pull.

Compiles clean (luac5.1 -p).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant