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

Dictionary types - type enum is int in editor #96852

Closed
MarkoGrbec opened this issue Sep 11, 2024 · 1 comment · Fixed by #100512
Closed

Dictionary types - type enum is int in editor #96852

MarkoGrbec opened this issue Sep 11, 2024 · 1 comment · Fixed by #100512

Comments

@MarkoGrbec
Copy link

MarkoGrbec commented Sep 11, 2024

Tested versions

Reproducible: 4.4-Dev2

System information

Linux manjaro

Issue description

in editor it doesn't show enum key string but it does int instead

I thought it would show enum key string

when adding new key pairs it works fine but after that it shows int

image

Steps to reproduce

  1. create 2 codes as follows as a resource first one I have autoload 2. one
    and MP is node 2. one
class_name EntityObject extends Resource

@export var dict_transform_tool__results: Dictionary[Enums.Esprite, Variant] # it's Variant for now later it'll be Array[Enums.Esprite]
extends Node

@export var container: Array[EntityObject]
  1. than go to the node MP add key pairs (works fine till now)
  2. when added it shows number instead of .find_key(number)

Minimal reproduction project (MRP)

class_name EntityObject extends Resource

@export var dict_transform_tool__results: Dictionary[Enums.Esprite, Variant] # it's Variant for now later it'll be Array[Enums.Esprite]
extends Node

@export var container: Array[EntityObject]

Bugsquad edit: Fix code block formatting.

@dalexeev
Copy link
Member

This is point 4 from #78656 (review):

The inspector part can be improved in the future. Currently, keys are displayed as string representations, which is not very convenient for viewing and editing.

I think we could replace string representations with editors:

Before

After

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

Successfully merging a pull request may close this issue.

3 participants