Skip to content

Commit

Permalink
GH-463 Support bulk frame detachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jun 30, 2024
1 parent ffaac7b commit 68f14ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/editor/graph/graph_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ void OrchestratorGraphNode::_show_context_menu(const Vector2& p_position)
{
// Anything but comments
if (GraphFrame* frame = get_graph()->get_element_frame(get_name()))
_context_menu->add_item("Detach from comment frame", CM_DETACH_FRAME);
{
bool multiple = get_graph()->get_selected_nodes().size() > 1;
_context_menu->add_item(vformat("Detach %s from comment frame", multiple ? "selected nodes" : "node"), CM_DETACH_FRAME);
}
}

_context_menu->add_separator("Breakpoints");
Expand Down Expand Up @@ -786,7 +789,8 @@ void OrchestratorGraphNode::_on_context_menu_selection(int p_id)
}
case CM_DETACH_FRAME:
{
get_graph()->detach_graph_element_from_frame(get_name());
for (OrchestratorGraphNode* selected : get_graph()->get_selected_nodes())
get_graph()->detach_graph_element_from_frame(selected->get_name());
break;
}
#endif
Expand Down

0 comments on commit 68f14ec

Please sign in to comment.