Skip to content

Commit

Permalink
Remove workaround for GraphEdit signal to delete nodes.
Browse files Browse the repository at this point in the history
Was changed back in godotengine/godot#82370
  • Loading branch information
Zylann committed Oct 29, 2023
1 parent db3f9bf commit 8853d04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions editor/graph/voxel_graph_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ VoxelGraphEditor::VoxelGraphEditor() {
_graph_edit->connect("gui_input", ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_gui_input));
_graph_edit->connect(
"connection_request", ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_connection_request));
_graph_edit->connect(GODOT_GraphEdit_delete_nodes_request,
ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_delete_nodes_request));
_graph_edit->connect(
"delete_nodes_request", ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_delete_nodes_request));
_graph_edit->connect("disconnection_request",
ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_disconnection_request));
_graph_edit->connect("node_selected", ZN_GODOT_CALLABLE_MP(this, VoxelGraphEditor, _on_graph_edit_node_selected));
Expand Down
13 changes: 0 additions & 13 deletions util/godot/classes/graph_edit.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ Vector2 get_graph_edit_scroll_offset(const GraphEdit &self);
bool is_graph_edit_using_snapping(const GraphEdit &self);
int get_graph_edit_snapping_distance(const GraphEdit &self);

// Name of the GraphEdit signal to listen to, for the intent of deleting nodes
//
// There was a rename in Godot 4.2 PR #79311 2167694965ca2f4f16cfc1362d32a2fa01e817a2
// https://github.com/godotengine/godot/pull/79311#issuecomment-1671901961
// The original code of GraphEdit referred to deleting GraphNodes as "close" and "delete" interchangeably. It was
// unified for consistency, but the term chosen was "close", which breaks compatibility with a name that is less related
// to what it was used for...
#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 1
#define GODOT_GraphEdit_delete_nodes_request "delete_nodes_request"
#else
#define GODOT_GraphEdit_delete_nodes_request "close_nodes_request"
#endif

} // namespace zylann

#endif // ZN_GODOT_GRAPH_EDIT_H

0 comments on commit 8853d04

Please sign in to comment.