From 8fdf450b0f5b601cfd21031a76128971e328f9f5 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sat, 5 Oct 2024 04:30:29 +0100 Subject: [PATCH] Fix 4.3 --- editor/graph/voxel_graph_node_dialog.cpp | 8 ++++---- editor/graph/voxel_graph_node_dialog.h | 7 ++++--- util/godot/classes/editor_quick_open.h | 2 -- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/editor/graph/voxel_graph_node_dialog.cpp b/editor/graph/voxel_graph_node_dialog.cpp index 1285f9e1e..5c2ec0145 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(); 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