mirror of
https://github.com/godotengine/godot.git
synced 2025-02-18 16:50:48 +00:00
Merge pull request #72708 from KoBeWi/PackedMultilineStringArray
Fix @export_multiline for PackedStringArray
This commit is contained in:
commit
de4369ca4b
@ -4593,7 +4593,7 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_
|
|||||||
} break;
|
} break;
|
||||||
case Variant::PACKED_STRING_ARRAY: {
|
case Variant::PACKED_STRING_ARRAY: {
|
||||||
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
EditorPropertyArray *editor = memnew(EditorPropertyArray);
|
||||||
editor->setup(Variant::PACKED_STRING_ARRAY);
|
editor->setup(Variant::PACKED_STRING_ARRAY, p_hint_text);
|
||||||
return editor;
|
return editor;
|
||||||
} break;
|
} break;
|
||||||
case Variant::PACKED_VECTOR2_ARRAY: {
|
case Variant::PACKED_VECTOR2_ARRAY: {
|
||||||
|
@ -574,7 +574,7 @@ void EditorPropertyArray::setup(Variant::Type p_array_type, const String &p_hint
|
|||||||
|
|
||||||
// The format of p_hint_string is:
|
// The format of p_hint_string is:
|
||||||
// subType/subTypeHint:nextSubtype ... etc.
|
// subType/subTypeHint:nextSubtype ... etc.
|
||||||
if (array_type == Variant::ARRAY && !p_hint_string.is_empty()) {
|
if (!p_hint_string.is_empty()) {
|
||||||
int hint_subtype_separator = p_hint_string.find(":");
|
int hint_subtype_separator = p_hint_string.find(":");
|
||||||
if (hint_subtype_separator >= 0) {
|
if (hint_subtype_separator >= 0) {
|
||||||
String subtype_string = p_hint_string.substr(0, hint_subtype_separator);
|
String subtype_string = p_hint_string.substr(0, hint_subtype_separator);
|
||||||
|
@ -3696,6 +3696,13 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
|
|||||||
} else if (export_type.builtin_type == Variant::DICTIONARY) {
|
} else if (export_type.builtin_type == Variant::DICTIONARY) {
|
||||||
variable->export_info.type = Variant::DICTIONARY;
|
variable->export_info.type = Variant::DICTIONARY;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (export_type.builtin_type == Variant::PACKED_STRING_ARRAY) {
|
||||||
|
String hint_prefix = itos(Variant::STRING) + "/" + itos(variable->export_info.hint);
|
||||||
|
variable->export_info.hint = PROPERTY_HINT_TYPE_STRING;
|
||||||
|
variable->export_info.hint_string = hint_prefix + ":" + variable->export_info.hint_string;
|
||||||
|
variable->export_info.type = Variant::PACKED_STRING_ARRAY;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user