自定义游戏设置会自动保存

This commit is contained in:
MrZ626
2021-04-19 22:17:27 +08:00
parent ae1dd6dfaa
commit e5b726aa4a
2 changed files with 45 additions and 39 deletions

View File

@@ -148,44 +148,6 @@ PLY_NET={}
FIELD={}--Field(s) for custom game
BAG={}--Sequence for custom game
MISSION={}--Clearing mission for custom game
CUSTOMENV={--gameEnv for cutsom game
--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,
ospin=true,
fineKill=false,
b2bKill=false,
easyFresh=true,
deepDrop=false,
visible="show",
freshLimit=1e99,
opponent="X",
life=0,
pushSpeed=3,
missionKill=false,
--Else
bg="none",
bgm="infinite",
}
GAME={--Global game data
init=false, --If need initializing game when enter scene-play
net=false, --If play net game
@@ -227,6 +189,47 @@ USER=FILE.load("conf/user")or{--User infomation
--Local data
xp=0,lv=1,
}
CUSTOMENV=FILE.load("conf/customEnv")
if not CUSTOMENV or CUSTOMENV.version~=VERSION.code then CUSTOMENV={--gameEnv for cutsom game
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,
ospin=true,
fineKill=false,
b2bKill=false,
easyFresh=true,
deepDrop=false,
visible="show",
freshLimit=1e99,
opponent="X",
life=0,
pushSpeed=3,
missionKill=false,
--Else
bg="none",
bgm="infinite",
}end
SETTING={--Settings
--Tuning
das=10,arr=2,dascut=0,

View File

@@ -48,9 +48,11 @@ function scene.keyDown(key)
end
if key=="return2"or kb.isDown("lalt","lctrl","lshift")then
if initField then
FILE.save(CUSTOMENV,"conf/customEnv","q")
loadGame("custom_puzzle",true)
end
else
FILE.save(CUSTOMENV,"conf/customEnv","q")
loadGame("custom_clear",true)
end
elseif key=="f"then
@@ -87,6 +89,7 @@ function scene.keyDown(key)
do return end
::THROW_fail::LOG.print(text.dataCorrupted,COLOR.red)
elseif key=="escape"then
FILE.save(CUSTOMENV,"conf/customEnv","q")
SCN.back()
else
WIDGET.keyPressed(key)
@@ -171,7 +174,7 @@ scene.widgetList={
WIDGET.newKey{name="sequence", x=450, y=640,w=240,h=80,color="pink", font=25,code=goScene"custom_sequence"},
WIDGET.newKey{name="mission", x=730, y=640,w=240,h=80,color="sky", font=25,code=goScene"custom_mission"},
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=backScene},
WIDGET.newButton{name="back", x=1140, y=640, w=170,h=80,font=40,code=pressKey"escape"},
}
return scene