Implement export_multiline support for Array[String] and Dictionary
For arrays, specifically check if it's a string array and pass the type on to the editor. For dictionaries, save the hint on the type and use it later to draw the multiline editor, except for when adding a string key, because that doesn't make much sense. All string values however will be drawn as multiline.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user