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 6, 2022
1 parent 04484a6 commit 1e5d903
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions GUI/Controls/Changeset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ public void LoadChangeset(List<ModChange> changes, List<ModuleLabel> AlertLabels

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 1e5d903

Please sign in to comment.