CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.67k stars 4.18k forks source link

Spawn Menu. The game tries to display two description variants at the same time #77721

Open IdleSol opened 2 weeks ago

IdleSol commented 2 weeks ago

Describe the bug

Here's the video:

https://github.com/user-attachments/assets/2070cde7-0767-4cb4-b72a-a6eea67dcf80

And these are screenshots from the video: 1 2

These are two variations of the description for the shotgun: https://github.com/CleverRaven/Cataclysm-DDA/blob/66098b4c1a33db0b3e3c19fbfd9b6601edb8c1bc/data/json/items/gun/shot.json#L773-L784

Why does the game try to display them at the same time?

Clarification. To reproduce the bug, you need to close the window with the search bar.

Edited. Additional information. The naming option must be enabled: options - interface - naming options - show gun brand names = true

Chewing gum, does not depend on these options in any way. And it always tries to display several variants.

Attach save file

n/a

Steps to reproduce

n/a

Expected behavior

n/a

Screenshots

No response

Versions and configuration

cdda-windows-tiles-x64-2024-11-10-0444

cdda-windows-tiles-x64-2024-08-01-0043 - Not reproduced

Additional context

No response

IdleSol commented 1 week ago

The naming option must be enabled: options - interface - naming options - show gun brand names = true

Chewing gum, does not depend on these options in any way. And it always tries to display several variants.

db48x commented 1 week ago

It’s not trying to display multiple things at once. Not really. It’s just that in order to show the description of an item, it must first spawn the item. The code is a little bit naive and it spawns a new one every time the UI is updated. We’re deliberately not running at 60fps here, but we are doing it multiple times per second. Since spawning an item chooses a random variant, the description is not always the same each time we update the window. I’ve fixed a couple of other menus that did the same thing, but obviously not all of them.