summaryrefslogtreecommitdiff
path: root/modules/navigation
diff options
context:
space:
mode:
authortrollodel <33117082+trollodel@users.noreply.github.com>2022-02-14 17:59:06 +0100
committertrollodel <33117082+trollodel@users.noreply.github.com>2022-02-14 18:21:42 +0100
commitcd1d7294d8d150788c8d9a19ca56038b864360a0 (patch)
tree78a6404ec92f7b65865050a2c4909613ee137b96 /modules/navigation
parentf810f76890f23843f3895262fe2f88a7d5d3c3f3 (diff)
Remove the EditorNode parameter from EditorPlugins create methods
Remove EditorNode usage from the Navigation editor plugin.
Diffstat (limited to 'modules/navigation')
-rw-r--r--modules/navigation/navigation_mesh_editor_plugin.cpp5
-rw-r--r--modules/navigation/navigation_mesh_editor_plugin.h4
2 files changed, 3 insertions, 6 deletions
diff --git a/modules/navigation/navigation_mesh_editor_plugin.cpp b/modules/navigation/navigation_mesh_editor_plugin.cpp
index af02bff4ca..04eca5fb0b 100644
--- a/modules/navigation/navigation_mesh_editor_plugin.cpp
+++ b/modules/navigation/navigation_mesh_editor_plugin.cpp
@@ -140,10 +140,9 @@ void NavigationMeshEditorPlugin::make_visible(bool p_visible) {
}
}
-NavigationMeshEditorPlugin::NavigationMeshEditorPlugin(EditorNode *p_node) {
- editor = p_node;
+NavigationMeshEditorPlugin::NavigationMeshEditorPlugin() {
navigation_mesh_editor = memnew(NavigationMeshEditor);
- editor->get_main_control()->add_child(navigation_mesh_editor);
+ EditorNode::get_singleton()->get_main_control()->add_child(navigation_mesh_editor);
add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU, navigation_mesh_editor->bake_hbox);
navigation_mesh_editor->hide();
navigation_mesh_editor->bake_hbox->hide();
diff --git a/modules/navigation/navigation_mesh_editor_plugin.h b/modules/navigation/navigation_mesh_editor_plugin.h
index 49ca28d3cf..0e4175eca0 100644
--- a/modules/navigation/navigation_mesh_editor_plugin.h
+++ b/modules/navigation/navigation_mesh_editor_plugin.h
@@ -35,7 +35,6 @@
#include "editor/editor_plugin.h"
-class EditorNode;
class NavigationRegion3D;
class NavigationMeshEditor : public Control {
@@ -70,7 +69,6 @@ class NavigationMeshEditorPlugin : public EditorPlugin {
GDCLASS(NavigationMeshEditorPlugin, EditorPlugin);
NavigationMeshEditor *navigation_mesh_editor;
- EditorNode *editor;
public:
virtual String get_name() const override { return "NavigationMesh"; }
@@ -79,7 +77,7 @@ public:
virtual bool handles(Object *p_object) const override;
virtual void make_visible(bool p_visible) override;
- NavigationMeshEditorPlugin(EditorNode *p_node);
+ NavigationMeshEditorPlugin();
~NavigationMeshEditorPlugin();
};