summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-08-24 08:28:53 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-08-24 08:29:40 -0300
commit0161e95f01a6a9c096eec75328e4f19c23cf5c25 (patch)
treea7a60a73d77fdb1d45159dc8f107b3ce86f37b8a /editor/plugins
parentf123694b4e5ac52bb82b3a2e3cbd6d36db1d0c9c (diff)
some checks for node removed, may fix #20863
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/particles_editor_plugin.cpp2
-rw-r--r--editor/plugins/skeleton_editor_plugin.cpp9
-rw-r--r--editor/plugins/skeleton_editor_plugin.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 6a99dcb9a5..3c381158a4 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -262,6 +262,7 @@ void ParticlesEditor::_notification(int p_notification) {
if (p_notification == NOTIFICATION_ENTER_TREE) {
options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons"));
+ get_tree()->connect("node_removed", this, "_node_removed");
}
}
@@ -444,6 +445,7 @@ void ParticlesEditor::_bind_methods() {
ClassDB::bind_method("_menu_option", &ParticlesEditor::_menu_option);
ClassDB::bind_method("_generate_aabb", &ParticlesEditor::_generate_aabb);
+ ClassDB::bind_method("_node_removed", &ParticlesEditor::_node_removed);
}
ParticlesEditor::ParticlesEditor() {
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp
index fe7d1df50c..d871922c8b 100644
--- a/editor/plugins/skeleton_editor_plugin.cpp
+++ b/editor/plugins/skeleton_editor_plugin.cpp
@@ -126,7 +126,15 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i
}
void SkeletonEditor::edit(Skeleton *p_node) {
+
skeleton = p_node;
+
+}
+
+void SkeletonEditor::_notification(int p_what) {
+ if (p_what==NOTIFICATION_ENTER_TREE) {
+ get_tree()->connect("node_removed", this, "_node_removed");
+ }
}
void SkeletonEditor::_node_removed(Node *p_node) {
@@ -139,6 +147,7 @@ void SkeletonEditor::_node_removed(Node *p_node) {
void SkeletonEditor::_bind_methods() {
ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option);
+ ClassDB::bind_method("_node_removed", &SkeletonEditor::_node_removed);
}
SkeletonEditor::SkeletonEditor() {
diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_editor_plugin.h
index b9bdf91902..0ab94c15b5 100644
--- a/editor/plugins/skeleton_editor_plugin.h
+++ b/editor/plugins/skeleton_editor_plugin.h
@@ -61,6 +61,7 @@ class SkeletonEditor : public Node {
friend class SkeletonEditorPlugin;
protected:
+ void _notification(int p_what);
void _node_removed(Node *p_node);
static void _bind_methods();