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

Fix compatible popup messing with max game version column #3976

Conversation

HebaruSan
Copy link
Member

Problem

If you open the compatible game versions dialog and click accept (whether or not you make any changes), the values in the max game version column change in strange and hard to understand ways.

Cause

As of #3904, the max game versions column's behavior depends on the ordering of the global list of known game versions (e.g., in KerbalSpaceProgram.KnownVersions for KSP1), which it uses to find the latest real game version with which a mod is compatible. It's loaded in ascending order and is supposed to stay that way.

The compatible versions popup currently changes the sorting of this global list when it loads! So the next time you refresh the mod list, the versions are in descending order, so wrong versions are pulled out by the max game verison column.

Changes

  • Now the compatible versions dialog no longer re-sorts the main global singleton copy of the known game versions to suit its whims, which allows the max game version column to continue working correctly.
  • During development of this, I discovered that KerbalSpaceProgram.KnownVersions can be initialized several times due to parallel loading. Now it uses a lock to load only once.
  • A way for the column to say "any" is patched up to use the same real-version logic as it usually does.

Fixes #3973.

@HebaruSan HebaruSan added Bug GUI Issues affecting the interactive GUI labels Dec 24, 2023
@HebaruSan HebaruSan merged commit fd4180d into KSP-CKAN:master Dec 24, 2023
8 checks passed
@HebaruSan HebaruSan deleted the fix/compat-dialog-corrupting-game-ver-list branch December 24, 2023 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Max Game Version" column has some strange behavior
1 participant