Make a new FILE API and add a simple error screen in case most thing went down

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-26 16:39:08 +07:00
parent c45104ce88
commit 4b001cdf57
6 changed files with 117 additions and 49 deletions

View File

@@ -56,7 +56,7 @@ function NameEntryScene:new()
self.entry_pos = 3
end
if love.filesystem.getInfo(HIscoreFILE) then
self.hi_scores = bitser.loadLoveFile(HIscoreFILE)
self.hi_scores = FILE.read(HIscoreFILE)
else
self.hi_scores = {"TRO",0,"MIT",0,"ROM",0,"ITR",0,"OMI",0}
end
@@ -150,7 +150,7 @@ function NameEntryScene:onInputPress(e)
if self.entry_pos == 3 then
name = string.lower(self.name_entry[1]..self.name_entry[2]..self.name_entry[3])
if love.filesystem.getInfo((SAVE_DIR..name.."_grade_history.sav")) then
grade_history = bitser.loadLoveFile(SAVE_DIR..name.."_grade_history.sav")
grade_history = FILE.read(SAVE_DIR..name.."_grade_history.sav")
self.grade = grade_history[1]
self.wins = grade_history[2]
self.plays = grade_history[4]