Skip to content

Commit

Permalink
Show dependencies of upgrading mods in change set
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 10, 2022
1 parent 04484a6 commit a45bfe6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit a45bfe6

Please sign in to comment.