aboutsummaryrefslogtreecommitdiff
path: root/game/src/Autoload/Events/GameDebug.gd
blob: 4e8931fb30b8469568c2d490dcd877429c62ae5b (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("openvic2/debug/enabled", value)
   print("Set debug mode to: ", value)

func is_debug_mode() -> bool:
   return ProjectSettings.get_setting("openvic2/debug/enabled", false)