Compare commits

...

2 Commits

Author SHA1 Message Date
Not
ef4c43161d draw browser when gui is disabled 2023-01-14 20:16:29 +01:00
Not
9b1ef1a655 ignore empty lines, ignore missing files 2022-12-12 18:36:29 +01:00
2 changed files with 16 additions and 10 deletions

View File

@ -1046,7 +1046,7 @@ local function drawScoreboard(v, player)
cachePatches(v)
local gui = cv_gui.value
local gui = cv_gui.value or drawState == DS_BROWSER
-- Force enable gui at start and end of the race
if leveltime < START_TIME or player.exiting or player.lives == 0 then
@ -1055,13 +1055,13 @@ 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)
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")

View File

@ -48,9 +48,15 @@ def SameScore(a, b):
def LoadRecordsFromFile(path):
records = []
with open(path, "r") as f:
for line in f.readlines():
records.append(ParseScore(line.strip()))
try:
with open(path, "r") as f:
for line in f.readlines():
line = line.strip()
if line != "":
records.append(ParseScore(line))
except FileNotFoundError:
pass
return records
def AddScore(records, score):