Open JarLowrey opened 5 years ago
I am trying to export a dictionary of enum: float.
The C# specification says the underlying type of an enum can be any integral type other than char
(see https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/enums#182-enum-declarations). Even if you could, it's probably not a good idea because of precision loss.
In the editor my enum shows up as an int, instead of a string. [...] There is also no auto-complete available.
Without typing information the editor can't know that your values represent an enum. The editor receives a value of the underlying type, which means an integral type.
IntelliSense also can't know what is the type of the keys or the values of the Dictionary without the typing information, since you are using the non-generic Godot.Collections.Dictionary
the typing information is not available.
If you use the generic Godot.Collections.Dictionary<TKey, TValue>
the typing information is available and IntelliSense can help you when using the dictionary keys/values, this information needs to be passed to the editor but currently this is not supported.
For the typing information to be supported in the editor we'd need to implement type hints for dictionaries, there is already a proposal for this: godotengine/godot-proposals#56.
Godot version:
3.1.1
OS/device including version:
Win10
Issue description:
Feature request:
I am trying to export a dictionary of
enum: float
. In the editor my enum shows up as an int, instead of a string. This makes it difficult to use. There is also no auto-complete available. If possible these would be great features to have.Steps to reproduce:
Appears as the following in the editor
If you type the dictionary, it will correctly set the value as a float (otherwise initializing to 1 will cause it to be an int in the editor), but the enum is still not auto-translated to a string in the editor.
Using a C# dictionary causes the exported var to not show up at all in the editor.