diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-10-03 21:53:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-03 21:53:35 +0200 |
commit | b5eea37fb04755e71c541727c1edf3a51e8fe30f (patch) | |
tree | b7e2ad1bec67ccd87002128df27abafdefd404fe /scene | |
parent | 70eb7fb22669ccf57c87a141911b40ff258607b3 (diff) | |
parent | 4834e14493f14f1c1e219dff7fca66548fb74108 (diff) |
Merge pull request #42518 from Duroxxigar/update-getter-and-setters
Updated getters and setters names for toplevel
Diffstat (limited to 'scene')
-rw-r--r-- | scene/3d/node_3d.cpp | 8 | ||||
-rw-r--r-- | scene/3d/soft_body_3d.cpp | 2 | ||||
-rw-r--r-- | scene/gui/control.cpp | 8 | ||||
-rw-r--r-- | scene/gui/control.h | 2 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tab_container.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 2 | ||||
-rw-r--r-- | scene/main/canvas_item.cpp | 22 | ||||
-rw-r--r-- | scene/main/canvas_item.h | 4 |
9 files changed, 26 insertions, 26 deletions
diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index 35c4b9d08d..138788cf2d 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -104,7 +104,7 @@ void Node3D::_propagate_transform_changed(Node3D *p_origin) { for (List<Node3D *>::Element *E = data.children.front(); E; E = E->next()) { if (E->get()->data.top_level_active) { - continue; //don't propagate to a toplevel + continue; //don't propagate to a top_level } E->get()->_propagate_transform_changed(p_origin); } @@ -715,8 +715,8 @@ void Node3D::_bind_methods() { ClassDB::bind_method(D_METHOD("get_global_transform"), &Node3D::get_global_transform); ClassDB::bind_method(D_METHOD("get_parent_spatial"), &Node3D::get_parent_spatial); ClassDB::bind_method(D_METHOD("set_ignore_transform_notification", "enabled"), &Node3D::set_ignore_transform_notification); - ClassDB::bind_method(D_METHOD("set_as_toplevel", "enable"), &Node3D::set_as_top_level); - ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &Node3D::is_set_as_top_level); + ClassDB::bind_method(D_METHOD("set_as_top_level", "enable"), &Node3D::set_as_top_level); + ClassDB::bind_method(D_METHOD("is_set_as_top_level"), &Node3D::is_set_as_top_level); ClassDB::bind_method(D_METHOD("set_disable_scale", "disable"), &Node3D::set_disable_scale); ClassDB::bind_method(D_METHOD("is_scale_disabled"), &Node3D::is_scale_disabled); ClassDB::bind_method(D_METHOD("get_world_3d"), &Node3D::get_world_3d); @@ -773,7 +773,7 @@ void Node3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation_degrees", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_rotation_degrees", "get_rotation_degrees"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "rotation", PROPERTY_HINT_NONE, "", 0), "set_rotation", "get_rotation"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "set_scale", "get_scale"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "toplevel"), "set_as_toplevel", "is_set_as_toplevel"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "top_level"), "set_as_top_level", "is_set_as_top_level"); ADD_GROUP("Matrix", ""); ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM, "transform", PROPERTY_HINT_NONE, ""), "set_transform", "get_transform"); ADD_GROUP("Visibility", ""); diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index 94e9555a1a..018a2a7a39 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -425,7 +425,7 @@ void SoftBody3D::_draw_soft_mesh() { /// Necessary in order to render the mesh correctly (Soft body nodes are in global space) simulation_started = true; - call_deferred("set_as_toplevel", true); + call_deferred("set_as_top_level", true); call_deferred("set_transform", Transform()); } diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 17febc8d66..476dccab7e 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -509,13 +509,13 @@ void Control::_notification(int p_notification) { } if (parent_control && !subwindow) { - //do nothing, has a parent control and not toplevel + //do nothing, has a parent control and not top_level if (data.theme.is_null() && parent_control->data.theme_owner) { data.theme_owner = parent_control->data.theme_owner; notification(NOTIFICATION_THEME_CHANGED); } } else { - //is a regular root control or toplevel + //is a regular root control or top_level data.RI = get_viewport()->_gui_add_root_control(this); } @@ -2023,7 +2023,7 @@ void Control::release_focus() { update(); } -bool Control::is_toplevel_control() const { +bool Control::is_top_level_control() const { return is_inside_tree() && (!data.parent_canvas_item && !data.RI && is_set_as_top_level()); } @@ -2499,7 +2499,7 @@ Control *Control::get_root_parent_control() const { if (c) { root = c; - if (c->data.RI || c->is_toplevel_control()) { + if (c->data.RI || c->is_top_level_control()) { break; } } diff --git a/scene/gui/control.h b/scene/gui/control.h index 15e10df0c6..83e79f908f 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -464,7 +464,7 @@ public: virtual Transform2D get_transform() const override; - bool is_toplevel_control() const; + bool is_top_level_control() const; Size2 get_parent_area_size() const; Rect2 get_parent_anchorable_rect() const; diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 4aea2928f4..2da61bdde7 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -936,7 +936,7 @@ FileDialog::FileDialog() { filter->connect("item_selected", callable_mp(this, &FileDialog::_filter_selected)); confirm_save = memnew(ConfirmationDialog); - // confirm_save->set_as_toplevel(true); + // confirm_save->set_as_top_level(true); add_child(confirm_save); confirm_save->connect("confirmed", callable_mp(this, &FileDialog::_save_confirm_pressed)); diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 14a10ea627..a1f93094c4 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -517,7 +517,7 @@ Vector<Control *> TabContainer::_get_tabs() const { Vector<Control *> controls; for (int i = 0; i < get_child_count(); i++) { Control *control = Object::cast_to<Control>(get_child(i)); - if (!control || control->is_toplevel_control()) { + if (!control || control->is_top_level_control()) { continue; } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 070948237a..2f5ee20373 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3892,7 +3892,7 @@ Tree::Tree() { popup_menu = memnew(PopupMenu); popup_menu->hide(); add_child(popup_menu); - // popup_menu->set_as_toplevel(true); + // popup_menu->set_as_top_level(true); popup_editor = memnew(Popup); popup_editor->set_wrap_controls(true); diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 2b83e4f532..0d9d9d6356 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -371,7 +371,7 @@ void CanvasItem::_propagate_visibility_changed(bool p_visible) { for (int i = 0; i < get_child_count(); i++) { CanvasItem *c = Object::cast_to<CanvasItem>(get_child(i)); - if (c && c->visible) { //should the toplevels stop propagation? i think so but.. + if (c && c->visible) { //should the top_levels stop propagation? i think so but.. c->_propagate_visibility_changed(p_visible); } } @@ -486,7 +486,7 @@ Transform2D CanvasItem::get_global_transform() const { return global_transform; } -void CanvasItem::_toplevel_raise_self() { +void CanvasItem::_top_level_raise_self() { if (!is_inside_tree()) { return; } @@ -533,7 +533,7 @@ void CanvasItem::_enter_canvas() { get_viewport()->gui_reset_canvas_sort_index(); } - get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_top_level_raise_self"); } else { CanvasItem *parent = get_parent_item(); @@ -599,7 +599,7 @@ void CanvasItem::_notification(int p_what) { } if (group != "") { - get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_toplevel_raise_self"); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_UNIQUE, group, "_top_level_raise_self"); } else { CanvasItem *p = get_parent_item(); ERR_FAIL_COND(!p); @@ -674,18 +674,18 @@ Color CanvasItem::get_modulate() const { return modulate; } -void CanvasItem::set_as_top_level(bool p_toplevel) { - if (top_level == p_toplevel) { +void CanvasItem::set_as_top_level(bool p_top_level) { + if (top_level == p_top_level) { return; } if (!is_inside_tree()) { - top_level = p_toplevel; + top_level = p_top_level; return; } _exit_canvas(); - top_level = p_toplevel; + top_level = p_top_level; _enter_canvas(); } @@ -1104,7 +1104,7 @@ void CanvasItem::force_update_transform() { } void CanvasItem::_bind_methods() { - ClassDB::bind_method(D_METHOD("_toplevel_raise_self"), &CanvasItem::_toplevel_raise_self); + ClassDB::bind_method(D_METHOD("_top_level_raise_self"), &CanvasItem::_top_level_raise_self); ClassDB::bind_method(D_METHOD("_update_callback"), &CanvasItem::_update_callback); #ifdef TOOLS_ENABLED @@ -1136,8 +1136,8 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("update"), &CanvasItem::update); - ClassDB::bind_method(D_METHOD("set_as_toplevel", "enable"), &CanvasItem::set_as_top_level); - ClassDB::bind_method(D_METHOD("is_set_as_toplevel"), &CanvasItem::is_set_as_top_level); + ClassDB::bind_method(D_METHOD("set_as_top_level", "enable"), &CanvasItem::set_as_top_level); + ClassDB::bind_method(D_METHOD("is_set_as_top_level"), &CanvasItem::is_set_as_top_level); ClassDB::bind_method(D_METHOD("set_light_mask", "light_mask"), &CanvasItem::set_light_mask); ClassDB::bind_method(D_METHOD("get_light_mask"), &CanvasItem::get_light_mask); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 457ec2feef..a331cb96a9 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -220,7 +220,7 @@ private: mutable Transform2D global_transform; mutable bool global_invalid; - void _toplevel_raise_self(); + void _top_level_raise_self(); void _propagate_visibility_changed(bool p_visible); @@ -355,7 +355,7 @@ public: /* RECT / TRANSFORM */ - void set_as_top_level(bool p_toplevel); + void set_as_top_level(bool p_top_level); bool is_set_as_top_level() const; void set_draw_behind_parent(bool p_enable); |