Multiple changes

- Fix softlock in Name entry
- Wrong page count in Replay scene
- Last key can't be ignored by other controllers
- Small B.T.S changes
This commit is contained in:
Nguyễn Quốc Hưng
2024-10-06 16:57:49 +07:00
parent 1f5a21fec4
commit c0089fc4a5
7 changed files with 93 additions and 57 deletions

View File

@@ -71,7 +71,7 @@ function ConfigScene:new(first_time)
secret_code_used = false
secret_code_input = {} -- When it matches 88663366 then we will automatically set the special keybind
self.menu_state = 1
if first_time then
self.first_time = true
@@ -84,15 +84,18 @@ function ConfigScene:update() end
function ConfigScene:render()
MainBackground()
love.graphics.setColor(0, 0, 0, 0.7)
love.graphics.rectangle("fill", 0, 0, 640, 480)
if secret_code_used then
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"..
"6 - Down 9 - Rotate right 2", 80, 350, 1000
"8 - Down 3 - Rotate right 0 - Back\n"..
"4 - Left 7 - Rotate left 2\n"..
"6 - Right 9 - Rotate right 2", 80, 350, 1000
)
else
drawText("TV mode is OFF now!", 80, 40, 1000)
@@ -132,7 +135,7 @@ 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))
elseif key:find("[0-9.]") == 1 then
elseif key:find("[0-9]") == 1 then
table.insert(secret_code_input, key)
else
secret_code_input = {} -- Reset
@@ -146,14 +149,14 @@ local function checkSecretCodeInput(key)
if current_code == "88663366" then --TVMODEON
-- Set keybind
SETTINGS.input.keys = {
["2"] = "up", ["kp2"] = "up",
["8"] = "down", ["kp8"] = "down",
["2"] = "up", ["kp8"] = "up",
["8"] = "down", ["kp2"] = "down",
["4"] = "left", ["kp4"] = "left",
["6"] = "right", ["kp6"] = "right",
["1"] = "rotate_left", ["kp1"] = "rotate_left",
["3"] = "rotate_right", ["kp3"] = "rotate_right",
["7"] = "rotate_left2", ["kp7"] = "rotate_left2",
["9"] = "rotate_right2", ["kp9"] = "rotate_right2",
["1"] = "rotate_left", ["kp7"] = "rotate_left",
["3"] = "rotate_right", ["kp9"] = "rotate_right",
["7"] = "rotate_left2", ["kp1"] = "rotate_left2",
["9"] = "rotate_right2", ["kp3"] = "rotate_right2",
["5"] = "menu_decide", ["kp5"] = "menu_decide",
["0"] = "menu_back", ["kp0"] = "menu_back",
}
@@ -161,7 +164,7 @@ local function checkSecretCodeInput(key)
SETTINGS.tvMode = true
secret_code_used = true
updateButtonList(SCENE)
elseif current_code == "........" then
elseif current_code == "11111111" then
SETTINGS.input.keys = {}
SETTINGS.tvMode = false
secret_code_used = true