diff options
author | MarianoGNU <marianognu.easyrpg@gmail.com> | 2016-01-10 11:33:45 -0300 |
---|---|---|
committer | MarianoGNU <marianognu.easyrpg@gmail.com> | 2016-01-10 11:33:45 -0300 |
commit | 21b5e9eef47e63201500d6664b01e7766edd48af (patch) | |
tree | dbe3a50d9eb87afcf5a7d15a5e61388c5b1efee4 /tools | |
parent | 3a3ce982b0157c21b4976a347d4c1c254093970f (diff) |
Allow to paste resources in inspector when text_hint indicates multiple types
Diffstat (limited to 'tools')
-rw-r--r-- | tools/editor/property_editor.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index fc5fce1d47..0d9ef966d2 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -727,7 +727,17 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty RES cb=EditorSettings::get_singleton()->get_resource_clipboard(); - bool paste_valid=cb.is_valid() && (hint_text=="" || ObjectTypeDB::is_type(cb->get_type(),hint_text)); + bool paste_valid=false; + if (cb.is_valid()) { + if (hint_text=="") + paste_valid=true; + else + for (int i = 0; i < hint_text.get_slice_count(",");i++) + if (ObjectTypeDB::is_type(cb->get_type(),hint_text.get_slice(",",i))) { + paste_valid=true; + break; + } + } if (!RES(v).is_null() || paste_valid) { menu->add_separator(); |