-
-
Notifications
You must be signed in to change notification settings - Fork 23.5k
Allow explicit values for StringName enum properties
#112310
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
base: master
Are you sure you want to change the base?
Conversation
|
Why were |
|
I think changing this existing code now would be messy unless there's a strong reason against it |
Because it is. It was only needed for language selector, so the implementation is rather hacky. If we want to support it "officially", it needs to be done properly. |
| <constant name="PROPERTY_HINT_ENUM" value="2" enum="PropertyHint"> | ||
| Hints that an [int] or [String] property is an enumerated value to pick in a list specified via a hint string. | ||
| The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. Whitespaces are [b]not[/b] removed from either end of a name. For integer properties, the first name in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending [code]:integer[/code] to the name, e.g. [code]"Zero,One,Three:3,Four,Six:6"[/code]. | ||
| Hints that an [int], [String], or [StringName] property is an enumerated value to pick in a list specified via a hint string. The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. Whitespaces are [b]not[/b] removed from either end of a name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Hints that an [int], [String], or [StringName] property is an enumerated value to pick in a list specified via a hint string. The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. Whitespaces are [b]not[/b] removed from either end of a name. | |
| Hints that an [int], [String], or [StringName] property is an enumerated value to pick in a list specified via a hint string. The hint string is a comma separated list of names such as [code]"Hello,Something,Else"[/code]. Whitespace is [b]not[/b] removed from either end of a name. |
While we're here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #112318 where this PR may be leaning towards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also fix this for the description of PROPERTY_HINT_FLAGS ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say yes
The problems:
StringNamewas not documented as a valid type forPROPERTY_HINT_ENUMorPROPERTY_HINT_ENUM_SUGGESTION, but it actually is.Stringenum properties:StringName, but I see no reason not to do it :PSo this PR basically adds missing documentations and adds the special hint string syntax processing for
StringName.I can't test the documentation in the editor as opening the class reference crashes editor recently.