Add importing and exporting replays

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-05-29 00:09:48 +07:00
parent d7726c1854
commit 9679378b1b
7 changed files with 99 additions and 14 deletions

View File

@@ -70,7 +70,7 @@ function ConfigScene:new(first_time)
updateButtonList(self)
secret_code_used = false
secret_code_input = {} -- When it matches 79338732 then we will automatically set the special keybind
secret_code_input = {} -- When it matches 88663366 then we will automatically set the special keybind
self.menu_state = 1
if first_time then
@@ -88,10 +88,10 @@ function ConfigScene:render()
if SETTINGS.tvMode then
drawText("TV mode is ON now! Check keybind below", 80, 40, 1000)
drawText("Which controls do you want to configure?", 80, 70, 1000)
drawText(
"2 - Up 1 - Rotate left 5 - Confirm selection\n"..
"8 - Right 3 - Rotate right 0 - Back\n"..
"4 - Left 7 - Rotate left 2\n"..
drawText(
"2 - Up 1 - Rotate left 5 - Confirm selection\n"..
"8 - Right 3 - Rotate right 0 - Back\n"..
"4 - Left 7 - Rotate left 2\n"..
"6 - Down 9 - Rotate right 2", 80, 350, 1000
)
else
@@ -128,7 +128,7 @@ function ConfigScene:onInputMove(e)
end
---@param key string
local function checkSecretCodeInput(self, key)
local function checkSecretCodeInput(key)
if secret_code_used then return end
if key:sub(1, 2) == "kp" then
table.insert(secret_code_input, key:sub(3,3))
@@ -160,7 +160,7 @@ local function checkSecretCodeInput(self, key)
SETTINGS.firstTime = false
SETTINGS.tvMode = true
secret_code_used = true
updateButtonList(self)
updateButtonList(SCENE)
elseif current_code == "........" then
SETTINGS.input.keys = {}
SETTINGS.tvMode = false
@@ -183,7 +183,7 @@ function ConfigScene:onInputPress(e)
) then
SCENE = TitleScene()
end
checkSecretCodeInput(self, e.key or "")
checkSecretCodeInput(e.key or "")
end
function ConfigScene:onInputRelease(e)
if e.type == "touch" or e.type == "mouse" then