Skip to content

Commit

Permalink
Fix 4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylann committed Oct 5, 2024
1 parent c8f4d79 commit 8fdf450
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions editor/graph/voxel_graph_node_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <editor/editor_node.h>
#endif
#endif
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
7 changes: 4 additions & 3 deletions editor/graph/voxel_graph_node_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
#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);
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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions util/godot/classes/editor_quick_open.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

#if VERSION_MAJOR == 4 && VERSION_MINOR <= 3
#include <editor/editor_quick_open.h>
// using EditorQuickOpenDialog = EditorQuickOpen;
#define ZN_GODOT_OLD_EDITOR_QUICK_OPEN
#else
#include <editor/gui/editor_quick_open_dialog.h>
#endif
Expand Down

0 comments on commit 8fdf450

Please sign in to comment.