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

Show dependencies of upgrading mods in change set #3560

Merged
merged 1 commit into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions GUI/Controls/Changeset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ public void LoadChangeset(List<ModChange> changes, List<ModuleLabel> AlertLabels
ChangesListView.Items.Clear();
if (changes != null)
{
// We're going to split our change-set into two parts: updated/removed mods,
// and everything else (which right now is replacing and installing mods, but we may have
// We're going to split our change-set into two parts: removed mods,
// and everything else (right now, replacing, upgrading, and installing mods, but we may have
// other types in the future).

sortedChangeSet.Clear();
sortedChangeSet.AddRange(changes.Where(change => change.ChangeType == GUIModChangeType.Remove));
sortedChangeSet.AddRange(changes.Where(change => change.ChangeType == GUIModChangeType.Update));

// Now make our list more human-friendly (dependencies for a mod are listed directly
// after it.)
CreateSortedModList(changes
.Where(change => change.ChangeType != GUIModChangeType.Remove
&& change.ChangeType != GUIModChangeType.Update)
.Where(change => change.ChangeType != GUIModChangeType.Remove)
.ToList());

ChangesListView.Items.AddRange(sortedChangeSet
Expand Down
2 changes: 2 additions & 0 deletions GUI/Model/ModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ public IEnumerable<ModChange> ComputeChangeSetFromModList(
case GUIModChangeType.None:
break;
case GUIModChangeType.Update:
modules_to_install.Add((change as ModUpgrade)?.targetMod ?? change.Mod);
break;
case GUIModChangeType.Install:
modules_to_install.Add(change.Mod);
break;
Expand Down