diff --git a/editor/graph/voxel_graph_node_dialog.cpp b/editor/graph/voxel_graph_node_dialog.cpp index 1285f9e1e..4bb5510a7 100644 --- a/editor/graph/voxel_graph_node_dialog.cpp +++ b/editor/graph/voxel_graph_node_dialog.cpp @@ -22,7 +22,7 @@ #include "graph_nodes_doc_data.h" #ifdef ZN_GODOT -#ifndef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR >= 4 #include #endif #endif @@ -173,7 +173,7 @@ VoxelGraphNodeDialog::VoxelGraphNodeDialog() { // TODO Replace QuickOpen with listing of project functions directly in the dialog // TODO GDX: EditorQuickOpen is not exposed to extensions #ifdef ZN_GODOT -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 _function_quick_open_dialog = memnew(EditorQuickOpen); _function_quick_open_dialog->connect( "quick_open", callable_mp(this, &VoxelGraphNodeDialog::_on_function_quick_open_dialog_quick_open) @@ -381,7 +381,7 @@ void VoxelGraphNodeDialog::_on_tree_item_activated() { } else if (id == ID_FUNCTION_QUICK_OPEN) { #ifdef ZN_GODOT -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 // Quick open function nodes _function_quick_open_dialog->popup_dialog(pg::VoxelGraphFunction::get_class_static()); #else @@ -439,7 +439,7 @@ void VoxelGraphNodeDialog::_on_function_file_dialog_file_selected(String fpath) hide(); } -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 void VoxelGraphNodeDialog::_on_function_quick_open_dialog_quick_open() { #ifdef ZN_GODOT String fpath = _function_quick_open_dialog->get_selected(); @@ -447,7 +447,7 @@ void VoxelGraphNodeDialog::_on_function_quick_open_dialog_quick_open() { #endif } -#else +#endif void VoxelGraphNodeDialog::on_function_quick_open_dialog_item_selected(String fpath) { #ifdef ZN_GODOT @@ -459,8 +459,6 @@ void VoxelGraphNodeDialog::on_function_quick_open_dialog_item_selected(String fp #endif } -#endif - void VoxelGraphNodeDialog::_on_description_label_meta_clicked(Variant meta) { // TODO Open docs if a class name is clicked } diff --git a/editor/graph/voxel_graph_node_dialog.h b/editor/graph/voxel_graph_node_dialog.h index 1fe850ee0..acbcbd4cb 100644 --- a/editor/graph/voxel_graph_node_dialog.h +++ b/editor/graph/voxel_graph_node_dialog.h @@ -4,6 +4,7 @@ #include "../../generators/graph/voxel_graph_function.h" #include "../../util/containers/std_vector.h" #include "../../util/godot/classes/confirmation_dialog.h" +#include "../../util/godot/core/version.h" #include "../../util/godot/macros.h" ZN_GODOT_FORWARD_DECLARE(class Tree); @@ -11,7 +12,7 @@ ZN_GODOT_FORWARD_DECLARE(class LineEdit); ZN_GODOT_FORWARD_DECLARE(class EditorFileDialog) ZN_GODOT_FORWARD_DECLARE(class RichTextLabel) #ifdef ZN_GODOT -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 ZN_GODOT_FORWARD_DECLARE(class EditorQuickOpen) #endif #endif @@ -39,7 +40,7 @@ class VoxelGraphNodeDialog : public ConfirmationDialog { void _on_tree_item_selected(); void _on_tree_nothing_selected(); void _on_function_file_dialog_file_selected(String fpath); -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 void _on_function_quick_open_dialog_quick_open(); #endif void on_function_quick_open_dialog_item_selected(String fpath); @@ -70,7 +71,7 @@ class VoxelGraphNodeDialog : public ConfirmationDialog { RichTextLabel *_description_label = nullptr; EditorFileDialog *_function_file_dialog = nullptr; #ifdef ZN_GODOT -#ifdef ZN_GODOT_OLD_EDITOR_QUICK_OPEN +#if GODOT_VERSION_MAJOR == 4 && GODOT_VERSION_MINOR <= 3 // TODO GDX: EditorQuickOpen is not exposed! EditorQuickOpen *_function_quick_open_dialog = nullptr; #endif diff --git a/util/godot/classes/editor_quick_open.h b/util/godot/classes/editor_quick_open.h index 24857d91c..aea7eaef6 100644 --- a/util/godot/classes/editor_quick_open.h +++ b/util/godot/classes/editor_quick_open.h @@ -5,8 +5,6 @@ #if VERSION_MAJOR == 4 && VERSION_MINOR <= 3 #include -// using EditorQuickOpenDialog = EditorQuickOpen; -#define ZN_GODOT_OLD_EDITOR_QUICK_OPEN #else #include #endif