Update touch control

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-29 00:26:05 +07:00
parent 9679378b1b
commit c14c702d17
3 changed files with 23 additions and 4 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -32,7 +32,7 @@ local _defaultSettings = {
}
SETTINGS = setmetatable(
{},
{__default__ = _defaultSettings},
{
__index = function(_, k)
if _settings[k] == nil then