From cef940108fe15752c3ef66f43f5169403fa2f71d Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sat, 3 Jun 2023 14:37:10 -0400 Subject: Reorganize the file structure of the files in `game/src` --- game/src/Game/Autoload/Events/GameDebug.gd | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 game/src/Game/Autoload/Events/GameDebug.gd (limited to 'game/src/Game/Autoload/Events/GameDebug.gd') diff --git a/game/src/Game/Autoload/Events/GameDebug.gd b/game/src/Game/Autoload/Events/GameDebug.gd new file mode 100644 index 0000000..df7a23a --- /dev/null +++ b/game/src/Game/Autoload/Events/GameDebug.gd @@ -0,0 +1,21 @@ +extends RefCounted + +# REQUIREMENTS: +# * SS-56 +func _init(): + 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("openvic/debug/enabled", value) + print("Set debug mode to: ", value) + +func is_debug_mode() -> bool: + return ProjectSettings.get_setting("openvic/debug/enabled", false) -- cgit v1.2.3-56-ga3b1