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

Plainly exported strings default to type string hints in GDScript 2.0 #42022

Closed
willnationsdev opened this issue Sep 13, 2020 · 0 comments · Fixed by #47131
Closed

Plainly exported strings default to type string hints in GDScript 2.0 #42022

willnationsdev opened this issue Sep 13, 2020 · 0 comments · Fixed by #47131

Comments

@willnationsdev
Copy link
Contributor

willnationsdev commented Sep 13, 2020

Godot version:
4566db2

OS/device including version:
Windows 10 Home Edition

Issue description:
When attempting to export a string variable in GDScript, as one would have done in GDScript 1, rather than display a LineEdit, it displays a GUI in the Inspector that has you select an Object type to assign to the string value. This appears to be because the @export annotation hardcodes the property hint to be PROPERTY_HINT_TYPE_STRING when I really don't want any sort of type specification.

We can fix it by properly creating appropriate export annotations for each case, since it appears that we are creating dedicated export annotations for every used hint string and not bothering with any sort of export inference.

  1. @export which just exports things plainly and uses PROPERTY_HINT_NONE.
  2. @export_type_string(str) which does what @export currently does.

Steps to reproduce:

extends Resource
class_name MyData
@export
var name := "hello"

Then, create a new MyData in the Inspector to see the result.

Minimal reproduction project:
The steps are trivial enough that it isn't necessary.

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