diff options
Diffstat (limited to 'modules/gdnative')
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_editor_plugin.h | 12 | ||||
-rw-r--r-- | modules/gdnative/gdnative_library_singleton_editor.cpp | 1 | ||||
-rw-r--r-- | modules/gdnative/register_types.cpp | 2 |
4 files changed, 16 insertions, 8 deletions
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp index 33ea078696..2440ef392e 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.cpp +++ b/modules/gdnative/gdnative_library_editor_plugin.cpp @@ -30,9 +30,10 @@ #ifdef TOOLS_ENABLED #include "gdnative_library_editor_plugin.h" -#include "gdnative.h" - +#include "editor/editor_file_dialog.h" +#include "editor/editor_node.h" #include "editor/editor_scale.h" +#include "gdnative.h" void GDNativeLibraryEditor::edit(Ref<GDNativeLibrary> p_library) { library = p_library; @@ -407,10 +408,10 @@ void GDNativeLibraryEditorPlugin::make_visible(bool p_visible) { } } -GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin(EditorNode *p_node) { +GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin() { library_editor = memnew(GDNativeLibraryEditor); library_editor->set_custom_minimum_size(Size2(0, 250 * EDSCALE)); - button = p_node->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor); + button = EditorNode::get_singleton()->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor); button->hide(); } diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h index 27848893fa..2e4b483ea7 100644 --- a/modules/gdnative/gdnative_library_editor_plugin.h +++ b/modules/gdnative/gdnative_library_editor_plugin.h @@ -32,8 +32,15 @@ #define GDNATIVE_LIBRARY_EDITOR_PLUGIN_H #ifdef TOOLS_ENABLED -#include "editor/editor_node.h" + +#include "editor/editor_plugin.h" #include "gdnative.h" +#include "scene/gui/control.h" +#include "scene/gui/menu_button.h" +#include "scene/gui/tree.h" + +class EditorNode; +class EditorFileDialog; class GDNativeLibraryEditor : public Control { GDCLASS(GDNativeLibraryEditor, Control); @@ -96,7 +103,6 @@ class GDNativeLibraryEditorPlugin : public EditorPlugin { GDCLASS(GDNativeLibraryEditorPlugin, EditorPlugin); GDNativeLibraryEditor *library_editor = nullptr; - EditorNode *editor = nullptr; Button *button = nullptr; public: @@ -106,7 +112,7 @@ public: virtual bool handles(Object *p_node) const override; virtual void make_visible(bool p_visible) override; - GDNativeLibraryEditorPlugin(EditorNode *p_node); + GDNativeLibraryEditorPlugin(); }; #endif #endif // GDNATIVE_LIBRARY_EDITOR_PLUGIN_H diff --git a/modules/gdnative/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp index 6eb412eccb..e0079f93ee 100644 --- a/modules/gdnative/gdnative_library_singleton_editor.cpp +++ b/modules/gdnative/gdnative_library_singleton_editor.cpp @@ -32,6 +32,7 @@ #include "gdnative_library_singleton_editor.h" #include "gdnative.h" +#include "core/config/project_settings.h" #include "editor/editor_node.h" Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFileSystemDirectory *p_dir) { diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp index fb682beccc..1121fd0e03 100644 --- a/modules/gdnative/register_types.cpp +++ b/modules/gdnative/register_types.cpp @@ -226,7 +226,7 @@ static void editor_init_callback() { EditorExport::get_singleton()->add_export_plugin(export_plugin); - EditorNode::get_singleton()->add_editor_plugin(memnew(GDNativeLibraryEditorPlugin(EditorNode::get_singleton()))); + EditorNode::get_singleton()->add_editor_plugin(memnew(GDNativeLibraryEditorPlugin)); } #endif |