forked from Not/srb2k-leaderboard
draw spb enabled modes in bottom left
This commit is contained in:
parent
8de3423ef8
commit
1a72fba49d
@ -665,6 +665,20 @@ local function drawitem(v, x, y, scale, itempatch, vflags)
|
||||
)
|
||||
end
|
||||
|
||||
local modePatches = {
|
||||
[F_SPBATK] = "SPB",
|
||||
[F_SPBJUS] = "HYUD",
|
||||
[F_SPBBIG] = "BIG",
|
||||
[F_SPBEXP] = "INV"
|
||||
}
|
||||
|
||||
local function modePatch(flag)
|
||||
if flag == F_SPBEXP then
|
||||
return PATCH[modePatches[flag]][(leveltime / 4) % 6]
|
||||
end
|
||||
return PATCH[modePatches[flag]]
|
||||
end
|
||||
|
||||
local cursors = {
|
||||
[1] = ". ",
|
||||
[2] = " ."
|
||||
@ -738,7 +752,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
|
||||
x - 2,
|
||||
y - 2,
|
||||
scale,
|
||||
PATCH["SPB"],
|
||||
modePatch(F_SPBATK),
|
||||
V_HUDTRANS | VFLAGS
|
||||
)
|
||||
if score["flags"] & F_SPBEXP then
|
||||
@ -747,7 +761,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
|
||||
x + FACERANK_DIM - 4,
|
||||
y - 2,
|
||||
scale,
|
||||
PATCH["INV"][(leveltime / 4) % 6],
|
||||
modePatch(F_SPBEXP),
|
||||
V_HUDTRANS | VFLAGS
|
||||
)
|
||||
end
|
||||
@ -757,7 +771,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
|
||||
x - 2,
|
||||
y + FACERANK_DIM - 4,
|
||||
scale,
|
||||
PATCH["BIG"],
|
||||
drawMode(F_SPBBIG),
|
||||
V_HUDTRANS | VFLAGS
|
||||
)
|
||||
end
|
||||
@ -767,7 +781,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
|
||||
x + FACERANK_DIM - 4,
|
||||
y + FACERANK_DIM - 4,
|
||||
scale,
|
||||
PATCH["HYUD"],
|
||||
drawMode(F_SPBJUS),
|
||||
V_HUDTRANS | VFLAGS
|
||||
)
|
||||
end
|
||||
@ -919,6 +933,14 @@ local stateFunctions = {
|
||||
[DS_SCRLTO] = drawScrollTo
|
||||
}
|
||||
|
||||
-- Draw mode and return pos + 1 if success
|
||||
local function drawMode(v, pos, flag)
|
||||
if not (Flags & flag) then return pos end
|
||||
|
||||
drawitem(v, pos * 6 + 1, 194, FRACUNIT / 4, modePatch(flag), V_SNAPTOBOTTOM | V_SNAPTOLEFT)
|
||||
return pos + 1
|
||||
end
|
||||
|
||||
local function drawScoreboard(v, player)
|
||||
if disable then return end
|
||||
if player != displayplayers[0] then return end
|
||||
@ -935,6 +957,12 @@ local function drawScoreboard(v, player)
|
||||
if gui then
|
||||
stateFunctions[drawState](v, player, scoreTable, gui)
|
||||
end
|
||||
|
||||
local pos = 0
|
||||
-- Draw current active modes bottom left
|
||||
pos = drawMode(v, pos, F_SPBJUS)
|
||||
pos = drawMode(v, pos, F_SPBBIG)
|
||||
pos = drawMode(v, pos, F_SPBEXP)
|
||||
end
|
||||
hud.add(drawScoreboard, "game")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user