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

PopupMenu ID 0 is replaced by its index position. #95847

Closed
Ketei opened this issue Aug 20, 2024 · 1 comment · Fixed by #95857
Closed

PopupMenu ID 0 is replaced by its index position. #95847

Ketei opened this issue Aug 20, 2024 · 1 comment · Fixed by #95857

Comments

@Ketei
Copy link

Ketei commented Aug 20, 2024

Tested versions

  • Reproducible in: v4.3.stable.official [77dcf97]

System information

Godot v4.3.stable - Windows 10.0.19045 - GLES3 (Compatibility)

Issue description

When using a PopupMenu (via MenuButton) and trying to use the assigned ID, if that ID is 0 it'll be replaced by the index.

GodotPopMenuBug.mp4

Steps to reproduce

  1. Create MenuButton.
  2. Create 2 or more items each with a unique ID.
  3. Move item with ID 0 to any index but 0.
  4. Connect id_pressed signal.
  5. That menu item ID 0 will be replaced by its index on the call.

Minimal reproduction project (MRP)

popupmenubug.zip

@kleonc
Copy link
Member

kleonc commented Aug 20, 2024

This is a regression from #88306. cc @KoBeWi

id = 0 is no longer force-saved within the scene file (same for e.g. OptionButton).

After saving a scene with:
Godot_v4 2 2-stable_win64_0XX8wcrDxR

.tscn contents:

...
popup/item_0/text = "ID 1"
popup/item_0/id = 1
popup/item_1/text = "ID 0"
popup/item_1/id = 0
popup/item_2/text = "ID 2"
popup/item_2/id = 2
...
...
popup/item_0/text = "ID 1"
popup/item_0/id = 1
popup/item_1/text = "ID 0"
popup/item_2/text = "ID 2"
popup/item_2/id = 2
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Unassessed
Development

Successfully merging a pull request may close this issue.

3 participants