This commit is contained in:
Not 2022-03-28 13:09:52 +02:00
parent 190f94b2b9
commit 321ff7737c
1 changed files with 12 additions and 1 deletions

View File

@ -186,6 +186,17 @@ local function drawitem(v, x, y, scale, itempatch, vflags)
)
end
local function marquee(text, maxwidth)
if #text <= maxwidth then
return text
end
local shift = 16
local pos = ((leveltime / 16) % (#text - maxwidth + shift * 2)) + 1 - shift
pos = min(max(pos, 1), #text - maxwidth + 1)
return text:sub(pos, pos + maxwidth - 1)
end
local bodium = {V_YELLOWMAP, V_GRAYMAP, V_BROWNMAP, 0}
local splitColor = {[true]=V_SKYMAP, [false]=V_REDMAP}
local splitSymbol = {[true]="-", [false]="+"}
@ -273,7 +284,7 @@ local function drawScoreboard(v, player)
stralign = "small"
py = 2
if v.stringWidth(name, 0, "small") > MAXWIDTH then
name = name:sub(0, 15) + "..."
name = marquee(name, 15)
end
end
end