diff --git a/game/gamemode.lua b/game/gamemode.lua index 0ae57b2..162d425 100644 --- a/game/gamemode.lua +++ b/game/gamemode.lua @@ -677,6 +677,7 @@ function GameMode:onPieceEnter() end function GameMode:onGameOver() + if not self.training then VCTRL.toggle(false) end if not self.input_playback and not self.training and not PENTO_MODE then if not self.did_grades then self.grade_score = self.grade_score + self.speed_level diff --git a/scene/touch_config.lua b/scene/touch_config.lua index 6ceb65b..3e65bb5 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -52,6 +52,24 @@ buttonList = { SCENE = TouchConfigPreviewScene() end }, + resetAll = BUTTON.new{ + text = "RESET\nALL", + x = 570, y = 80, w = 60, h = 40, + codeWhenReleased = function() + local selection = love.window.showMessageBox( + "Save config?", "Are you really sure about RESETTING ALL touchscreen configuration?", + {"Yes", "No", escapebutton = 2, enterbutton = 1}, + "info", true + ) + if selection == 1 then + VCTRL.focus = nil; focusingButton = nil + hasChanged = false + VCTRL.clearAll() + VCTRL.new(SETTINGS.__default__.input.virtual) + SETTINGS.input.virtual = SETTINGS.__default__.input.virtual + end + end + }, menuScreen = BUTTON.new{ text = "MENU", x = 570, y = 5, w = 60, h = 25, @@ -59,7 +77,7 @@ buttonList = { if hasChanged or SETTINGS.firstTime then local selection = love.window.showMessageBox( "Save config?", "Do you want to save your changes before exiting?", - {"Save", "Discard", "Keep editing", escapebutton = 2, enterbutton = 1}, + {"Save", "Discard", "Keep editing", escapebutton = 3, enterbutton = 1}, "info", true ) if selection == 1 then @@ -145,12 +163,12 @@ local function sliderList_update() end end -function TouchConfigScene:new(fromPreviewScene) +function TouchConfigScene:new() VCTRL.toggle(true) VCTRL.focus = nil focusingButton = nil - hasChanged = fromPreviewScene + Grid:new(10, 20) -- TODO end diff --git a/settings.lua b/settings.lua index 1be3805..25b7a61 100644 --- a/settings.lua +++ b/settings.lua @@ -32,7 +32,7 @@ local _defaultSettings = { } SETTINGS = setmetatable( - {}, + {__default__ = _defaultSettings}, { __index = function(_, k) if _settings[k] == nil then