From 089f6a3784423b457b97eb214eb39c247b531574 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sat, 11 Mar 2023 02:41:21 -0500 Subject: Add debug mode Fulfills requirement SS-56 --- game/src/Autoload/GameDebug.gd | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 game/src/Autoload/GameDebug.gd (limited to 'game/src/Autoload') diff --git a/game/src/Autoload/GameDebug.gd b/game/src/Autoload/GameDebug.gd new file mode 100644 index 0000000..6f10bf5 --- /dev/null +++ b/game/src/Autoload/GameDebug.gd @@ -0,0 +1,20 @@ +extends Node + +# REQUIREMENTS: +# * SS-56 +func _ready(): + for engine_args in OS.get_cmdline_args(): + match(engine_args): + "--game-debug": + set_debug_mode(true) + + for engine_args in OS.get_cmdline_user_args(): + match(engine_args): + "--game-debug", "-d", "--debug", "--debug-mode": + set_debug_mode(true) + +func set_debug_mode(value : bool) -> void: + ProjectSettings.set_setting("openvic2/debug/enabled", value) + +func is_debug_mode() -> bool: + return ProjectSettings.get_setting("openvic2/debug/enabled", false) -- cgit v1.2.3-56-ga3b1