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

export enum, or enum hint for int export #12392

Closed
djrm opened this issue Oct 25, 2017 · 4 comments
Closed

export enum, or enum hint for int export #12392

djrm opened this issue Oct 25, 2017 · 4 comments

Comments

@djrm
Copy link
Contributor

djrm commented Oct 25, 2017

Operating system or device, Godot version, GPU Model and driver (if graphics related):
godot 832a536

Issue description:

Now that godot has enums, it would be really useful to be able to export either enum variables or
a hint for exported ints, something like,

enum E {x, y, z}
export (int, E) var my_var

currently we have to do

enum E {x, y, z}
export (int, "x", "y", "z") var my_var  # error prone

Steps to reproduce:

Link to minimal example project:

@neikeq
Copy link
Contributor

neikeq commented Oct 25, 2017

I would say just export (E).

@Zylann
Copy link
Contributor

Zylann commented Oct 25, 2017

Related? #9308

@DevinPentecost
Copy link
Contributor

Zylann,

That topic is pretty similar, however it doesn't land on a standardization for the enum export format. One of the proposals is to define the enum within the export, but that leaves the enum unusable for any other modules.
I'd agree that

enum E {x, y, z}
export(E) var myE

Is a much cleaner format. It removes the value of the enum to have to type in string hints for exports using that enum.

Thanks

@Zylann
Copy link
Contributor

Zylann commented Oct 30, 2017

@DevinPentecost yeah, just linking in case we can close it later

bojidar-bg added a commit to bojidar-bg/godot that referenced this issue Nov 17, 2017
@akien-mga akien-mga added this to the 3.0 milestone Nov 20, 2017
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

6 participants