You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
some checks for node removed, may fix #20863
This commit is contained in:
@@ -262,6 +262,7 @@ void ParticlesEditor::_notification(int p_notification) {
|
|||||||
|
|
||||||
if (p_notification == NOTIFICATION_ENTER_TREE) {
|
if (p_notification == NOTIFICATION_ENTER_TREE) {
|
||||||
options->set_icon(options->get_popup()->get_icon("Particles", "EditorIcons"));
|
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("_menu_option", &ParticlesEditor::_menu_option);
|
||||||
ClassDB::bind_method("_generate_aabb", &ParticlesEditor::_generate_aabb);
|
ClassDB::bind_method("_generate_aabb", &ParticlesEditor::_generate_aabb);
|
||||||
|
ClassDB::bind_method("_node_removed", &ParticlesEditor::_node_removed);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticlesEditor::ParticlesEditor() {
|
ParticlesEditor::ParticlesEditor() {
|
||||||
|
|||||||
@@ -126,7 +126,15 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonEditor::edit(Skeleton *p_node) {
|
void SkeletonEditor::edit(Skeleton *p_node) {
|
||||||
|
|
||||||
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) {
|
void SkeletonEditor::_node_removed(Node *p_node) {
|
||||||
@@ -139,6 +147,7 @@ void SkeletonEditor::_node_removed(Node *p_node) {
|
|||||||
|
|
||||||
void SkeletonEditor::_bind_methods() {
|
void SkeletonEditor::_bind_methods() {
|
||||||
ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option);
|
ClassDB::bind_method("_on_click_option", &SkeletonEditor::_on_click_option);
|
||||||
|
ClassDB::bind_method("_node_removed", &SkeletonEditor::_node_removed);
|
||||||
}
|
}
|
||||||
|
|
||||||
SkeletonEditor::SkeletonEditor() {
|
SkeletonEditor::SkeletonEditor() {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ class SkeletonEditor : public Node {
|
|||||||
friend class SkeletonEditorPlugin;
|
friend class SkeletonEditorPlugin;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void _notification(int p_what);
|
||||||
void _node_removed(Node *p_node);
|
void _node_removed(Node *p_node);
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user