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

Restore conflict highlights in changeset #3948

Merged
merged 1 commit into from
Dec 14, 2023
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: 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
Loading