diff --git a/main.lua b/main.lua index 547eeeaf..c227d81e 100644 --- a/main.lua +++ b/main.lua @@ -30,7 +30,6 @@ SAVEDIR=fs.getSaveDirectory() --Global Vars & Settings FIRSTLAUNCH=false DAILYLAUNCH=false -ALLOWTAS=false --System setting math.randomseed(os.time()*626) diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 0c419519..b183a8cd 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -251,6 +251,7 @@ SETTING={--Settings --System reTime=4, + allowTAS=false, autoPause=true, menuPos='middle', fine=false, diff --git a/parts/scenes/app_console.lua b/parts/scenes/app_console.lua index 851ae47d..e3f982de 100644 --- a/parts/scenes/app_console.lua +++ b/parts/scenes/app_console.lua @@ -357,34 +357,34 @@ local commands={}do } commands.wireframe={ code=function(bool) - if bool=="true"or bool=="false"then - gc.setWireframe(bool=="true") + if bool=="on"or bool=="off"then + gc.setWireframe(bool=="on") log("Wireframe: "..(gc.isWireframe()and"on"or"off")) else - log{C.A,"Usage: wireframe "} + log{C.A,"Usage: wireframe "} end end, description="Turn on/off wireframe mode", details={ "Enable or disable wireframe drawing mode.", "", - "Usage: wireframe ", + "Usage: wireframe ", }, } commands.gammacorrect={ code=function(bool) - if bool=="true"or bool=="false"then - love._setGammaCorrect(bool=="true") + if bool=="on"or bool=="off"then + love._setGammaCorrect(bool=="on") log("GammaCorrect: "..(gc.isGammaCorrect()and"on"or"off")) else - log{C.A,"Usage: gammacorrect "} + log{C.A,"Usage: gammacorrect "} end end, description="Turn on/off gamma correction", details={ "Enable or disable gamma correction.", "", - "Usage: gammacorrect ", + "Usage: gammacorrect ", }, } commands.fn={ @@ -732,15 +732,20 @@ local commands={}do }, } commands.tas={ - code=function() - ALLOWTAS=true - log{C.lC,"TAS mode on"} + code=function(bool) + if bool=="on"or bool=="off"then + SETTING.allowTAS=bool=="on" + FILE.save(SETTING,'conf/settings') + log("Allow TAS: "..bool) + else + log{C.A,"Usage: tas "} + end end, description="Allow you to use TAS tool", details={ "Allow you to use TAS tool, a TAS button will show up at the pause menu", "", - "Usage: tas", + "Usage: tas ", }, } diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index e72a5fcc..b5f74550 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -162,7 +162,7 @@ function scene.keyDown(key,isRep) end timer2=0 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 SFX.play('ren_mega') 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="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="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, 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}}}},