forked from Not/srb2k-leaderboard
v1.2.3
This commit is contained in:
parent
190f94b2b9
commit
321ff7737c
@ -186,6 +186,17 @@ local function drawitem(v, x, y, scale, itempatch, vflags)
|
|||||||
)
|
)
|
||||||
end
|
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 bodium = {V_YELLOWMAP, V_GRAYMAP, V_BROWNMAP, 0}
|
||||||
local splitColor = {[true]=V_SKYMAP, [false]=V_REDMAP}
|
local splitColor = {[true]=V_SKYMAP, [false]=V_REDMAP}
|
||||||
local splitSymbol = {[true]="-", [false]="+"}
|
local splitSymbol = {[true]="-", [false]="+"}
|
||||||
@ -273,7 +284,7 @@ local function drawScoreboard(v, player)
|
|||||||
stralign = "small"
|
stralign = "small"
|
||||||
py = 2
|
py = 2
|
||||||
if v.stringWidth(name, 0, "small") > MAXWIDTH then
|
if v.stringWidth(name, 0, "small") > MAXWIDTH then
|
||||||
name = name:sub(0, 15) + "..."
|
name = marquee(name, 15)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user