Fix inventory selector UI does not display non-selectable items in some situations #42074
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.
Summary
SUMMARY: Bugfixes "Fix item selection menu for various actions would sometimes silently omit non-electable items rather than print the reason"
Purpose of change
Fixes #41010 which was a source of confusion in #41703, #40376 and #41926
When none of the entries in a column are selectable,
inventory_column::allows_selecting()
returnsfalse
, causinginventory_column::get_entries(...)
to return an empty vector instead of all those non-selectable entries.That caused
inventory_selector::toggle_categorize_contained()
to lose these entries.Describe the solution
It looks like
inventory_column::allows_selecting()
was intended as a per-column setting to differentiate real and decorative columns, whileinventory_column::activatable()
checks whether there are any selectable entries in the column. So, the solution is to change the 1st to returntrue
rather than falling back to calling the 2nd.Testing
The multidrop menu (the one that requires the whole
allows_selecting
thing) also seems to be working