aboutsummaryrefslogtreecommitdiff
path: root/client/system/cli.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-15 23:02:34 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-15 23:02:34 +0200
commite2f5f2e38a00fa4b0688440b5f0e560a552b162a (patch)
tree77fb192f03493a51085b93df8705d162f8c8d8e8 /client/system/cli.gd
parent75407e09386818624841d7a693f4038e7ae7f2d7 (diff)
downloadhurrycurry-e2f5f2e38a00fa4b0688440b5f0e560a552b162a.tar
hurrycurry-e2f5f2e38a00fa4b0688440b5f0e560a552b162a.tar.bz2
hurrycurry-e2f5f2e38a00fa4b0688440b5f0e560a552b162a.tar.zst
Camera recorder cli
Diffstat (limited to 'client/system/cli.gd')
-rw-r--r--client/system/cli.gd15
1 files changed, 10 insertions, 5 deletions
diff --git a/client/system/cli.gd b/client/system/cli.gd
index d503d536..befd9f10 100644
--- a/client/system/cli.gd
+++ b/client/system/cli.gd
@@ -33,6 +33,10 @@ static var OPTIONS := [
Option.new(null, "render-tiles", Mode.OPTION, "Render tiles from text file to images"),
Option.new(null, "render-resolution", Mode.OPTION, "Resolution for rendering items or tiles"),
Option.new(null, "render-output", Mode.OPTION, "Output directory for rendering items or tiles"),
+ Option.new(null, "record-camera", Mode.OPTION, "Record camera movement to file"),
+ Option.new(null, "replay-camera", Mode.OPTION, "Replay camera movement"),
+ Option.new(null, "timescale", Mode.OPTION, "Time scaling factor for replay playback and camera recorder"),
+ Option.new(null, "render-output", Mode.OPTION, "Output directory for rendering items or tiles"),
Option.new(null, "connect_address", Mode.POSITIONAL, "Connect to a server directly without menu interaction")
]
@@ -60,10 +64,11 @@ static func print_help():
line += " " + opt.help
print(line)
+static var args: Array
static func parse() -> bool:
- var args := OS.get_cmdline_user_args()
+ args = Array(OS.get_cmdline_user_args())
while not args.is_empty():
- var arg := args[0]
+ var arg = args[0]
args.remove_at(0)
if arg.begins_with("--"):
var long = arg.trim_prefix("--")
@@ -71,14 +76,14 @@ static func parse() -> bool:
if opt_index == -1:
push_error("unknown long option \"%s\"" % long)
return false
- if not _parse_opt(args, OPTIONS[opt_index]): return false
+ if not _parse_opt(OPTIONS[opt_index]): return false
elif arg.begins_with("-"):
for short in arg.trim_prefix("-"):
var opt_index = OPTIONS.find_custom(func(x): return x.short == short)
if opt_index == -1:
push_error("unknown short option \"%s\"" % short)
return false
- if not _parse_opt(args, OPTIONS[opt_index]): return false
+ if not _parse_opt(OPTIONS[opt_index]): return false
else:
var opt_index = OPTIONS.find_custom(func(x): return x.mode == Mode.POSITIONAL)
if opt_index == -1:
@@ -90,7 +95,7 @@ static func parse() -> bool:
print("Parsed options: ", opts)
return true
-static func _parse_opt(args: Array[String], opt: Option) -> bool:
+static func _parse_opt(opt: Option) -> bool:
match opt.mode:
Mode.FLAG:
opts[opt.long] = true