Skip to content

Commit

Permalink
Merge #3385 Make current instance settings easier to find in ConsoleUI
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed May 27, 2021
2 parents 549bf98 + 6064ab5 commit 6d03765
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## v1.30.3

### Features

- [ConsoleUI] Make current instance settings easier to find in ConsoleUI (#3385 by: HebaruSan; reviewed: DasSkelett)

### Bugfixes

- [GUI] Invoke GUI update calls in SetupDefaultSearch() descendants (#3380 by: DasSkelett; reviewed: HebaruSan)
Expand Down
19 changes: 19 additions & 0 deletions ConsoleUI/ModListScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ public ModListScreen(GameInstanceManager mgr, bool dbg, ConsoleTheme regTheme)
"Save your mod list",
true, ExportInstalled),
null,
new ConsoleMenuOption("Game instance settings...", "",
"Configure the current game instance",
true, InstanceSettings),
new ConsoleMenuOption("Select game instance...", "",
"Switch to a different game instance",
true, SelectInstall),
Expand Down Expand Up @@ -480,6 +483,22 @@ private bool ScanForMods()
return true;
}

private bool InstanceSettings(ConsoleTheme theme)
{
var prevRepos = new SortedDictionary<string, Repository>(registry.Repositories);
var prevVerCrit = manager.CurrentInstance.VersionCriteria();
LaunchSubScreen(theme, new GameInstanceEditScreen(manager, manager.CurrentInstance));
if (!SortedDictionaryEquals(registry.Repositories, prevRepos)) {
// Repos changed, need to fetch them
UpdateRegistry(theme, false);
RefreshList(theme);
} else if (!manager.CurrentInstance.VersionCriteria().Equals(prevVerCrit)) {
// VersionCriteria changed, need to re-check what is compatible
RefreshList(theme);
}
return true;
}

private bool SelectInstall(ConsoleTheme theme)
{
GameInstance prevInst = manager.CurrentInstance;
Expand Down

0 comments on commit 6d03765

Please sign in to comment.