generate a hash for the title screen for easy verification in races

This commit is contained in:
duncathan 2020-03-07 01:58:03 -06:00
parent af8421e2a5
commit f58357832d
2 changed files with 7 additions and 0 deletions

Binary file not shown.

View file

@ -73,6 +73,7 @@ function C:randomize()
local tscFiles = self:_createTscFiles(dirStage) local tscFiles = self:_createTscFiles(dirStage)
self:_shuffleItems(tscFiles) self:_shuffleItems(tscFiles)
self:_generateHash()
if self.shuffleMusic then self.music:shuffleMusic(tscFiles) end if self.shuffleMusic then self.music:shuffleMusic(tscFiles) end
self:_writeModifiedData(tscFiles) self:_writeModifiedData(tscFiles)
@ -286,6 +287,12 @@ function C:_copyMyChar()
U.writeFile(path, data) U.writeFile(path, data)
end end
function C:_generateHash()
local path = self:_getWritePath() .. '/hash.txt'
local h = {love.math.random(39), love.math.random(39), love.math.random(39), love.math.random(39), love.math.random(39)}
U.writeFile(path, ("%04d,%04d,%04d,%04d,%04d"):format(h[1], h[2], h[3], h[4], h[5]))
end
function C:_getWritePath() function C:_getWritePath()
return select(1, self:_getWritePaths()) return select(1, self:_getWritePaths())
end end