自定义游戏的序列任务场地等数据退出后会保存
This commit is contained in:
20
main.lua
20
main.lua
@@ -81,8 +81,24 @@ PLY= require'parts.player'
|
|||||||
netPLY= require'parts.netPlayer'
|
netPLY= require'parts.netPlayer'
|
||||||
MODES= require'parts.modes'
|
MODES= require'parts.modes'
|
||||||
|
|
||||||
--Initialize field[1]
|
--Initialize field
|
||||||
FIELD[1]=DATA.newBoard()
|
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
|
--First start for phones
|
||||||
if not fs.getInfo('conf/settings')and MOBILE then
|
if not fs.getInfo('conf/settings')and MOBILE then
|
||||||
|
|||||||
43
parts/customEnv0.lua
Normal file
43
parts/customEnv0.lua
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
return{
|
||||||
|
version=VERSION.code,
|
||||||
|
|
||||||
|
--Basic
|
||||||
|
drop=1e99,
|
||||||
|
lock=1e99,
|
||||||
|
wait=0,
|
||||||
|
fall=0,
|
||||||
|
|
||||||
|
--Control
|
||||||
|
nextCount=6,
|
||||||
|
holdCount=1,
|
||||||
|
infHold=true,
|
||||||
|
phyHold=false,
|
||||||
|
|
||||||
|
--Visual
|
||||||
|
bone=false,
|
||||||
|
|
||||||
|
--Rule
|
||||||
|
sequence='bag',
|
||||||
|
fieldH=20,
|
||||||
|
heightLimit=1e99,
|
||||||
|
bufferLimit=1e99,
|
||||||
|
|
||||||
|
ospin=true,
|
||||||
|
fineKill=false,
|
||||||
|
b2bKill=false,
|
||||||
|
easyFresh=true,
|
||||||
|
deepDrop=false,
|
||||||
|
visible='show',
|
||||||
|
freshLimit=1e99,
|
||||||
|
|
||||||
|
|
||||||
|
opponent="X",
|
||||||
|
life=0,
|
||||||
|
pushSpeed=3,
|
||||||
|
garbageSpeed=1,
|
||||||
|
missionKill=false,
|
||||||
|
|
||||||
|
--Else
|
||||||
|
bg='blockrain',
|
||||||
|
bgm='hang out',
|
||||||
|
}
|
||||||
@@ -201,55 +201,7 @@ USER=FILE.load('conf/user')or{--User infomation
|
|||||||
xp=0,lv=1,
|
xp=0,lv=1,
|
||||||
}
|
}
|
||||||
|
|
||||||
customEnv0={
|
CUSTOMENV={}
|
||||||
version=VERSION.code,
|
|
||||||
|
|
||||||
--Basic
|
|
||||||
drop=1e99,
|
|
||||||
lock=1e99,
|
|
||||||
wait=0,
|
|
||||||
fall=0,
|
|
||||||
|
|
||||||
--Control
|
|
||||||
nextCount=6,
|
|
||||||
holdCount=1,
|
|
||||||
infHold=true,
|
|
||||||
phyHold=false,
|
|
||||||
|
|
||||||
--Visual
|
|
||||||
bone=false,
|
|
||||||
|
|
||||||
--Rule
|
|
||||||
sequence='bag',
|
|
||||||
fieldH=20,
|
|
||||||
heightLimit=1e99,
|
|
||||||
bufferLimit=1e99,
|
|
||||||
|
|
||||||
ospin=true,
|
|
||||||
fineKill=false,
|
|
||||||
b2bKill=false,
|
|
||||||
easyFresh=true,
|
|
||||||
deepDrop=false,
|
|
||||||
visible='show',
|
|
||||||
freshLimit=1e99,
|
|
||||||
|
|
||||||
|
|
||||||
opponent="X",
|
|
||||||
life=0,
|
|
||||||
pushSpeed=3,
|
|
||||||
garbageSpeed=1,
|
|
||||||
missionKill=false,
|
|
||||||
|
|
||||||
--Else
|
|
||||||
bg='blockrain',
|
|
||||||
bgm='hang out',
|
|
||||||
}
|
|
||||||
CUSTOMENV=FILE.load('conf/customEnv')--gameEnv for cutsom game
|
|
||||||
if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then
|
|
||||||
CUSTOMENV=TABLE.copy(customEnv0)
|
|
||||||
else
|
|
||||||
TABLE.complete(customEnv0,CUSTOMENV)
|
|
||||||
end
|
|
||||||
ROOMENV={
|
ROOMENV={
|
||||||
--Room config
|
--Room config
|
||||||
capacity=10,
|
capacity=10,
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ function scene.keyDown(key,isRep)
|
|||||||
if sure>20 then
|
if sure>20 then
|
||||||
TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION)
|
TABLE.cut(FIELD)TABLE.cut(BAG)TABLE.cut(MISSION)
|
||||||
FIELD[1]=DATA.newBoard()
|
FIELD[1]=DATA.newBoard()
|
||||||
TABLE.update(customEnv0,CUSTOMENV)
|
freshMiniFieldVisible()
|
||||||
|
TABLE.update(require"parts.customEnv0",CUSTOMENV)
|
||||||
for _,W in next,scene.widgetList do W:reset()end
|
for _,W in next,scene.widgetList do W:reset()end
|
||||||
sure=0
|
sure=0
|
||||||
SFX.play('finesseError',.7)
|
SFX.play('finesseError',.7)
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ function scene.sceneInit()
|
|||||||
demo=false
|
demo=false
|
||||||
page=1
|
page=1
|
||||||
end
|
end
|
||||||
|
function scene.sceneBack()
|
||||||
|
FILE.save(DATA.copyBoards(),'conf/customBoards')
|
||||||
|
end
|
||||||
|
|
||||||
function scene.mouseMove(x,y)
|
function scene.mouseMove(x,y)
|
||||||
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
|
local sx,sy=int((x-200)/30)+1,20-int((y-60)/30)
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ function scene.sceneInit()
|
|||||||
cur=#MISSION
|
cur=#MISSION
|
||||||
sure=0
|
sure=0
|
||||||
end
|
end
|
||||||
|
function scene.sceneBack()
|
||||||
|
FILE.save(DATA.copyMission(),'conf/customMissions')
|
||||||
|
end
|
||||||
|
|
||||||
local missionEnum=missionEnum
|
local missionEnum=missionEnum
|
||||||
local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true}
|
local legalInput={Z=true,S=true,J=true,L=true,T=true,O=true,I=true,A=true,_=true,P=true}
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ function scene.sceneInit()
|
|||||||
cur=#BAG
|
cur=#BAG
|
||||||
sure=0
|
sure=0
|
||||||
end
|
end
|
||||||
|
function scene.sceneBack()
|
||||||
|
FILE.save(DATA.copySequence(),'conf/customSequence')
|
||||||
|
end
|
||||||
|
|
||||||
local minoKey={
|
local minoKey={
|
||||||
['1']=1,['2']=2,['3']=3,['4']=4,['5']=5,['6']=6,['7']=7,
|
['1']=1,['2']=2,['3']=3,['4']=4,['5']=5,['6']=6,['7']=7,
|
||||||
|
|||||||
Reference in New Issue
Block a user