Skip to content

Commit b4460c6

Browse files
Add cut_nodes_request signal to GraphEdit
1 parent f7c567e commit b4460c6

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

doc/classes/GraphEdit.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,11 @@
399399
Emitted when this [GraphEdit] captures a [code]ui_copy[/code] action ([kbd]Ctrl + C[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be copied.
400400
</description>
401401
</signal>
402+
<signal name="cut_nodes_request">
403+
<description>
404+
Emitted when this [GraphEdit] captures a [code]ui_cut[/code] action ([kbd]Ctrl + X[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be cut.
405+
</description>
406+
</signal>
402407
<signal name="delete_nodes_request">
403408
<param index="0" name="nodes" type="StringName[]" />
404409
<description>

editor/plugins/visual_shader_editor_plugin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6300,6 +6300,7 @@ VisualShaderEditor::VisualShaderEditor() {
63006300
graph->connect("scroll_offset_changed", callable_mp(this, &VisualShaderEditor::_scroll_changed));
63016301
graph->connect("duplicate_nodes_request", callable_mp(this, &VisualShaderEditor::_duplicate_nodes));
63026302
graph->connect("copy_nodes_request", callable_mp(this, &VisualShaderEditor::_copy_nodes).bind(false));
6303+
graph->connect("cut_nodes_request", callable_mp(this, &VisualShaderEditor::_copy_nodes).bind(true));
63036304
graph->connect("paste_nodes_request", callable_mp(this, &VisualShaderEditor::_paste_nodes).bind(false, Point2()));
63046305
graph->connect("delete_nodes_request", callable_mp(this, &VisualShaderEditor::_delete_nodes_request));
63056306
graph->connect(SceneStringName(gui_input), callable_mp(this, &VisualShaderEditor::_graph_gui_input));

scene/gui/graph_edit.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,9 @@ void GraphEdit::gui_input(const Ref<InputEvent> &p_ev) {
19991999
} else if (p_ev->is_action("ui_copy", true)) {
20002000
emit_signal(SNAME("copy_nodes_request"));
20012001
accept_event();
2002+
} else if (p_ev->is_action("ui_cut", true)) {
2003+
emit_signal(SNAME("cut_nodes_request"));
2004+
accept_event();
20022005
} else if (p_ev->is_action("ui_paste", true)) {
20032006
emit_signal(SNAME("paste_nodes_request"));
20042007
accept_event();
@@ -2735,6 +2738,7 @@ void GraphEdit::_bind_methods() {
27352738
ADD_SIGNAL(MethodInfo("connection_drag_ended"));
27362739

27372740
ADD_SIGNAL(MethodInfo("copy_nodes_request"));
2741+
ADD_SIGNAL(MethodInfo("cut_nodes_request"));
27382742
ADD_SIGNAL(MethodInfo("paste_nodes_request"));
27392743
ADD_SIGNAL(MethodInfo("duplicate_nodes_request"));
27402744
ADD_SIGNAL(MethodInfo("delete_nodes_request", PropertyInfo(Variant::ARRAY, "nodes", PROPERTY_HINT_ARRAY_TYPE, "StringName")));

0 commit comments

Comments
 (0)