控制台输入布尔值的两个命令改成on/off,tas会修改设置,重启游戏依然生效
This commit is contained in:
1
main.lua
1
main.lua
@@ -30,7 +30,6 @@ SAVEDIR=fs.getSaveDirectory()
|
|||||||
--Global Vars & Settings
|
--Global Vars & Settings
|
||||||
FIRSTLAUNCH=false
|
FIRSTLAUNCH=false
|
||||||
DAILYLAUNCH=false
|
DAILYLAUNCH=false
|
||||||
ALLOWTAS=false
|
|
||||||
|
|
||||||
--System setting
|
--System setting
|
||||||
math.randomseed(os.time()*626)
|
math.randomseed(os.time()*626)
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ SETTING={--Settings
|
|||||||
|
|
||||||
--System
|
--System
|
||||||
reTime=4,
|
reTime=4,
|
||||||
|
allowTAS=false,
|
||||||
autoPause=true,
|
autoPause=true,
|
||||||
menuPos='middle',
|
menuPos='middle',
|
||||||
fine=false,
|
fine=false,
|
||||||
|
|||||||
@@ -357,34 +357,34 @@ local commands={}do
|
|||||||
}
|
}
|
||||||
commands.wireframe={
|
commands.wireframe={
|
||||||
code=function(bool)
|
code=function(bool)
|
||||||
if bool=="true"or bool=="false"then
|
if bool=="on"or bool=="off"then
|
||||||
gc.setWireframe(bool=="true")
|
gc.setWireframe(bool=="on")
|
||||||
log("Wireframe: "..(gc.isWireframe()and"on"or"off"))
|
log("Wireframe: "..(gc.isWireframe()and"on"or"off"))
|
||||||
else
|
else
|
||||||
log{C.A,"Usage: wireframe <true|false>"}
|
log{C.A,"Usage: wireframe <on|off>"}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
description="Turn on/off wireframe mode",
|
description="Turn on/off wireframe mode",
|
||||||
details={
|
details={
|
||||||
"Enable or disable wireframe drawing mode.",
|
"Enable or disable wireframe drawing mode.",
|
||||||
"",
|
"",
|
||||||
"Usage: wireframe <true|false>",
|
"Usage: wireframe <on|off>",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
commands.gammacorrect={
|
commands.gammacorrect={
|
||||||
code=function(bool)
|
code=function(bool)
|
||||||
if bool=="true"or bool=="false"then
|
if bool=="on"or bool=="off"then
|
||||||
love._setGammaCorrect(bool=="true")
|
love._setGammaCorrect(bool=="on")
|
||||||
log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off"))
|
log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off"))
|
||||||
else
|
else
|
||||||
log{C.A,"Usage: gammacorrect <true|false>"}
|
log{C.A,"Usage: gammacorrect <on|off>"}
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
description="Turn on/off gamma correction",
|
description="Turn on/off gamma correction",
|
||||||
details={
|
details={
|
||||||
"Enable or disable gamma correction.",
|
"Enable or disable gamma correction.",
|
||||||
"",
|
"",
|
||||||
"Usage: gammacorrect <true|false>",
|
"Usage: gammacorrect <on|off>",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
commands.fn={
|
commands.fn={
|
||||||
@@ -732,15 +732,20 @@ local commands={}do
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
commands.tas={
|
commands.tas={
|
||||||
code=function()
|
code=function(bool)
|
||||||
ALLOWTAS=true
|
if bool=="on"or bool=="off"then
|
||||||
log{C.lC,"TAS mode on"}
|
SETTING.allowTAS=bool=="on"
|
||||||
|
FILE.save(SETTING,'conf/settings')
|
||||||
|
log("Allow TAS: "..bool)
|
||||||
|
else
|
||||||
|
log{C.A,"Usage: tas <on|off>"}
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
description="Allow you to use TAS tool",
|
description="Allow you to use TAS tool",
|
||||||
details={
|
details={
|
||||||
"Allow you to use TAS tool, a TAS button will show up at the pause menu",
|
"Allow you to use TAS tool, a TAS button will show up at the pause menu",
|
||||||
"",
|
"",
|
||||||
"Usage: tas",
|
"Usage: tas <on|off>",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function scene.keyDown(key,isRep)
|
|||||||
end
|
end
|
||||||
timer2=0
|
timer2=0
|
||||||
elseif key=="t"then
|
elseif key=="t"then
|
||||||
if ALLOWTAS and not(GAME.result or GAME.replaying)then
|
if SETTING.allowTAS and not(GAME.result or GAME.replaying)then
|
||||||
GAME.tasUsed=true
|
GAME.tasUsed=true
|
||||||
SFX.play('ren_mega')
|
SFX.play('ren_mega')
|
||||||
SFX.play('clear_3')
|
SFX.play('clear_3')
|
||||||
@@ -358,7 +358,7 @@ scene.widgetList={
|
|||||||
WIDGET.newKey{name="restart", x=290,y=340,w=300,h=70,code=pressKey"r",hideF=function()return GAME.fromRepMenu end},
|
WIDGET.newKey{name="restart", x=290,y=340,w=300,h=70,code=pressKey"r",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newKey{name="setting", x=290,y=440,w=300,h=70,code=pressKey"s",hideF=function()return GAME.fromRepMenu end},
|
WIDGET.newKey{name="setting", x=290,y=440,w=300,h=70,code=pressKey"s",hideF=function()return GAME.fromRepMenu end},
|
||||||
WIDGET.newKey{name="quit", x=290,y=540,w=300,h=70,code=backScene},
|
WIDGET.newKey{name="quit", x=290,y=540,w=300,h=70,code=backScene},
|
||||||
WIDGET.newKey{name="tas", x=290,y=620,w=240,h=50,code=pressKey"t",hideF=function()return not ALLOWTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
|
WIDGET.newKey{name="tas", x=290,y=620,w=240,h=50,code=pressKey"t",hideF=function()return not SETTING.allowTAS or GAME.tasUsed or GAME.result or GAME.replaying end},
|
||||||
WIDGET.newKey{name="page_prev", x=500,y=390,w=70,code=pressKey"tab",noFrame=true,
|
WIDGET.newKey{name="page_prev", x=500,y=390,w=70,code=pressKey"tab",noFrame=true,
|
||||||
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}},
|
fText=GC.DO{70,70,{'setLW',2}, {'dRPol',33,35,32,3,6,3.142},{'dRPol',45,35,32,3,6,3.142}},
|
||||||
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}},
|
fShade=GC.DO{70,70,{'setCL',1,1,1,.4},{'draw',GC.DO{70,70,{'setCL',1,1,1,1},{'fRPol',33,35,32,3,6,3.142},{'fRPol',45,35,32,3,6,3.142}}}},
|
||||||
|
|||||||
Reference in New Issue
Block a user