aboutsummaryrefslogtreecommitdiff
path: root/game/src
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-03-11 21:47:09 +0100
committer GitHub <noreply@github.com>2023-03-11 21:47:09 +0100
commitdfd6d33a9bd1fda56589efa66a9ca0f63f5e46f8 (patch)
tree5930dde425090f5218dd5523962564fea6199878 /game/src
parent090c999ca4484eb845433464e18182fcd5bd862c (diff)
parent089f6a3784423b457b97eb214eb39c247b531574 (diff)
Merge pull request #60 from Spartan322/feature/debug-mode
Diffstat (limited to 'game/src')
-rw-r--r--game/src/Autoload/GameDebug.gd20
1 files changed, 20 insertions, 0 deletions
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)