Don't auto-install recommendations when auditing recommendations #2606
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 use the File ⇒ Audit recommendations option from #2577 to select one or more mods to install, those mods' recommendations will also be installed regardless of whether you selected them.
Cause
RelationshipResolver
takes aRelationshipResolverOptions
parameter that specifies what to do with recommendations and suggestions, among other things. Since it can be inconvenient to set 7 boolean member variables individually, aRelationshipResolver.DefaultOpts()
function returns a default set of options.This
DefaultOpts()
object was used for Audit recommendations. Unfortunately that object setswith_recommends
to true, so this causes all recommendations of the specified mods to be treated as hard dependencies, which doesn't make sense to do in GUI. It's kind of awkward to have a "default" object that you never want to use as-is.Changes
Now
DefaultOpts
has a companion function calledDependsOnlyOpts
, which doesn't pull in recommendations. This is now used in five places which previously had this behavior, including normal installation and the Audit recommendations flow.Also, the Audit recommendations menu item is now disabled if you have a change set. This is to prevent confusion about what should happen in such situations.
Fixes #2604.