2019-05-22 22:57:34 -05:00
|
|
|
local ConfigScene = Scene:extend()
|
|
|
|
|
2021-10-21 19:52:42 -05:00
|
|
|
ConfigScene.title = "Input Config"
|
2019-05-22 22:57:34 -05:00
|
|
|
|
2021-02-25 13:41:13 -06:00
|
|
|
local menu_screens = {
|
|
|
|
KeyConfigScene,
|
|
|
|
StickConfigScene
|
2019-05-22 22:57:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function ConfigScene:new()
|
2021-02-25 13:41:13 -06:00
|
|
|
self.menu_state = 1
|
|
|
|
DiscordRPC:update({
|
2021-09-25 18:51:43 -05:00
|
|
|
details = "In settings",
|
2021-02-25 13:41:13 -06:00
|
|
|
state = "Changing input config",
|
2021-09-25 23:02:35 -05:00
|
|
|
largeImageKey = "settings-input"
|
2021-02-25 13:41:13 -06:00
|
|
|
})
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
2021-02-25 13:41:13 -06:00
|
|
|
function ConfigScene:update() end
|
2019-05-22 22:57:34 -05:00
|
|
|
|
|
|
|
function ConfigScene:render()
|
2021-02-25 13:41:13 -06:00
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
2023-07-16 00:49:26 -05:00
|
|
|
drawBackground("options_input")
|
2020-10-09 17:43:22 -05:00
|
|
|
|
2021-02-25 13:41:13 -06:00
|
|
|
love.graphics.setFont(font_3x5_4)
|
2021-10-21 19:52:42 -05:00
|
|
|
love.graphics.print("INPUT CONFIG", 80, 40)
|
2021-02-25 13:41:13 -06:00
|
|
|
|
|
|
|
love.graphics.setFont(font_3x5_2)
|
2021-05-20 22:25:24 -05:00
|
|
|
love.graphics.print("Which controls do you want to configure?", 80, 90)
|
2021-02-25 13:41:13 -06:00
|
|
|
|
|
|
|
love.graphics.setColor(1, 1, 1, 0.5)
|
|
|
|
love.graphics.rectangle("fill", 75, 118 + 50 * self.menu_state, 200, 33)
|
2020-12-01 10:57:09 -06:00
|
|
|
|
2021-02-25 13:41:13 -06:00
|
|
|
love.graphics.setFont(font_3x5_3)
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
for i, screen in pairs(menu_screens) do
|
|
|
|
love.graphics.printf(screen.title, 80, 120 + 50 * i, 200, "left")
|
|
|
|
end
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
2021-02-25 13:41:13 -06:00
|
|
|
function ConfigScene:changeOption(rel)
|
|
|
|
local len = table.getn(menu_screens)
|
|
|
|
self.menu_state = (self.menu_state + len + rel - 1) % len + 1
|
2020-11-08 14:55:06 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
function ConfigScene:onInputPress(e)
|
2021-10-21 19:52:42 -05:00
|
|
|
if e.input == "menu_decide" or e.scancode == "return" then
|
2021-02-25 13:41:13 -06:00
|
|
|
playSE("main_decide")
|
|
|
|
scene = menu_screens[self.menu_state]()
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif e.input == "up" or e.scancode == "up" then
|
2021-02-25 13:41:13 -06:00
|
|
|
self:changeOption(-1)
|
|
|
|
playSE("cursor")
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif e.input == "down" or e.scancode == "down" then
|
2021-02-25 13:41:13 -06:00
|
|
|
self:changeOption(1)
|
|
|
|
playSE("cursor")
|
2021-10-21 19:52:42 -05:00
|
|
|
elseif config.input and (
|
|
|
|
e.input == "menu_back" or e.scancode == "backspace" or e.scancode == "delete"
|
|
|
|
) then
|
2021-02-25 13:41:13 -06:00
|
|
|
scene = SettingsScene()
|
2020-11-08 15:19:01 -06:00
|
|
|
end
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
2021-09-25 18:51:43 -05:00
|
|
|
return ConfigScene
|