Added new menu to start at ASCENSION N when in test_mode.
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
41
inc/window/window.ascend_debug.lua
Normal file
41
inc/window/window.ascend_debug.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
--- @section AscendDebugWindow
|
||||
local _level = 0
|
||||
|
||||
--- Initialises the ASCEND debug start window.
|
||||
--- @within AscendDebugWindow
|
||||
function AscendDebugWindow.init()
|
||||
_level = 0
|
||||
end
|
||||
|
||||
--- Draws the ASCEND debug start window.
|
||||
--- @within AscendDebugWindow
|
||||
function AscendDebugWindow.draw()
|
||||
UI.draw_top_bar("ASCEND Debug Start")
|
||||
|
||||
local cx = Config.screen.width / 2
|
||||
local cy = Config.screen.height / 2
|
||||
|
||||
local left_arrow = _level > 0 and "<- " or " "
|
||||
local right_arrow = _level < Ascension.get_max_level() and " ->" or " "
|
||||
local label = left_arrow .. "Start at: " .. _level .. right_arrow
|
||||
Print.text_center(label, cx, cy - 4, Config.colors.white, false, 1)
|
||||
|
||||
Print.text_center("Z/select: start X/back: menu", cx, Config.screen.height - 10, Config.colors.dark_grey, false, 1)
|
||||
end
|
||||
|
||||
--- Updates the ASCEND debug start window logic.
|
||||
--- @within AscendDebugWindow
|
||||
function AscendDebugWindow.update()
|
||||
if Input.left() then
|
||||
_level = math.max(0, _level - 1)
|
||||
elseif Input.right() then
|
||||
_level = math.min(Ascension.get_max_level(), _level + 1)
|
||||
elseif Input.select() then
|
||||
Audio.sfx_select()
|
||||
Context.new_game_debug(_level)
|
||||
GameWindow.set_state("game")
|
||||
elseif Input.back() then
|
||||
Audio.sfx_deselect()
|
||||
GameWindow.set_state("menu")
|
||||
end
|
||||
end
|
||||
@@ -161,6 +161,13 @@ function MenuWindow.ddr_test()
|
||||
MinigameDDRWindow.start("menu", "generated", { special_mode = "only_nothing" })
|
||||
end
|
||||
|
||||
--- Opens the ASCEND debug start window.
|
||||
--- @within MenuWindow
|
||||
function MenuWindow.ascend_debug()
|
||||
AscendDebugWindow.init()
|
||||
GameWindow.set_state("ascend_debug")
|
||||
end
|
||||
|
||||
--- Refreshes the list of menu items based on current game state.
|
||||
--- @within MenuWindow
|
||||
function MenuWindow.refresh_menu_items()
|
||||
@@ -178,6 +185,7 @@ function MenuWindow.refresh_menu_items()
|
||||
table.insert(_menu_items, {label = "Audio Test", decision = MenuWindow.audio_test})
|
||||
table.insert(_menu_items, {label = "To Be Continued...", decision = MenuWindow.continued})
|
||||
table.insert(_menu_items, {label = "DDR Test", decision = MenuWindow.ddr_test})
|
||||
table.insert(_menu_items, {label = "Start at ASCEND N", decision = MenuWindow.ascend_debug})
|
||||
end
|
||||
|
||||
table.insert(_menu_items, {label = "Exit", decision = MenuWindow.exit})
|
||||
|
||||
@@ -22,6 +22,9 @@ Window.register("controls", ControlsWindow)
|
||||
AudioTestWindow = {}
|
||||
Window.register("audiotest", AudioTestWindow)
|
||||
|
||||
AscendDebugWindow = {}
|
||||
Window.register("ascend_debug", AscendDebugWindow)
|
||||
|
||||
MinigameButtonMashWindow = {}
|
||||
Window.register("minigame_button_mash", MinigameButtonMashWindow)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user