diff options
author | Spartan322 <Megacake1234@gmail.com> | 2023-06-13 08:00:57 +0200 |
---|---|---|
committer | Spartan322 <Megacake1234@gmail.com> | 2023-06-13 21:14:37 +0200 |
commit | cd7a5260d4d2791f98f284cf0bea905bda18cbe8 (patch) | |
tree | ffa32e8dda076f48c004f35834ff9af1e5ec0b9f /game/src/Game/Autoload/Events | |
parent | 6e26b948ea2a7632bcb7b795fe78f7169477eb6a (diff) |
Fix ArgumentParser excluding last character for arg key
Fix ArgumentParser ignoring full name boolean arguments
Add warning for ArgumentParser parsing a non-boolean standalone argument
Move SS-56 requirement to ArgumentParser scene
Add has_argument_support, get_argument, and set_argument to ArgumentParser
Update `GameDebug.gd` to rely on `ArgumentParser.get_argument`
Update `Events.gd` to rely on `ArgumentParser.get_argument`
Add shorthand alias argument non-alphabetic warning and skip
Add shorthand alias argument validation for boolean with warning and skip
Add shorthand alias missing warning
Add length check for full name arguments in ArgumentParser
Remove superfluous `-` in ArgumentParse scene aliases
Diffstat (limited to 'game/src/Game/Autoload/Events')
-rw-r--r-- | game/src/Game/Autoload/Events/GameDebug.gd | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/game/src/Game/Autoload/Events/GameDebug.gd b/game/src/Game/Autoload/Events/GameDebug.gd index df7a23a..20b6a67 100644 --- a/game/src/Game/Autoload/Events/GameDebug.gd +++ b/game/src/Game/Autoload/Events/GameDebug.gd @@ -1,21 +1,8 @@ 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) + ArgumentParser.set_argument(&"game-debug", value) print("Set debug mode to: ", value) func is_debug_mode() -> bool: - return ProjectSettings.get_setting("openvic/debug/enabled", false) + return ArgumentParser.get_argument(&"game-debug", false) |