Skip to content

Commit 43b6a3c

Browse files
committed
Fix missing player name color
1 parent b4fcf01 commit 43b6a3c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lua/custom_chat/client/block_types.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,6 @@ function Create.Gradient( text, font, colorA, colorB, elementName )
288288
local lines = { Create.Element( "span", elementName ) }
289289
Append( lines, "%s.className = 'gradient-container';", elementName )
290290

291-
if IsStringValid( font ) then
292-
Append( lines, "%s.style.fontFamily = '%s';", font, elementName )
293-
end
294-
295291
-- Gradient background/glow
296292
Append( lines, Create.Element( "span", "elGradientGlow", elementName ) )
297293
Append( lines, "elGradientGlow.className = 'gradient-bg';" )
@@ -315,6 +311,11 @@ function Create.Gradient( text, font, colorA, colorB, elementName )
315311
Append( lines, "elGradientText.textContent = '%s';", text )
316312
Append( lines, "elGradientText.style.backgroundImage = '-webkit-linear-gradient(left, %s, %s)';", ColorToRGB( colorA ), ColorToRGB( colorB ) )
317313

314+
if IsStringValid( font ) then
315+
Append( lines, "elGradientGlow.style.fontFamily = '%s';", font )
316+
Append( lines, "elGradientText.style.fontFamily = '%s';", font )
317+
end
318+
318319
return table.concat( lines, "\n" )
319320
end
320321

@@ -518,6 +519,10 @@ blocks["player"] = function( value, ctx )
518519
if IsStringValid( ctx.font ) then
519520
Append( lines, "elPlayer.style.fontFamily = '%s';", ctx.font )
520521
end
522+
523+
if colors[1] then
524+
Append( lines, "elPlayer.style.color = '%s';", ColorToRGB( colors[1] ) )
525+
end
521526
end
522527

523528
if not value.isBot then

0 commit comments

Comments
 (0)