aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload/Events/GameDebug.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-06-04 02:17:28 +0200
committer GitHub <noreply@github.com>2023-06-04 02:17:28 +0200
commit3236f51d700674aee6ee6572109ffb3d5fa5fed2 (patch)
treeb898150a8a45e7c0d814459e7f12f39429acefeb /game/src/Game/Autoload/Events/GameDebug.gd
parent73e29d02e48739aba5ca5db1b9575c67e795400f (diff)
parentb98166b28c47cccff731d30959b8250fb27ff408 (diff)
Merge pull request #130 from Spartan322/organize/godot-project
Diffstat (limited to 'game/src/Game/Autoload/Events/GameDebug.gd')
-rw-r--r--game/src/Game/Autoload/Events/GameDebug.gd21
1 files changed, 21 insertions, 0 deletions
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)