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 'items' property is an array that stores a weirdly complex pattern of objects. #38511

Open
Skullfurious opened this issue May 6, 2020 · 2 comments

Comments

@Skullfurious
Copy link

Godot version:
3.2.stable.official

OS/device including version:
Windows 10 - 1909

Issue description:
If you want to reorder a PopupMenu's elements you need to modify an oddly complex array of objects manually. It seems strange that rather than being stored in a dictionary, these elements are just appended to the end of the array.

e.g.

[Open, [Object:null], 0, False, False, 0, 0, Null, , False,
Save, [Object:null], 0, False, False, 0, 0, Null, , False,
Save As, [Object:null], 0, False, False, 0, 0, Null, , False]

Steps to reproduce:
Access the .items property of a PopupMenu and you will see what I mean by the ordering being weirdly complex.

Minimal reproduction project:
N/A

Suggestion:

Perhaps document the items property and turn items into dictionaries that are stored in an array instead of appending each new item's properties onto the end of a single array.

@dominiks
Copy link
Contributor

dominiks commented Jun 7, 2020

I will write documentation for the items property and its usage as it is completely absent from the documentation.

But I agree that the content of items is weird and very cumbersome and it should be changed to a list of dictionaries or custom types.

Alternatively it could be removed as an accessible property to prevent confusion.

@dominiks
Copy link
Contributor

dominiks commented Jun 8, 2020

itemsis marked as PROPERTY_USAGE_INTERNAL so this issue is related #25651. Is there any decision on that matter?

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

No branches or pull requests

3 participants