test mode
This commit is contained in:
@@ -25,6 +25,7 @@ Context = {}
|
|||||||
function Context.initial_data()
|
function Context.initial_data()
|
||||||
return {
|
return {
|
||||||
current_menu_item = 1,
|
current_menu_item = 1,
|
||||||
|
test_mode = false,
|
||||||
popup = {
|
popup = {
|
||||||
show = false,
|
show = false,
|
||||||
content = {}
|
content = {}
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ function Input.left() return btnp(INPUT_KEY_LEFT) end
|
|||||||
--- Checks if Right is pressed.
|
--- Checks if Right is pressed.
|
||||||
--- @within Input
|
--- @within Input
|
||||||
function Input.right() return btnp(INPUT_KEY_RIGHT) end
|
function Input.right() return btnp(INPUT_KEY_RIGHT) end
|
||||||
|
--- Checks if Space is pressed.
|
||||||
|
--- @within Input
|
||||||
|
function Input.space() return keyp(INPUT_KEY_SPACE) end
|
||||||
|
|
||||||
--- Checks if Select is pressed.
|
--- Checks if Select is pressed.
|
||||||
--- @within Input
|
--- @within Input
|
||||||
function Input.select() return btnp(INPUT_KEY_A) or keyp(INPUT_KEY_SPACE) end
|
function Input.select() return btnp(INPUT_KEY_A) or keyp(INPUT_KEY_SPACE) end
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
--- @section TTGIntroWindow
|
--- @section TTGIntroWindow
|
||||||
TTGIntroWindow.timer = 180
|
TTGIntroWindow.timer = 180
|
||||||
TTGIntroWindow.glitch_started = false
|
TTGIntroWindow.glitch_started = false
|
||||||
|
TTGIntroWindow.space_count = 0
|
||||||
|
TTGIntroWindow.space_timer = 0
|
||||||
TTGIntroWindow.text = [[
|
TTGIntroWindow.text = [[
|
||||||
###### ###### ######
|
###### ###### ######
|
||||||
## ## #
|
## ## #
|
||||||
@@ -25,8 +27,19 @@ function TTGIntroWindow.update()
|
|||||||
TTGIntroWindow.glitch_started = true
|
TTGIntroWindow.glitch_started = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Count menu_back presses during the intro
|
||||||
|
if Input.menu_back() then
|
||||||
|
TTGIntroWindow.space_count = TTGIntroWindow.space_count + 1
|
||||||
|
end
|
||||||
|
|
||||||
TTGIntroWindow.timer = TTGIntroWindow.timer - 1
|
TTGIntroWindow.timer = TTGIntroWindow.timer - 1
|
||||||
if TTGIntroWindow.timer <= 0 or Input.select() or Input.menu_confirm() then
|
if TTGIntroWindow.timer <= 0 or Input.menu_confirm() then
|
||||||
|
-- Evaluate exactly 3 presses at the end of the intro
|
||||||
|
if TTGIntroWindow.space_count == 3 then
|
||||||
|
Context.test_mode = true
|
||||||
|
MenuWindow.refresh_menu_items()
|
||||||
|
Audio.sfx_success()
|
||||||
|
end
|
||||||
Glitch.hide()
|
Glitch.hide()
|
||||||
Window.set_current("intro_brief")
|
Window.set_current("intro_brief")
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ local _menu_items = {}
|
|||||||
--- Draws the menu window.
|
--- Draws the menu window.
|
||||||
--- @within MenuWindow
|
--- @within MenuWindow
|
||||||
function MenuWindow.draw()
|
function MenuWindow.draw()
|
||||||
UI.draw_top_bar("Definitely not an Impostor")
|
local title = "Definitely not an Impostor"
|
||||||
|
if Context.test_mode then
|
||||||
|
title = title .. " (TEST MODE)"
|
||||||
|
end
|
||||||
|
UI.draw_top_bar(title)
|
||||||
|
|
||||||
local menu_h = #_menu_items * 10
|
local menu_h = #_menu_items * 10
|
||||||
local y = 10 + (Config.screen.height - 10 - 10 - menu_h) / 2
|
local y = 10 + (Config.screen.height - 10 - 10 - menu_h) / 2
|
||||||
@@ -101,9 +105,13 @@ function MenuWindow.refresh_menu_items()
|
|||||||
table.insert(_menu_items, {label = "New Game", decision = MenuWindow.new_game})
|
table.insert(_menu_items, {label = "New Game", decision = MenuWindow.new_game})
|
||||||
table.insert(_menu_items, {label = "Load Game", decision = MenuWindow.load_game})
|
table.insert(_menu_items, {label = "Load Game", decision = MenuWindow.load_game})
|
||||||
table.insert(_menu_items, {label = "Configuration", decision = MenuWindow.configuration})
|
table.insert(_menu_items, {label = "Configuration", decision = MenuWindow.configuration})
|
||||||
table.insert(_menu_items, {label = "Audio Test", decision = MenuWindow.audio_test})
|
|
||||||
table.insert(_menu_items, {label = "To Be Continued...", decision = MenuWindow.continued})
|
if Context.test_mode then
|
||||||
table.insert(_menu_items, {label = "DDR Test", decision = MenuWindow.ddr_test})
|
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})
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(_menu_items, {label = "Exit", decision = MenuWindow.exit})
|
table.insert(_menu_items, {label = "Exit", decision = MenuWindow.exit})
|
||||||
|
|
||||||
Context.current_menu_item = 1
|
Context.current_menu_item = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user