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

[Bug] ConsoleUI should refresh mod list after changing compatible versions #3352

Closed
DasSkelett opened this issue Apr 23, 2021 · 5 comments · Fixed by #3353
Closed

[Bug] ConsoleUI should refresh mod list after changing compatible versions #3352

DasSkelett opened this issue Apr 23, 2021 · 5 comments · Fixed by #3353
Labels
Bug Something is not working as intended ConsoleUI Issues affecting the interactive console UI

Comments

@DasSkelett
Copy link
Member

Background

  • Operating System: macOS
  • CKAN Version: v1.30.0
  • KSP Version: 1.11.2

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
Yeah the person who encountered it did, but that's irrelevant.

Problem

Describe the bug
I've just spent some time helping a macOS+ConsoleUI user on the r/KerbalSpaceProgram Discord who wasn't able to find ClickThroughBlocker in the mod list, even after adding KSP 1.11 (and a whole bunch more) to the list of compatible versions.
Turns out, the mod list doesn't reload after you change compatible versions, thus changing compatible KSP versions "doesn't have an effect", only after pressing F5 or restarting KSP.

I was able to reproduce this.

Steps to reproduce

  • Be on KSP 1.11.2
  • Open Console UI
  • Remove all compatible KSP versions from one instance
  • Quit and reopen Console UI
  • Search for ClickThroughBlocker in the mod list, it won't show up
  • Go to the instance management screen again, and add KSP 1.11 as compatible version
  • F2, Enter the instance
  • Search for ClickThroughBlocker again, it still won't show up
  • Only after you restart the ConsoleUI again, or hit F5, or refresh via the F10 menu it'll show up

Expected behavior
It should show up directly when coming back to the mod list of the instance, i.e. the mod list should refresh automatically after changing compatible KSP versions (or active metadata repositories).
That's what a user would expect to happen, and that's what happens in the GUI as well.
At the very least we should show some sort of notice that refreshing the mod list manually is required to take the changes into effect.

@DasSkelett DasSkelett added Bug Something is not working as intended ConsoleUI Issues affecting the interactive console UI labels Apr 23, 2021
@HebaruSan
Copy link
Member

Looks like we need an else ... RefreshList here:

private bool SelectInstall(ConsoleTheme theme)
{
GameInstance prevInst = manager.CurrentInstance;
LaunchSubScreen(theme, new GameInstanceListScreen(manager));
// Abort if same instance as before
if (!prevInst.Equals(manager.CurrentInstance)) {
plan.Reset();
registry = RegistryManager.Instance(manager.CurrentInstance).registry;
RefreshList(theme);
}
return true;
}

@HebaruSan
Copy link
Member

I guess we can even clone manager.CurrentInstance.VersionCriteria() before the subscreen launch and then compare it afterwards to see if the compatibility changed.

@DasSkelett
Copy link
Member Author

I think we aren't refreshing after changing the metadata repos either, so we should compare that as well if we want to do it on-demand.

@HebaruSan
Copy link
Member

That one needs an UpdateRegistry call rather than just a refresh.

@HebaruSan
Copy link
Member

To no one's surprise, SortedDictionary.Equals is not implemented sensibly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended ConsoleUI Issues affecting the interactive console UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants