From b0c1db0aba88da6d34a4133fe3aa021eeabedcda Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Fri, 10 May 2024 20:07:41 +0200 Subject: [PATCH] Remove --ui-scale and --allow-high-ui-scale args --- project.godot | 2 +- src/loader.gd | 40 ++-------------------------------------- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/project.godot b/project.godot index be2b6dc..449e60a 100644 --- a/project.godot +++ b/project.godot @@ -32,7 +32,7 @@ export/convert_text_resources_to_binary=false [editor_plugins] -enabled=PackedStringArray() +enabled=PackedStringArray("res://addons/SUI/plugin.cfg") [filesystem] diff --git a/src/loader.gd b/src/loader.gd index 8c7f43c..8627ace 100644 --- a/src/loader.gd +++ b/src/loader.gd @@ -72,7 +72,6 @@ along with this program. If not, see .""") var userinterface: NinePatchRect = load("res://scenesrc/UserInterface.tscn").instantiate() userinterface.name = "UserInterface" userinterface.core_config = core_config.duplicate() - userinterface.ui_scale = args["ui_scale"] get_tree().root.add_child.call_deferred(userinterface) # Perform cleanup @@ -90,8 +89,8 @@ func cleanup() -> void: # Parses all arguments func parse_cmdline() -> Dictionary: logger.verb("Parsing command line arguments") - var args: Dictionary = { "shutdown": false, "load_presentation": false, "presentation_path": "", "logger_level": core_config.logger_level, "ui_scale": 1.0, "allow_high_ui_scale": false } - var processed: Dictionary = { "presentation": false, "logger_level": false, "ui_scale": false, "allow_high_ui_scale": false } + var args: Dictionary = { "shutdown": false, "load_presentation": false, "presentation_path": "", "logger_level": core_config.logger_level } + var processed: Dictionary = { "presentation": false, "logger_level": false } for arg in OS.get_cmdline_user_args(): logger.diag(core.misc.stringify_variables("Parsing cmdline argument %arg%", { "arg": arg })) @@ -112,11 +111,6 @@ Usage (development setup): /path/to/godot.binary -d -v --path . ++ Sets the logger level, defaults to DIAG in debug                                               builds and INFO in release builds. ---allow-high-ui-scale Allows setting the ui scale above 5. -                                              Please note that higher --ui-scale values -                                              can cause freezes. ---ui-scale= Sets how large ui elements should be. -                                              Does not affect presentations. /path/to/presentation.pcar Path to the presentation Presencode should open.                                               If not supplied, a user interface will appear. +++ PRESENCODE HELP +++""") @@ -144,36 +138,6 @@ Further arguments: "WARN": args["logger_level"] = CoreTypes.LoggerLevel.WARN "ERROR": args["logger_level"] = CoreTypes.LoggerLevel.ERROR _: logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Can't match logger level %got%, possible are: %expected%", { "arg": arg, "got": arg.replace("--logger-level=", ""), "expected": [ "DIAG", "VERB", "INFO", "WARN", "ERROR" ] })) - elif arg.contains("--ui-scale="): - # Ensure this argument is not overridden - if processed["ui_scale"]: - logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Already set", { "arg": arg })) - continue - processed["ui_scale"] = true - - # Run checks - if !arg.replace("--ui-scale=", "").is_valid_float() or arg.replace("--ui-scale=", "").to_float() < 1.0: - logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Must be a float above 1", { "arg": arg })) - continue - - var argf: float = arg.replace("--ui-scale=", "").to_float() - - # Check if allowed - if argf > 5.0 and !args["allow_high_ui_scale"]: - logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: High ui scale values (> 5) are not allowed.\nPlease pass --allow-high-ui-scale before --ui-scale= to Presencode if you want high ui scale values.", { "arg": arg })) - continue - - # Update 'args' - args["ui_scale"] = argf - elif arg.contains("--allow-high-ui-scale"): - # Ensure this argument is not overridden - if processed["allow_high_ui_scale"]: - logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Already set", { "arg": arg })) - continue - processed["allow_high_ui_scale"] = true - - # Update 'args' - args["allow_high_ui_scale"] = true else: if arg.begins_with("--"): logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Option not recognized", { "arg": arg })) else: