Skip to content

Commit a37f929

Browse files
committed
Fix StringName not documented for enum hint
1 parent 0fdbf05 commit a37f929

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/classes/@GlobalScope.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,11 +2780,11 @@
27802780
Additionally, other keywords can be included: [code]"exp"[/code] for exponential range editing, [code]"radians_as_degrees"[/code] for editing radian angles in degrees (the range values are also in degrees), [code]"degrees"[/code] to hint at an angle, [code]"prefer_slider"[/code] to show the slider for integers, and [code]"hide_control"[/code] to hide the slider or up-down arrows.
27812781
</constant>
27822782
<constant name="PROPERTY_HINT_ENUM" value="2" enum="PropertyHint">
2783-
Hints that an [int] or [String] property is an enumerated value to pick in a list specified via a hint string.
2783+
Hints that an [int], [String], or [StringName] property is an enumerated value to pick in a list specified via a hint string.
27842784
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].
27852785
</constant>
27862786
<constant name="PROPERTY_HINT_ENUM_SUGGESTION" value="3" enum="PropertyHint">
2787-
Hints that a [String] property can be an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code].
2787+
Hints that a [String] or [StringName] property can be an enumerated value to pick in a list specified via a hint string such as [code]"Hello,Something,Else"[/code]. See [constant PROPERTY_HINT_ENUM] for details.
27882788
Unlike [constant PROPERTY_HINT_ENUM], a property with this hint still accepts arbitrary values and can be empty. The list of values serves to suggest possible values.
27892789
</constant>
27902790
<constant name="PROPERTY_HINT_EXP_EASING" value="4" enum="PropertyHint">

editor/inspector/editor_properties.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,6 +3859,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
38593859
Vector<String> options;
38603860
Vector<String> option_names;
38613861
if (p_hint_text.begins_with(";")) {
3862+
// This is not supported officially. Only for `interface/editor/editor_language`.
38623863
for (const String &option : p_hint_text.split(";", false)) {
38633864
options.append(option.get_slicec('/', 0));
38643865
option_names.append(option.get_slicec('/', 1));

0 commit comments

Comments
 (0)