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

Pickup menu items are not displayed within their container #52947

Closed
wapcaplet opened this issue Nov 21, 2021 · 7 comments · Fixed by #53373
Closed

Pickup menu items are not displayed within their container #52947

wapcaplet opened this issue Nov 21, 2021 · 7 comments · Fixed by #53373
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. Items: Containers Things that hold other things

Comments

@wapcaplet
Copy link
Contributor

Describe the bug

When picking up items using g, items are often not displayed within or anywhere near their container.

Steps To Reproduce

  1. Find a pile of items
  2. Use g to select items you want to pick up

Expected behavior

Items in containers should be displayed just under the line for their container.

Screenshots

Spear strap with halberd - halberd is shown above the spear strap that contains it:

image

Two-way radio with light battery - battery is 4 lines above, under "glass jar":

image

Chemistry set with medium battery - battery is 4 lines below, under "glass jar":

image

Tailor's kit actually appears correctly, with thread listed under it:

image

Versions and configuration

  • OS: Linux
    • OS Version: Distributor ID: Pop; Description: Pop!_OS 20.04 LTS; Release: 20.04; Codename: focal;
  • Game Version: 0.F-3928-g47cbf6852d [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Bionic Professions [package_bionic_professions],
    Magiclysm [magiclysm],
    Generic Guns [generic_guns],
    Mythical Martial Arts [MMA],
    No Rail Stations [No_Rail_Stations],
    No Fungal Monsters [No_Fungi]
    ]

Additional context

No response

@wapcaplet wapcaplet added <Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. Items: Containers Things that hold other things labels Nov 21, 2021
@mqrause
Copy link
Contributor

mqrause commented Nov 21, 2021

This is likely the case for all inventory_selector menus, considering the pickup menu is mostly just a copy of the multidrop menu.

@Photoloss
Copy link
Contributor

This is likely the case for all inventory_selector menus, considering the pickup menu is mostly just a copy of the multidrop menu.

Also happens with "insert" on individual containers at the very least.

@dseguin
Copy link
Member

dseguin commented Nov 21, 2021

I noticed that the alphabetic compare includes all the item modifiers in the name (ex: "<color_c_light_green>|| </color>XL holster") when sorting.

See: inventory_column::prepare_paging

@andrei8l

This comment was marked as outdated.

andrei8l added a commit to andrei8l/Cataclysm-DDA that referenced this issue Nov 22, 2021
properly sort entries alphabetically
sort entries below their parents

fix CleverRaven#52947
@wapcaplet
Copy link
Contributor Author

wapcaplet commented Nov 22, 2021

The inventory keybinding "Toggle inventory view to show item categories" aka VIEW_CATEGORY_MODE (bound to semicolon ; by default in the inventory and drop screens) invokes inventory_selector::toggle_categorize_contained(), displaying items as an indented list within their containers.

This works because both the inventory and drop screens sort items into categories by default, and don't do nested indentation for containers. The new g pickup screen sorts items into location groups by default, and all items are indented based on their container depth, although they are not shown in their containers, but instead alphabetized by their name. Unlike its siblings, pressing ; on the g pickup screen does not do anything.

If the g pickup screen could support this ; toggle like the other inventory screens do, and switch between "items grouped by location" and "items nested in their containers", that would also fix this issue. But the current g pickup menu is a poor hybrid between both, and is not very usable.

Edit Maybe the bug is simply that the g screen should not be doing indentation, because the indentation implies a container.

@andrei8l

This comment was marked as outdated.

@mqrause
Copy link
Contributor

mqrause commented Nov 22, 2021

This works because both the inventory and drop screens sort items into categories by default, and don't do nested indentation for containers. The new g pickup screen sorts items into location groups by default, and all items are indented based on their container depth, although they are not shown in their containers, but instead alphabetized by their name. Unlike its siblings, pressing ; on the g pickup screen does not do anything.

Oh wow, didn't expect that different behavior simply from adding items from different sources. Then I guess other affected menus would be activate, Eat or Read, except they don't care about containers anyway.

Edit: Using andrei8l's approach to use order_by_parent and fix it for multiple top level containers seems like the way to go to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Info / User Interface Game - player communication, menus, etc. Items: Containers Things that hold other things
Projects
None yet
5 participants