Skip to content

Export enum property with custom int discriminants #764

Open
@clarfonthey

Description

@clarfonthey

Basically, this simple gdscript example can't quite be replicated:

enum Dir { Top = -1, Bottom = 1 }
export(Dir) var dir = Bottom

Since, when defining IntHint::Enum, you just provide an ordered list of strings, and there's no way to map strings to values. You can still get the result in code with custom setters, but I have a feeling that there's a more direct way to do this by changing the IntHint struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: coreComponent: core (mod core_types, object, log, init, ...)featureAdds functionality to the library

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions