aboutsummaryrefslogtreecommitdiff
path: root/game/src/Autoload/Events/GameDebug.gd
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-04-29 00:40:18 +0200
committer GitHub <noreply@github.com>2023-04-29 00:40:18 +0200
commit05937359e8c53ee76dc3ce537dd70083a016f766 (patch)
tree899b97479f6a1aabbfe352747bea162ce5720193 /game/src/Autoload/Events/GameDebug.gd
parent10053cf259c55ee45803268a844edf1011d8a16b (diff)
parent5022ec800b096e9a85d6ef07ca4b652abb8625ee (diff)
Merge pull request #101 from OpenVic2Project/more-image-processing
Dynamic minimap + vertical map subdivision
Diffstat (limited to 'game/src/Autoload/Events/GameDebug.gd')
-rw-r--r--game/src/Autoload/Events/GameDebug.gd21
1 files changed, 21 insertions, 0 deletions
diff --git a/game/src/Autoload/Events/GameDebug.gd b/game/src/Autoload/Events/GameDebug.gd
new file mode 100644
index 0000000..4e8931f
--- /dev/null
+++ b/game/src/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("openvic2/debug/enabled", value)
+ print("Set debug mode to: ", value)
+
+func is_debug_mode() -> bool:
+ return ProjectSettings.get_setting("openvic2/debug/enabled", false)