summaryrefslogtreecommitdiffstats
path: root/editor/editor_properties.cpp
diff options
context:
space:
mode:
authorSaracen <SaracenOne@gmail.com>2023-09-29 14:58:13 +0100
committerSaracen <SaracenOne@gmail.com>2023-11-08 00:18:40 +0000
commit7559eb1667da2329ba4bf216a1030079c4ee96e4 (patch)
tree050c8050a87c479cf10ed5601b84e4f222381e43 /editor/editor_properties.cpp
parent5ee983188de97ae027f9b9c1443438063f708a7e (diff)
downloadredot-engine-7559eb1667da2329ba4bf216a1030079c4ee96e4.tar.gz
Script path type support in editor:
Allow script path type hints to be used in drag and drop and scene tree popup.
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r--editor/editor_properties.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 7884005ab7..6545f645a8 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -2929,6 +2929,14 @@ bool EditorPropertyNodePath::is_drop_valid(const Dictionary &p_drag_data) const
if (dropped_node->is_class(E) ||
EditorNode::get_singleton()->is_object_of_custom_type(dropped_node, E)) {
return true;
+ } else {
+ Ref<Script> dropped_node_script = dropped_node->get_script();
+ while (dropped_node_script.is_valid()) {
+ if (dropped_node_script->get_path() == E) {
+ return true;
+ }
+ dropped_node_script = dropped_node_script->get_base_script();
+ }
}
}