aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/Autoload/Events/GameDebug.gd
blob: df7a23af6e5df98f1c16c4a193955a010b0e39b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)