Highlight incompatible mods recursively #3651
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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:
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
IdentifierCompatible
to allow quick recursive compatibility checks via theCompatibilitySorter
objectRegistry.IdentifierCompatible
to check compatibility instead of simple game version checksThis causes SXTContinued to be highlighted red even though it's individually compatible, and you can still expand it to see Firespitter: