diff --git a/scene/game.lua b/scene/game.lua index 82fd2cc..c42079a 100644 --- a/scene/game.lua +++ b/scene/game.lua @@ -45,6 +45,8 @@ local buttonList = { local menuKey -- MENU key used to go main menu XD function GameScene:new(player_name, replay_file, replay_grade) + VCTRL[9].show = false + menuKey = BUTTON.new{ text = "MENU", x = 265, y = 0, w = 60, h = 25, @@ -130,7 +132,7 @@ end function GameScene:onInputPress(e) if e.type == "mouse" or (e.type == "touch" and not VCTRL.press(e.x, e.y, e.id)) then - BUTTON.press(buttonList, e.x, e.y, e.id) + if self.game.input_playback then BUTTON.press(buttonList, e.x, e.y, e.id) end menuKey:press(e.x, e.y, e.id) elseif (self.game.game_over or self.game.completed) and (e.input == "menu_decide" or e.input == "menu_back" or e.input == "rotate_right") and self.game.game_over_frames > 50 then SCENE = TitleScene() @@ -171,7 +173,7 @@ end function GameScene:onInputRelease(e) if e.type == "mouse" or (e.type == "touch" and not VCTRL.release(e.id)) then - BUTTON.release(buttonList, e.x, e.y, e.id) + if self.game.input_playback then BUTTON.release(buttonList, e.x, e.y, e.id) end menuKey:release(e.x, e.y, e.id) elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then self.inputs[e.input] = false diff --git a/scene/title.lua b/scene/title.lua index 3c2bebb..d8579fe 100644 --- a/scene/title.lua +++ b/scene/title.lua @@ -15,6 +15,8 @@ local main_menu_screens = { } function TitleScene:new() + VCTRL.clearAll() -- Reset the RESTART button state + VCTRL.new(SETTINGS.input.virtual) if SOUNDS['bgm_firsthalf']:isPlaying() or SOUNDS['bgm_secondhalf']:isPlaying() or not SETTINGS["music"] then love.audio.stop() end diff --git a/scene/training.lua b/scene/training.lua index ee77898..328331b 100644 --- a/scene/training.lua +++ b/scene/training.lua @@ -57,6 +57,8 @@ function TrainingScene:onInputPress(e) SCENE = TitleScene() elseif (e.input == "menu_back") then SCENE = TitleScene() + elseif e.input == "restart" or e.input == "menu_decide" then + SCENE = TrainingScene() elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then self.inputs[e.input] = true end diff --git a/settings.lua b/settings.lua index 795c273..1be3805 100644 --- a/settings.lua +++ b/settings.lua @@ -25,8 +25,7 @@ local _defaultSettings = { {type='button',x=640-145,y=355,key= 'rotate_left2',r=45,iconSize=60,alpha=0.4}, {type='button',x=640- 70,y=430,key= 'rotate_right',r=45,iconSize=60,alpha=0.4}, {type='button',x=640- 70,y=280,key='rotate_right2',r=45,iconSize=60,alpha=0.4}, - {type='button',x=320- 40,y=420,key= 'menu_decide',r=35,iconSize=60,alpha=0.4}, - {type='button',x=320+ 40,y=420,key= 'menu_back',r=35,iconSize=60,alpha=0.4}, + {type='button',x=320, y=420,key= 'restart',r=35,iconSize=60,alpha=0.4}, } }, tvMode = false -- 79338732