1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Remove unnecessary this-> expressions

This commit is contained in:
A Thousand Ships
2024-01-28 21:51:39 +01:00
parent 17e7f85c06
commit 15369fdb1d
39 changed files with 160 additions and 160 deletions

View File

@@ -416,7 +416,7 @@ void Sprite2DEditor::_create_collision_polygon_2d_node() {
ur->create_action(TTR("Create CollisionPolygon2D Sibling"));
ur->add_do_method(this, "_add_as_sibling_or_child", node, collision_polygon_2d_instance);
ur->add_do_reference(collision_polygon_2d_instance);
ur->add_undo_method(node != this->get_tree()->get_edited_scene_root() ? node->get_parent() : this->get_tree()->get_edited_scene_root(), "remove_child", collision_polygon_2d_instance);
ur->add_undo_method(node != get_tree()->get_edited_scene_root() ? node->get_parent() : get_tree()->get_edited_scene_root(), "remove_child", collision_polygon_2d_instance);
ur->commit_action();
}
}
@@ -449,21 +449,21 @@ void Sprite2DEditor::_create_light_occluder_2d_node() {
ur->create_action(TTR("Create LightOccluder2D Sibling"));
ur->add_do_method(this, "_add_as_sibling_or_child", node, light_occluder_2d_instance);
ur->add_do_reference(light_occluder_2d_instance);
ur->add_undo_method(node != this->get_tree()->get_edited_scene_root() ? node->get_parent() : this->get_tree()->get_edited_scene_root(), "remove_child", light_occluder_2d_instance);
ur->add_undo_method(node != get_tree()->get_edited_scene_root() ? node->get_parent() : get_tree()->get_edited_scene_root(), "remove_child", light_occluder_2d_instance);
ur->commit_action();
}
}
void Sprite2DEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) {
// Can't make sibling if own node is scene root
if (p_own_node != this->get_tree()->get_edited_scene_root()) {
if (p_own_node != get_tree()->get_edited_scene_root()) {
p_own_node->get_parent()->add_child(p_new_node, true);
Object::cast_to<Node2D>(p_new_node)->set_transform(Object::cast_to<Node2D>(p_own_node)->get_transform());
} else {
p_own_node->add_child(p_new_node, true);
}
p_new_node->set_owner(this->get_tree()->get_edited_scene_root());
p_new_node->set_owner(get_tree()->get_edited_scene_root());
}
void Sprite2DEditor::_debug_uv_input(const Ref<InputEvent> &p_input) {