Add importing and exporting replays

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-29 00:09:48 +07:00
parent d7726c1854
commit 9679378b1b
7 changed files with 99 additions and 14 deletions

View File

@@ -15,7 +15,7 @@ function GameMode:new(player_name, input_file, replay_grade)
if player_name == nil then self.training = true else self.training = false end
if input_file ~= nil then
input_file = love.filesystem.newFile(REPLAY_DIR..input_file, 'r'):read()
input_file = love.filesystem.read(REPLAY_DIR..input_file)
input_file = lualzw.decompress(input_file)
local seed = self:getInputPieceSeq(input_file)
self.replay_inputs = self:getReplayInputs(input_file)