Merge pull request #70540 from vaartis/multiline-arrays-dictionaries

Implement export_multiline support for Array[String] and Dictionary
This commit is contained in:
Rémi Verschelde
2023-01-13 18:01:55 +01:00
4 changed files with 34 additions and 1 deletions

View File

@@ -818,6 +818,10 @@ void EditorPropertyDictionary::_change_type_menu(int p_index) {
update_property();
}
void EditorPropertyDictionary::setup(PropertyHint p_hint) {
property_hint = p_hint;
}
void EditorPropertyDictionary::update_property() {
Variant updated_val = get_edited_object()->get(get_edited_property());
@@ -929,7 +933,13 @@ void EditorPropertyDictionary::update_property() {
prop = editor;
} break;
case Variant::STRING: {
prop = memnew(EditorPropertyText);
if (i != amount && property_hint == PROPERTY_HINT_MULTILINE_TEXT) {
// If this is NOT the new key field and there's a multiline hint,
// show the field as multiline
prop = memnew(EditorPropertyMultilineText);
} else {
prop = memnew(EditorPropertyText);
}
} break;