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

Highlight incompatible mods recursively #3651

Merged
merged 1 commit into from
Aug 31, 2022

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 30, 2022

Problem

If you try to install RP-1 on KSP 1.12 without following the instructions (which call for marking KSP 1.11 compatible), you'll find you can't install it, and the reason is not apparent on the Relationships tab, which has increasingly become the place to investigate compatibility:

screenshot1

If you expand dependencies (or try to install the depending mod from the Versions tab), you can discover that RP-0 depends on SXTContinued, which depends on Firespitter, which is only compatible up to KSP 1.11:

screenshot2

Noted in KSP-CKAN/NetKAN#9306.

Cause

The relationships tab's red highlighting only indicates whether the mod itself is compatible, not including its dependencies. It doesn't load all relationships recursively, for performance reasons; instead, it only loads two generations, so it can show which nodes are expandable, and then more generations are loaded if the user expands a node. This structure means that it may not know whether a mod is indirectly incompatible until multiple layers have been expanded and the user finds the issue.

But another component does know all mods' recursive compatibility: the CompatibilitySorter from #2963.

Changes

  • Now the registry provides IdentifierCompatible to allow quick recursive compatibility checks via the CompatibilitySorter object
  • Now the relationships tab uses Registry.IdentifierCompatible to check compatibility instead of simple game version checks

This causes SXTContinued to be highlighted red even though it's individually compatible, and you can still expand it to see Firespitter:

image

image

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix GUI Issues affecting the interactive GUI Pull request Relationships Issues affecting depends, recommends, etc. labels Aug 30, 2022
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good QoL improvement!

@HebaruSan HebaruSan merged commit a1ffa56 into KSP-CKAN:master Aug 31, 2022
@HebaruSan HebaruSan deleted the fix/gui-recursive-compat branch August 31, 2022 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy This is easy to fix Enhancement New features or functionality GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants