Skip to content

Commit

Permalink
CraterCrashGH-463 Support bulk frame detachments
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Jul 13, 2024
1 parent 4e8370d commit 0f312ec
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 @@ -480,7 +480,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);
}
}

if (!multi_selections)
Expand Down Expand Up @@ -792,7 +795,8 @@ void OrchestratorGraphNode::_handle_context_menu(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 0f312ec

Please sign in to comment.