自定义游戏的序列任务场地等数据退出后会保存

This commit is contained in:
MrZ626
2021-07-28 03:10:29 +08:00
parent 81b3082087
commit 512c78e192
7 changed files with 73 additions and 52 deletions

View File

@@ -81,8 +81,24 @@ PLY= require'parts.player'
netPLY= require'parts.netPlayer'
MODES= require'parts.modes'
--Initialize field[1]
FIELD[1]=DATA.newBoard()
--Initialize field
local fieldData=FILE.load('conf/customBoards')
if fieldData then
fieldData=STRING.split(fieldData,"!")
for i=1,#fieldData do
DATA.pasteBoard(fieldData[i],i)
end
else
FIELD[1]=DATA.newBoard()
end
DATA.pasteSequence(FILE.load('conf/customSequence'))
DATA.pasteMission(FILE.load('conf/customMissions'))
local customData=FILE.load('conf/customEnv')--gameEnv for cutsom game
if customData or CUSTOMENV.version~=VERSION.code then
TABLE.complete(customData,CUSTOMENV)
end
TABLE.complete(require"parts.customEnv0",CUSTOMENV)
--First start for phones
if not fs.getInfo('conf/settings')and MOBILE then