Replace every single `io.open into fs.read()`

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-04-11 10:25:56 +07:00
parent 3c88b8241b
commit e4b9ef4e51
2 changed files with 11 additions and 11 deletions

View File

@@ -30,9 +30,9 @@ function NameEntryScene:new()
self.name_entry = {config['last_entry']:sub(1,1),config['last_entry']:sub(2,2),config['last_entry']:sub(3,3)}
self.entry_pos = 3
end
score_file = io.open(HIscoreFILE, 'rb')
score_file = love.filesystem.newFile(HIscoreFILE, 'r')
if score_file ~= nil then
self.hi_scores = binser.deserialize(score_file:read('a'))[1]
self.hi_scores = binser.deserialize(score_file:read())[1]
else
self.hi_scores = {"TRO",0,"MIT",0,"ROM",0,"ITR",0,"OMI",0}
end
@@ -122,7 +122,7 @@ function NameEntryScene:onInputPress(e)
else
if self.entry_pos == 3 then
name = string.lower(self.name_entry[1]..self.name_entry[2]..self.name_entry[3])
grade_history = io.open(SAVE_DIR..name.."_grade_history.sav", 'rb')
grade_history = love.filesystem.newFile(SAVE_DIR..name.."_grade_history.sav", 'r')
if grade_history ~= nil then
grade_history = binser.deserialize(grade_history:read())[1]
self.grade = grade_history[1]