draw spb enabled modes in bottom left

This commit is contained in:
Not 2022-04-22 17:10:30 +02:00
parent 8de3423ef8
commit 1a72fba49d

View File

@ -665,6 +665,20 @@ local function drawitem(v, x, y, scale, itempatch, vflags)
) )
end 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 = { local cursors = {
[1] = ". ", [1] = ". ",
[2] = " ." [2] = " ."
@ -738,7 +752,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
x - 2, x - 2,
y - 2, y - 2,
scale, scale,
PATCH["SPB"], modePatch(F_SPBATK),
V_HUDTRANS | VFLAGS V_HUDTRANS | VFLAGS
) )
if score["flags"] & F_SPBEXP then 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, x + FACERANK_DIM - 4,
y - 2, y - 2,
scale, scale,
PATCH["INV"][(leveltime / 4) % 6], modePatch(F_SPBEXP),
V_HUDTRANS | VFLAGS V_HUDTRANS | VFLAGS
) )
end end
@ -757,7 +771,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
x - 2, x - 2,
y + FACERANK_DIM - 4, y + FACERANK_DIM - 4,
scale, scale,
PATCH["BIG"], drawMode(F_SPBBIG),
V_HUDTRANS | VFLAGS V_HUDTRANS | VFLAGS
) )
end end
@ -767,7 +781,7 @@ local function drawScore(v, player, pos, x, y, gui, faceRank, score, drawPos, te
x + FACERANK_DIM - 4, x + FACERANK_DIM - 4,
y + FACERANK_DIM - 4, y + FACERANK_DIM - 4,
scale, scale,
PATCH["HYUD"], drawMode(F_SPBJUS),
V_HUDTRANS | VFLAGS V_HUDTRANS | VFLAGS
) )
end end
@ -919,6 +933,14 @@ local stateFunctions = {
[DS_SCRLTO] = drawScrollTo [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) local function drawScoreboard(v, player)
if disable then return end if disable then return end
if player != displayplayers[0] then return end if player != displayplayers[0] then return end
@ -935,6 +957,12 @@ local function drawScoreboard(v, player)
if gui then if gui then
stateFunctions[drawState](v, player, scoreTable, gui) stateFunctions[drawState](v, player, scoreTable, gui)
end 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 end
hud.add(drawScoreboard, "game") hud.add(drawScoreboard, "game")