From 45dce3210ac4236b88d668e6a08b29be67e47198 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 16 Aug 2021 01:27:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9A=82=E5=81=9C=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=83=BD=E8=BF=9B=E5=85=A5=E5=BD=A9=E8=9B=8B?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=20close=20#206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 1 + parts/gametoolfunc.lua | 1 + parts/globalTables.lua | 1 + parts/scenes/net_game.lua | 4 ++++ parts/scenes/pause.lua | 1 + parts/scenes/setting_skin.lua | 2 +- parts/scenes/setting_sound.lua | 2 +- parts/scenes/staff.lua | 14 ++++++++------ 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index 774daa93..cfea58f9 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -641,6 +641,7 @@ function love.run() gc_print("Lines "..FREEROW.getCount(),safeX+5,-60) gc_print("Tasks "..TASK.getCount(),safeX+5,-80) gc_print("Voices "..VOC.getQueueCount(),safeX+5,-100) + gc_print(tostring(GAME.playing),safeX+5,-120) --Update & draw frame time ins(frameTimeList,1,dt)rem(frameTimeList,126) diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 4023043a..a3484a66 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -251,6 +251,7 @@ function loadGame(mode,ifQuickPlay,ifNet)--Load a mode and go to game scene freshDate() if legalGameTime()then if MODES[mode].score then STAT.lastPlay=mode end + GAME.playing=true GAME.init=true GAME.fromRepMenu=false GAME.curModeName=mode diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 8d68c567..4957dd82 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -155,6 +155,7 @@ FIELD={}--Field(s) for custom game BAG={}--Sequence for custom game MISSION={}--Clearing mission for custom game GAME={--Global game data + playing=false, --If in-game init=false, --If need initializing game when enter scene-play net=false, --If play net game diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 3cee7e0c..50bc7dea 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -78,6 +78,10 @@ function scene.sceneInit(org) NET.specSRID=false end end +function scene.sceneBack() + destroyPlayers() + GAME.playing=false +end scene.mouseDown=NULL function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end diff --git a/parts/scenes/pause.lua b/parts/scenes/pause.lua index e1f8d003..ad90146c 100644 --- a/parts/scenes/pause.lua +++ b/parts/scenes/pause.lua @@ -129,6 +129,7 @@ function scene.keyDown(key,isRep) if isRep then return end if key=="q"then SCN.back() + GAME.playing=false elseif key=="escape"then SCN.swapTo(GAME.result and'game'or'depause','none') elseif key=="s"then diff --git a/parts/scenes/setting_skin.lua b/parts/scenes/setting_skin.lua index e959ec5c..51e3981e 100644 --- a/parts/scenes/setting_skin.lua +++ b/parts/scenes/setting_skin.lua @@ -58,7 +58,7 @@ end local function nextDir(i) SETTING.face[i]=(SETTING.face[i]+1)%4 minoRot0[i]=minoRot0[i]+1.5707963 - if minoRot0[5]>62 then + if minoRot0[5]>62 and not GAME.playing then loadGame('marathon_bfmax',true) end SFX.play('rotate') diff --git a/parts/scenes/setting_sound.lua b/parts/scenes/setting_sound.lua index 7488da74..d6a5d628 100644 --- a/parts/scenes/setting_sound.lua +++ b/parts/scenes/setting_sound.lua @@ -25,7 +25,7 @@ function scene.mouseDown(x,y) jump=10 local t=TIME()-last if t>1 then - if t>2.6 and t<3 then + if t>2.6 and t<3 and not GAME.playing then loadGame('sprintSmooth',true) else VOC.play( diff --git a/parts/scenes/staff.lua b/parts/scenes/staff.lua index 916bc1fd..b8cd284a 100644 --- a/parts/scenes/staff.lua +++ b/parts/scenes/staff.lua @@ -20,11 +20,13 @@ end function scene.mouseDown(x,y) local T=40*math.min(time,45) - if x>230 and x<1050 then - if math.abs(y-800+T)<70 then - loadGame('sprintLock',true) - elseif math.abs(y-2160+T)<70 then - loadGame('sprintFix',true) + if not GAME.playing then + if x>230 and x<1050 then + if math.abs(y-800+T)<70 then + loadGame('sprintLock',true) + elseif math.abs(y-2160+T)<70 then + loadGame('sprintFix',true) + end end end end @@ -37,7 +39,7 @@ function scene.keyDown(key,isRep) if isRep then return end if key=="escape"then SCN.back() - else + elseif not GAME.playing then if key=="l"then loadGame('sprintLock',true) elseif key=="f"then