Skip to content

Commit

Permalink
Restore conflict highlights in changeset (#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan authored Dec 14, 2023
1 parent a79f1c9 commit 0ffd613
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions GUI/Controls/ManageMods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private List<string> SortColumns
public event Action<List<ModChange>, Dictionary<GUIMod, string>> OnChangeSetChanged;
public event Action OnRegistryChanged;

public event Action<List<ModChange>> StartChangeSet;
public event Action<List<ModChange>, Dictionary<GUIMod, string>> StartChangeSet;
public event Action<IEnumerable<GUIMod>> LabelsAfterUpdate;

private List<ModChange> ChangeSet
Expand Down Expand Up @@ -523,7 +523,7 @@ private void MarkAllUpdatesToolButton_Click(object sender, EventArgs e)

private void ApplyToolButton_Click(object sender, EventArgs e)
{
StartChangeSet?.Invoke(currentChangeSet);
StartChangeSet?.Invoke(currentChangeSet, Conflicts);
}

public void MarkModForUpdate(string identifier, bool value)
Expand Down Expand Up @@ -1054,7 +1054,7 @@ private void reinstallToolStripMenuItem_Click(object sender, EventArgs e)
module.version)
?? module,
true)
});
}, null);
}
}

Expand Down Expand Up @@ -1672,8 +1672,8 @@ public bool AllowClose()

public void InstanceUpdated()
{
ChangeSet = null;
Conflicts = null;
ChangeSet = null;
}

[ForbidGUICalls]
Expand Down
9 changes: 6 additions & 3 deletions GUI/Main/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,8 @@ private void ManageMods_OnChangeSetChanged(List<ModChange> changeset, Dictionary
tabController.ShowTab("ChangesetTabPage", 1, false);
UpdateChangesDialog(
changeset,
conflicts.ToDictionary(item => item.Key.ToCkanModule(), item => item.Value));
conflicts.ToDictionary(item => item.Key.ToCkanModule(),
item => item.Value));
auditRecommendationsMenuItem.Enabled = false;
}
else
Expand Down Expand Up @@ -982,9 +983,11 @@ private void GameExit(GameInstance inst)
}

// This is used by Reinstall
private void ManageMods_StartChangeSet(List<ModChange> changeset)
private void ManageMods_StartChangeSet(List<ModChange> changeset, Dictionary<GUIMod, string> conflicts)
{
UpdateChangesDialog(changeset, null);
UpdateChangesDialog(changeset,
conflicts?.ToDictionary(item => item.Key.ToCkanModule(),
item => item.Value));
tabController.ShowTab("ChangesetTabPage", 1);
}

Expand Down

0 comments on commit 0ffd613

Please sign in to comment.