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

Documentation of hint_string format for PROPERTY_HINT_TYPE_STRING seems wrong #76407

Closed
lilizoey opened this issue Apr 24, 2023 · 1 comment · Fixed by #77734
Closed

Documentation of hint_string format for PROPERTY_HINT_TYPE_STRING seems wrong #76407

lilizoey opened this issue Apr 24, 2023 · 1 comment · Fixed by #77734

Comments

@lilizoey
Copy link

Godot version

4.0.2.stable

System information

Linux 5.10.167-2-MANJARO

Issue description

In the docs for PROPERTY_HINT_TYPE_STRING under PropertyHint it provides these example for what the hint_string should look like:

hint_string = "%s:" % [TYPE_INT] # Array of integers.
hint_string = "%s:%s:" % [TYPE_ARRAY, TYPE_REAL] # Two-dimensional array of floats.
hint_string = "%s/%s:Resource" % [TYPE_OBJECT, TYPE_OBJECT] # Array of resources.
hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, TYPE_OBJECT] # Two-dimensional array of resources.

From what i can tell though, the value that comes after the / shouldn't be a type, but a propertyhint. i.e the second and third ones should be:

hint_string = "%s/%s:Resource" % [TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Array of resources.
hint_string = "%s:%s/%s:Resource" % [TYPE_ARRAY, TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # Two-dimensional array of resources.

In addition the docs seem to imply that this PropertyHint is only used for specifying the type contained in the array, but it can do other things too. For instance it can be used to specify that the elements of the array are each strings that should be exported like multistrings.

I'm not entirely sure about everything that it can do, but it seems that it's under-documented as is.

Steps to reproduce

N/A

Minimal reproduction project

N/A

@dalexeev
Copy link
Member

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.

4 participants