MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _notification

Method _notification

editor/docks/scene_tree_dock.cpp:1613–1804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1611}
1612
1613void SceneTreeDock::_notification(int p_what) {
1614 switch (p_what) {
1615 case NOTIFICATION_READY: {
1616 if (!first_enter) {
1617 break;
1618 }
1619 first_enter = false;
1620
1621 EditorFeatureProfileManager::get_singleton()->connect("current_feature_profile_changed", callable_mp(this, &SceneTreeDock::_feature_profile_changed));
1622
1623 CanvasItemEditorPlugin *canvas_item_plugin = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor_by_name("2D"));
1624 if (canvas_item_plugin) {
1625 canvas_item_plugin->get_canvas_item_editor()->connect("item_lock_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree).bind(false));
1626 canvas_item_plugin->get_canvas_item_editor()->connect("item_group_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree).bind(false));
1627 scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::queue_redraw));
1628 }
1629
1630 Node3DEditorPlugin *spatial_editor_plugin = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor_by_name("3D"));
1631 spatial_editor_plugin->get_spatial_editor()->connect("item_lock_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree).bind(false));
1632 spatial_editor_plugin->get_spatial_editor()->connect("item_group_status_changed", callable_mp(scene_tree, &SceneTreeEditor::_update_tree).bind(false));
1633
1634 filter->set_clear_button_enabled(true);
1635
1636 // create_root_dialog
1637 HBoxContainer *top_row = memnew(HBoxContainer);
1638 top_row->set_h_size_flags(SIZE_EXPAND_FILL);
1639 Label *l = memnew(Label(TTR("Create Root Node:")));
1640 l->set_theme_type_variation("HeaderSmall");
1641 top_row->add_child(l);
1642 top_row->add_spacer();
1643
1644 node_shortcuts_toggle = memnew(Button);
1645 node_shortcuts_toggle->set_flat(true);
1646 node_shortcuts_toggle->set_accessibility_name(TTRC("Favorite Nodes"));
1647 node_shortcuts_toggle->set_button_icon(get_editor_theme_icon(SNAME("Favorites")));
1648 node_shortcuts_toggle->set_toggle_mode(true);
1649 node_shortcuts_toggle->set_tooltip_text(TTR("Toggle the display of favorite nodes."));
1650 node_shortcuts_toggle->set_pressed(EDITOR_GET("_use_favorites_root_selection"));
1651 node_shortcuts_toggle->set_anchors_and_offsets_preset(Control::PRESET_CENTER_RIGHT);
1652 node_shortcuts_toggle->connect(SceneStringName(pressed), callable_mp(this, &SceneTreeDock::_update_create_root_dialog).bind(false));
1653 top_row->add_child(node_shortcuts_toggle);
1654
1655 create_root_dialog->add_child(top_row);
1656
1657 ScrollContainer *scroll_container = memnew(ScrollContainer);
1658 create_root_dialog->add_child(scroll_container);
1659 scroll_container->set_v_size_flags(SIZE_EXPAND_FILL);
1660 scroll_container->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED);
1661
1662 VBoxContainer *node_shortcuts = memnew(VBoxContainer);
1663 scroll_container->add_child(node_shortcuts);
1664 node_shortcuts->set_h_size_flags(SIZE_EXPAND_FILL);
1665
1666 beginner_node_shortcuts = memnew(VBoxContainer);
1667 node_shortcuts->add_child(beginner_node_shortcuts);
1668
1669 button_2d = memnew(Button);
1670 beginner_node_shortcuts->add_child(button_2d);

Callers

nothing calls this directly

Calls 15

TTRFunction · 0.85
get_editor_by_nameMethod · 0.80
get_viewport_controlMethod · 0.80
get_spatial_editorMethod · 0.80
set_h_size_flagsMethod · 0.80
add_spacerMethod · 0.80
set_button_iconMethod · 0.80
set_v_size_flagsMethod · 0.80

Tested by

no test coverage detected