Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue module version changes in change set #2821

Merged

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jul 1, 2019

Background

Originally, each row in the GUI mod list only allowed the user to install one version of the corresponding module: the most recent version compatible with the user's game version. Installing incompatible modules was completely impossible. Change sets could only handle installing the latest compatible version, because ModChange holds a reference to GUIMod, which represents all versions of a module rather than a particular version.

Later, #2364 added a double click option to compatible versions in the mod info version list to install older versions. To get around the version limitations of change sets, it prompted the user for confirmation and then jumped to the progress screen of the installation flow, skipping the change set confirmation and other early steps. In keeping with the previous total impossibility of installing incompatible modules, double clicking incompatible modules had no effect.

Motivation

Some users have expressed a preference for queuing module version changes along with normal installation/removal, so they can all be applied together. This makes sense (but is challenging to do).

In addition, the limitation to compatible versions is not particularly popular. Users would prefer to be allowed to install incompatible versions.

Changes

  • The double click installation is removed. See below for what replaces it.

  • ModChange now holds a reference to a CkanModule instead of a GUIMod, so you can queue up a specific version of a module in the change set rather than just the identifier abstractly or the latest compatible. Updating the calling code for this was trivial, and in most cases an improvement as a GUIMod object was being faked up unnecessarily.

  • GUIMod is no longer implicitly convertible to CkanModule, because there are multiple possible choices and you should think about which one you're using.

  • GUIMod now has a public SelectedMod property that tracks which version the user wants to install and helps to drive the change set logic. This must be stored somewhere outside the UI so we can display the right selection if you switch to another row and back.

  • GUIMod.GetRequestedChange is replaced by GUIMod.GetRequestedChanges, which can return multiple values to handle situations when we want to remove and install versions of the same mod. Conveniently this also simplifies how ComputeUserChangeSet collates the changes from multiple rows; instead of checking .HasValue and then selecting .Value, we simply use .SelectMany to join all the lists, which are allowed to be empty.

  • The Versions list now has checkboxes that represent the value of GUIMod.SelectedMod (and the column is 25px wider to compensate, not shown in old screenshot below):
    image
    These can be checked and unchecked to choose versions to install, and those choices will appear in the change set. Switching from an older version to the latest version triggers the existing functionality for Upgrading (and vice versa).

  • If you try to choose an incompatible module, a very scary confirmation warning appears:
    image
    German translation:

    {0} wird von Ihrer aktuellen Spielversion nicht unterstützt und funktioniert möglicherweise überhaupt nicht. Wenn Sie Probleme damit haben, sollten Sie die Betreuer NICHT um Hilfe bitten.

    Möchten Sie es wirklich installieren?

    If you click Install, it will allow you to install whatever:
    image
    Hopefully nobody will complain to mod authors if they break their install with this.
    And hopefully users will still report inaccurate metadata rather than bypassing it and forgetting about it.

  • The change set can now show removal of one version of a module and installation of another version, for example:
    image

Fixes #2714. Fixes #2715. Fixes #2822.

Companion fixes

  • Upgrading modules now prints more messages, in the style of installation (also affects CmdLine and ConsoleUI):
    image
  • The installation progress bar now counts up to 60% while mods are being installed, because 70%-100% are for post-install bookkeeping. The jump back from 100% to 70% looked weird.
  • The install-all checkbox (in the header of the Install column) now re-checks itself whenever your change set becomes empty, for convenience after you use it to uninstall everything.
  • InstallModuleDriver now clears ChangeSet instead of changeSet at the end, see GUI uses nearly the same name for four different change set variables #2276 (comment).

@HebaruSan HebaruSan added Enhancement GUI Issues affecting the interactive GUI Core (ckan.dll) Issues affecting the core part of CKAN Pull request labels Jul 1, 2019
@Olympic1
Copy link
Member

Olympic1 commented Jul 6, 2019

Needs a rebase

Copy link
Member

@Olympic1 Olympic1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine for me.

As far as my German goes, it looks good.

@DasSkelett
Copy link
Member

Yes, German is fine!

@HebaruSan HebaruSan force-pushed the feature/gui-version-checkboxes branch from e43a43b to f1fb60e Compare July 6, 2019 16:19
@HebaruSan
Copy link
Member Author

Rebase completed.

@HebaruSan HebaruSan merged commit f1fb60e into KSP-CKAN:master Jul 6, 2019
@HebaruSan HebaruSan deleted the feature/gui-version-checkboxes branch July 6, 2019 16:37
@Blu3wolf
Copy link

Blu3wolf commented Jul 6, 2019

Would this be the place to request a config option somewhere to disable the extra dialog window? Potentially somewhere hard to find, so as to not invalidate the whole point of adding a scary dialog window in the first place.

I'm all for decreasing nuisance reports to modders, they are at least 90% responsible for the loss of pjf. I'm also all for decreasing user RSI though, and adding extra clicks for operations (especially repetitive ones) is not the best way to achieve that.

@HebaruSan
Copy link
Member Author

Can you share some of your planned change sets that include enough incompatible modules to induce repetitive stress injuries?

@Blu3wolf
Copy link

Blu3wolf commented Jul 6, 2019

Certainly. I'll do so around Tuesday I expect, as I'm away from the computer until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Enhancement GUI Issues affecting the interactive GUI i18n Issues regarding the internationalization of CKAN and PRs that need translating Pull request
Projects
None yet
4 participants