Fix: Boss Frame's "Name > Target" shows red instead of class color for the target - #2070
Open
svart2521 wants to merge 1 commit into
Open
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.