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

Make current instance settings easier to find in ConsoleUI #3385

Merged
Merged
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
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