diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-03-11 08:41:21 +0100 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-03-11 09:08:35 +0100 |
commit | 089f6a3784423b457b97eb214eb39c247b531574 (patch) | |
tree | f369928edec0259caebb906922032a895b74c748 | |
parent | 62bc0a0c2fc851a1e167b8d8da7c280f5e525921 (diff) |
Add debug mode
Fulfills requirement SS-56
-rw-r--r-- | game/project.godot | 1 | ||||
-rw-r--r-- | game/src/Autoload/GameDebug.gd | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/game/project.godot b/game/project.godot index ddeddb2..7975c0a 100644 --- a/game/project.godot +++ b/game/project.godot @@ -23,6 +23,7 @@ Resolution="*res://src/Autoload/Resolution.gd" MusicConductor="*res://src/MusicConductor/MusicConductor.tscn" SoundManager="*res://src/Autoload/SoundManager.gd" Keychain="*res://addons/keychain/Keychain.gd" +GameDebug="*res://src/Autoload/GameDebug.gd" [display] 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) |