Cataclysm-dda: "Consume item" window is reset if a filter was set

Created on 10 Jan 2020  路  11Comments  路  Source: CleverRaven/Cataclysm-DDA

Describe the bug

Normally, after you eat something, the "consume item" window will reopen and auto-select whatever you just ate if you had more of it. However, if you set a filter using /, the filter is reset and the first item in the list is auto-selected.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Get a bunch of comestibles
  2. Press E and then /, then enter something to narrow down the list
  3. Eat something and the window will reset

Expected behavior

The item you just ate should be auto-selected regardless of whether you set a filter. As for the filter, this is less clear since there are a lot of different UI windows with filters, and they are not consistent at all with how they handle this issue. I am tentatively thinking it should stay until the window is manually closed.

Versions and configuration

  • OS: MacOs

    • OS Version: Name: Mac OS X; Version: 10.14.6; Build: 18G2022;

  • Game Version: 0.D-11103-gbd3a2e3 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Additional context

There's another mildly annoying UI bug with this window, but I'll write up a separate report for that.

<Bug> Info / User Interface Items / Item Actions / Item Qualities Character / Player

Most helpful comment

I've found slightly different behaviour (latest build and recent experimentals) -- the menu seems to reset a lot more than expected, when the base menu (total amount of consumable items) contains items in multiple locations, whether filtered or not.

I haven't been able to exactly pin it down, but I think the issue occurs when the unfiltered menu source items are in more than one location, AND when the results are unfiltered, OR when the filter returns items in more than one location?

Example: spawned a page and a quarter of items in latest build. Some in inventory, some on floor below me. Eat any item in the list, the list resets to top item after consumption.

image

Filter down to a list that is less than a page, but items are in more than one location, list still resets to top item after consumption:

image

Filter down to a list that is only 3 items long, but items are in 2 locations (inventory and cupboard), list still resets after consumption:

image

Filter down to a list that only has items in one location, list does NOT reset after consumption (which is correct behaviour IMO):

image

Was able to replicate a smaller instance with just a few items but in two locations, the list reset to the top item in this case too:

image

All 11 comments

I've found that the consume item menu was helpful when driving because it would flash the screen when the vehicle would move. It helps me not crash into something while eating and driving, but it is indeed annoying when it flashes just holding down the enter key to eat a lot of food.

I also never saw the reason for why it took up so much of the screen, I feel like it could be nice to have it as a side menu like the examine menu instead.

I've found slightly different behaviour (latest build and recent experimentals) -- the menu seems to reset a lot more than expected, when the base menu (total amount of consumable items) contains items in multiple locations, whether filtered or not.

I haven't been able to exactly pin it down, but I think the issue occurs when the unfiltered menu source items are in more than one location, AND when the results are unfiltered, OR when the filter returns items in more than one location?

Example: spawned a page and a quarter of items in latest build. Some in inventory, some on floor below me. Eat any item in the list, the list resets to top item after consumption.

image

Filter down to a list that is less than a page, but items are in more than one location, list still resets to top item after consumption:

image

Filter down to a list that is only 3 items long, but items are in 2 locations (inventory and cupboard), list still resets after consumption:

image

Filter down to a list that only has items in one location, list does NOT reset after consumption (which is correct behaviour IMO):

image

Was able to replicate a smaller instance with just a few items but in two locations, the list reset to the top item in this case too:

image

It's not as simple as "selected list has items in multiple locations". In this example, which is filtered, but has multiple locations, the list DOES stay on the selected item after consumption:

image

I just messed with this a little myself. I had to get it down to exactly one purple heading in the menu myself for it to stop resetting, and the last offender was a worn canteen with 2/6 water in it.

Can confirm this as happening for me without filtering as in #38014.
Been trying to figure it out myself, but it seems like one of those problems.

@scorpion451 can you please elaborate and maybe post a screenshot? Specifically is it occurring when your E menu contains items in multiple locations and/or multiple states of edibility?

Occasionally I've been getting a "tried to duplicate item" message on eating, too. I'll grab the log next time in case it's relevant, and do some testing on eating.

@Funguss you may want to check if the fix for #37583 resolved the duplicate item issue, that one was fixed recently and sounds like what you're reporting.

The two bugs are most likely related to an underlying problem, as the source of the duplicate item debug message was triggered by the attempts to refresh the consume item menu.

and the last offender was a worn canteen with 2/6 water in it.

This. I experimented with it a bit and the problem seems to only happen if there's a container in the filtered list. This also explains https://github.com/CleverRaven/Cataclysm-DDA/issues/38014#issuecomment-586581886, since the consumables in the screenshot there are all contained.

38342 probably stems from the same cause then as it's happening with all containers. I just had a canteen of water disappear, was about to update that it wasn't to do with freshness after all but is simply to do with containers. I've tested further and it affects any container, empty or not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2birdie picture 2birdie  路  3Comments

Taberone picture Taberone  路  3Comments

tinukedaya picture tinukedaya  路  3Comments

Coolthulhu picture Coolthulhu  路  3Comments

Cyrano7 picture Cyrano7  路  3Comments