packwiz / packwiz-installer

An installer for packwiz modpacks, with automatic auto-updating and optional mods! Works well with MultiMC and on servers.
https://packwiz.infra.link/
MIT License
46 stars 21 forks source link

Add option to automatically close after a user-supplied amount of time #42

Closed richteer closed 1 year ago

richteer commented 1 year ago

Addresses #27

Adds the -t/--timeout option, which takes in a number of seconds to wait before automatically closing if there is no update or user interactivity required. Not supplying the argument, or providing a negative number results in the current default behavior of waiting at the optional mods window. Supplying 0 is more or less the same as skipping the window entirely, though it would make more sense to use -g at this point.

The "Continue" button text will display the current time remaining before automatically "continuing".

The timeout value was added to the awaitOptionalButton interface largely in case the CLIHandler ever also includes some form of user-interactivity for selecting optional mods.


A few notes about this PR:

comp500 commented 1 year ago

Oops... ignore the CI failure, it's trying to publish a snapshot build despite not having the necessary credentials.

I wonder if it would make sense to use a timeout by default, or have a GUI option to configure it somewhere? I'm not sure where it would go though, a settings window would be outside the scope of this PR.

richteer commented 1 year ago

I wonder if it would make sense to use a timeout by default

It might, though I'm not sure if that would cause problems with automatically updating modpacks that a user may not have wanted.

I wonder if it would make sense to use a timeout by default, or have a GUI option to configure it somewhere?

Agreed out of scope for this PR, but that might smoothen my problems with unattended updates -- if it were GUI configurable, there could be an checkbox option to only use the timeout when there isn't an update. This would allow adjusting this setting without needing to edit (in my case) the PolyMC instance to change the pre-launch command.

A GUI configuration would need some kind of persistence though, perhaps there could be an optional config file that can also take the place of some of the bootstrap command arguments? (Something that, perhaps parodoxically, a pack could manage itself?)

e.g.

timeout = 5
updates-timeout = -1
pack-url = "https://example.com/fancy-pack/pack.toml"
bootstrap-no-update = true
antgly commented 1 year ago

Bumping this thread for greater visibility.