Compare commits

..

No commits in common. "2cbfe36b58937d5e18b45aff2dcf2f7edb853c2d" and "2de090d4e1e12bb7d76e8a242571ce01a438331a" have entirely different histories.

3 changed files with 5 additions and 24 deletions

View file

@ -20,5 +20,5 @@ License: CC-BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/legalcode
Title: Basteibrücke morgen Title: Basteibrücke morgen
Copyright holder: Thomas Wolf Copyright holder: Thomas Wolf
-> Website: www.foto-tw.de -> Website: www.foto-tw.de
Upload URL: https://commons.wikimedia.org/wiki/File:Basteibr%C3%BCcke_morgens.jpg Upload URL: https://common.wikimedia.org/wiki/File:BBasteibrücke_morgens.jpg
License: CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode License: CC BY-SA 3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode

View file

View file

@ -90,8 +90,8 @@ func cleanup() -> void:
# Parses all arguments # Parses all arguments
func parse_cmdline() -> Dictionary: func parse_cmdline() -> Dictionary:
logger.verb("Parsing command line arguments") 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 args: Dictionary = { "shutdown": false, "load_presentation": false, "presentation_path": "", "logger_level": core_config.logger_level, "ui_scale": 1.0 }
var processed: Dictionary = { "presentation": false, "logger_level": false, "ui_scale": false, "allow_high_ui_scale": false } var processed: Dictionary = { "presentation": false, "logger_level": false, "ui_scale": false }
for arg in OS.get_cmdline_user_args(): for arg in OS.get_cmdline_user_args():
logger.diag(core.misc.stringify_variables("Parsing cmdline argument %arg%", { "arg": arg })) logger.diag(core.misc.stringify_variables("Parsing cmdline argument %arg%", { "arg": arg }))
@ -112,10 +112,7 @@ Usage (development setup): /path/to/godot.binary -d -v --path . ++ <further argu
Further arguments: Further arguments:
--logger-level=<DIAG|VERB|INFO|WARN|ERROR> Sets the logger level, defaults to DIAG in debug --logger-level=<DIAG|VERB|INFO|WARN|ERROR> Sets the logger level, defaults to DIAG in debug
                                              builds and INFO in release builds.                                               builds and INFO in release builds.
--allow-high-ui-scale Allows setting the ui scale above 5. --ui-scale=<float> Sets how large UI elements should be.
                                              Please note that higher --ui-scale values
                                              can cause freezes.
--ui-scale=<float> Sets how large ui elements should be.
                                              Does not affect presentations.                                               Does not affect presentations.
/path/to/presentation.pcar Path to the presentation Presencode should open. /path/to/presentation.pcar Path to the presentation Presencode should open.
                                              If not supplied, a user interface will appear.                                               If not supplied, a user interface will appear.
@ -156,24 +153,8 @@ Further arguments:
logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Must be a float above 1", { "arg": arg })) logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Must be a float above 1", { "arg": arg }))
continue 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' # Update 'args'
args["ui_scale"] = argf args["ui_scale"] = arg.replace("--ui-scale=", "").to_float()
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: else:
if arg.begins_with("--"): logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Option not recognized", { "arg": arg })) if arg.begins_with("--"): logger.error(core.misc.stringify_variables("Unable to parse argument %arg%: Option not recognized", { "arg": arg }))
else: else: