1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Add argument parsing

This commit is contained in:
Elias Steurer 2023-09-01 14:33:23 +02:00
parent 1650c33a42
commit b4a3cb806a

View File

@ -2,6 +2,13 @@ extends Node3D
@onready var screen_play_wallpaper = $ScreenPlayGodotWallpaper @onready var screen_play_wallpaper = $ScreenPlayGodotWallpaper
var activeScreensList = []
var projectPath = ""
var appID = ""
var volume = 0.0
var fillmode = 0
var checkWallpaperVisible = false
func _ready(): func _ready():
# "C:\\Code\\cpp\\ScreenPlay\\ScreenPlay\\Content\\wallpaper_godot_fjord\\fjord.zip" # "C:\\Code\\cpp\\ScreenPlay\\ScreenPlay\\Content\\wallpaper_godot_fjord\\fjord.zip"
var path = "C:\\Code\\cpp\\ScreenPlay\\ScreenPlay\\Content\\wallpaper_godot_fjord\\fjord.zip" var path = "C:\\Code\\cpp\\ScreenPlay\\ScreenPlay\\Content\\wallpaper_godot_fjord\\fjord.zip"
@ -18,3 +25,30 @@ func _ready():
else: else:
print("Failed to load the PCK file.") print("Failed to load the PCK file.")
Engine.set_max_fps(24) Engine.set_max_fps(24)
func parse_args():
var args = OS.get_cmdline_args()
var i = 0
while i < args.size():
match args[i]:
"--ActiveScreensList":
i += 1
activeScreensList = args[i].split(",")
for idx in range(activeScreensList.size()):
activeScreensList[idx] = int(activeScreensList[idx])
"--ProjectPath":
i += 1
projectPath = args[i]
"--appID":
i += 1
appID = args[i]
"--volume":
i += 1
volume = float(args[i])
"--fillmode":
i += 1
fillmode = int(args[i])
"--CheckWallpaperVisible":
i += 1
checkWallpaperVisible = args[i].to_lower() == "true"
i += 1