Skip to content

Commit

Permalink
Merge #2744 Combine recommendation and suggestion screens
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Apr 29, 2019
2 parents fb97d58 + f265dab commit 3c0e9ee
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 163 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- [GUI] Relabel Yes/No buttons for some questions (#2737 by: HebaruSan; reviewed: DasSkelett)
- [Netkan] Handle non-raw GitHub URLs for metanetkans and avc krefs (#2696 by: HebaruSan; reviewed: DasSkelett)
- [GUI] Ignore spaces and special chars in mod search (#2709 by: DasSkelett; reviewed: HebaruSan)
- [GUI] Combine recommendation and suggestion screens (#2744 by: HebaruSan; reviewed: DasSkelett)

## Bugfixes

Expand Down
25 changes: 21 additions & 4 deletions GUI/Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 8 additions & 14 deletions GUI/MainInstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,17 @@ private void InstallMods(object sender, DoWorkEventArgs e)
}
}

// Now work on satisifying dependencies.

var recommended = new Dictionary<CkanModule, List<string>>();
var suggested = new Dictionary<CkanModule, List<string>>();

foreach (var change in opts.Key)
// Prompt for recommendations and suggestions, if any
var recRows = getRecSugRows(
opts.Key.Where(ch => ch.ChangeType == GUIModChangeType.Install)
.Select(ch => ch.Mod.ToModule()),
registry, toInstall
);
if (recRows.Any())
{
if (change.ChangeType == GUIModChangeType.Install)
{
AddMod(change.Mod.ToModule().recommends, recommended, change.Mod.Identifier, registry, toInstall);
AddMod(change.Mod.ToModule().suggests, suggested, change.Mod.Identifier, registry, toInstall);
}
ShowRecSugDialog(recRows, toInstall);
}

ShowSelection(recommended, toInstall);
ShowSelection(suggested, toInstall, true);

tabController.HideTab("ChooseRecommendedModsTabPage");

if (installCanceled)
Expand Down
Loading

0 comments on commit 3c0e9ee

Please sign in to comment.