diff options
author | kobewi <kobewi4e@gmail.com> | 2023-11-28 17:33:04 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-02-22 15:13:53 +0100 |
commit | aeec3c130970d545e42f138ae05f8069e8dc04f9 (patch) | |
tree | 282de0718517d8949929387af757c1f8be691c2c /editor/scene_tree_dock.cpp | |
parent | 9c626b623619d89ce3e02a8422a4de977e016d1b (diff) | |
download | redot-engine-aeec3c130970d545e42f138ae05f8069e8dc04f9.tar.gz |
Add methods to add submenus without using names
Diffstat (limited to 'editor/scene_tree_dock.cpp')
-rw-r--r-- | editor/scene_tree_dock.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 023d9e9f00..f8e0628072 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -3263,7 +3263,7 @@ void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) { Ref<Texture2D> icon = EditorNode::get_singleton()->get_object_icon(obj); if (menu->get_item_count() == 0) { - menu->add_submenu_item(TTR("Sub-Resources"), "SubResources"); + menu->add_submenu_node_item(TTR("Sub-Resources"), menu_subresources); } menu_subresources->add_icon_item(icon, E.name.capitalize(), EDIT_SUBRESOURCE_BASE + subresources.size()); menu_subresources->set_item_indent(-1, p_depth); @@ -3504,11 +3504,9 @@ void SceneTreeDock::_update_tree_menu() { tree_menu->set_item_tooltip(tree_menu->get_item_index(TOOL_CENTER_PARENT), TTR("If enabled, Reparent to New Node will create the new node in the center of the selected nodes, if possible.")); PopupMenu *resource_list = memnew(PopupMenu); - resource_list->set_name("AllResources"); resource_list->connect("about_to_popup", callable_mp(this, &SceneTreeDock::_list_all_subresources).bind(resource_list)); resource_list->connect("index_pressed", callable_mp(this, &SceneTreeDock::_edit_subresource).bind(resource_list)); - tree_menu->add_child(resource_list); - tree_menu->add_submenu_item(TTR("All Scene Sub-Resources"), "AllResources"); + tree_menu->add_submenu_node_item(TTR("All Scene Sub-Resources"), resource_list); } void SceneTreeDock::_filter_changed(const String &p_filter) { @@ -4365,7 +4363,6 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec menu->connect("id_pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(false)); menu_subresources = memnew(PopupMenu); - menu_subresources->set_name("SubResources"); menu_subresources->connect("id_pressed", callable_mp(this, &SceneTreeDock::_tool_selected).bind(false)); menu->add_child(menu_subresources); |