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 inventory selector UI does not display non-selectable items in some situations #42074

Merged
merged 1 commit into from
Jul 14, 2020
Merged

Fix inventory selector UI does not display non-selectable items in some situations #42074

merged 1 commit into from
Jul 14, 2020

Conversation

olanti-p
Copy link
Contributor

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() returns false, causing inventory_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, while inventory_column::activatable() checks whether there are any selectable entries in the column. So, the solution is to change the 1st to return true rather than falling back to calling the 2nd.

Testing

image
image
The multidrop menu (the one that requires the whole allows_selecting thing) also seems to be working

The first is a per-column setting, the second is whether the column has items that can be selected
@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones labels Jul 14, 2020
@kevingranade kevingranade merged commit 322725a into CleverRaven:master Jul 14, 2020
@olanti-p olanti-p deleted the fix-silent-item-denial branch September 20, 2020 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) Info / User Interface Game - player communication, menus, etc. Inventory / AIM / Zones Inventory, Advanced Inventory Management or Zones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]Chaos when try to modify gun
3 participants