Skip to content

Commit e9a8c7e

Browse files
committed
Move NavigationLink3DGizmoPlugin to navigation_3d module
Moves NavigationLink3DGizmoPlugin to navigation_3d module. Adds stub NavigationLink3DEditorPlugin.
1 parent 8f78e75 commit e9a8c7e

File tree

6 files changed

+98
-3
lines changed

6 files changed

+98
-3
lines changed

editor/plugins/node_3d_editor_plugin.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include "editor/plugins/gizmos/lightmap_probe_gizmo_plugin.h"
6565
#include "editor/plugins/gizmos/marker_3d_gizmo_plugin.h"
6666
#include "editor/plugins/gizmos/mesh_instance_3d_gizmo_plugin.h"
67-
#include "editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.h"
6867
#include "editor/plugins/gizmos/occluder_instance_3d_gizmo_plugin.h"
6968
#include "editor/plugins/gizmos/particles_3d_emission_shape_gizmo_plugin.h"
7069
#include "editor/plugins/gizmos/physics_bone_3d_gizmo_plugin.h"
@@ -8731,7 +8730,6 @@ void Node3DEditor::_register_all_gizmos() {
87318730
add_gizmo_plugin(Ref<CollisionObject3DGizmoPlugin>(memnew(CollisionObject3DGizmoPlugin)));
87328731
add_gizmo_plugin(Ref<CollisionShape3DGizmoPlugin>(memnew(CollisionShape3DGizmoPlugin)));
87338732
add_gizmo_plugin(Ref<CollisionPolygon3DGizmoPlugin>(memnew(CollisionPolygon3DGizmoPlugin)));
8734-
add_gizmo_plugin(Ref<NavigationLink3DGizmoPlugin>(memnew(NavigationLink3DGizmoPlugin)));
87358733
add_gizmo_plugin(Ref<Joint3DGizmoPlugin>(memnew(Joint3DGizmoPlugin)));
87368734
add_gizmo_plugin(Ref<PhysicalBone3DGizmoPlugin>(memnew(PhysicalBone3DGizmoPlugin)));
87378735
add_gizmo_plugin(Ref<FogVolumeGizmoPlugin>(memnew(FogVolumeGizmoPlugin)));
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**************************************************************************/
2+
/* navigation_link_3d_editor_plugin.cpp */
3+
/**************************************************************************/
4+
/* This file is part of: */
5+
/* GODOT ENGINE */
6+
/* https://godotengine.org */
7+
/**************************************************************************/
8+
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9+
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10+
/* */
11+
/* Permission is hereby granted, free of charge, to any person obtaining */
12+
/* a copy of this software and associated documentation files (the */
13+
/* "Software"), to deal in the Software without restriction, including */
14+
/* without limitation the rights to use, copy, modify, merge, publish, */
15+
/* distribute, sublicense, and/or sell copies of the Software, and to */
16+
/* permit persons to whom the Software is furnished to do so, subject to */
17+
/* the following conditions: */
18+
/* */
19+
/* The above copyright notice and this permission notice shall be */
20+
/* included in all copies or substantial portions of the Software. */
21+
/* */
22+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29+
/**************************************************************************/
30+
31+
#include "navigation_link_3d_editor_plugin.h"
32+
33+
#include "editor/plugins/node_3d_editor_plugin.h"
34+
#include "scene/3d/navigation/navigation_link_3d.h"
35+
36+
void NavigationLink3DEditorPlugin::edit(Object *p_object) {
37+
}
38+
39+
bool NavigationLink3DEditorPlugin::handles(Object *p_object) const {
40+
return Object::cast_to<NavigationLink3D>(p_object) != nullptr;
41+
}
42+
43+
NavigationLink3DEditorPlugin::NavigationLink3DEditorPlugin() {
44+
gizmo_plugin.instantiate();
45+
Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin);
46+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**************************************************************************/
2+
/* navigation_link_3d_editor_plugin.h */
3+
/**************************************************************************/
4+
/* This file is part of: */
5+
/* GODOT ENGINE */
6+
/* https://godotengine.org */
7+
/**************************************************************************/
8+
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9+
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10+
/* */
11+
/* Permission is hereby granted, free of charge, to any person obtaining */
12+
/* a copy of this software and associated documentation files (the */
13+
/* "Software"), to deal in the Software without restriction, including */
14+
/* without limitation the rights to use, copy, modify, merge, publish, */
15+
/* distribute, sublicense, and/or sell copies of the Software, and to */
16+
/* permit persons to whom the Software is furnished to do so, subject to */
17+
/* the following conditions: */
18+
/* */
19+
/* The above copyright notice and this permission notice shall be */
20+
/* included in all copies or substantial portions of the Software. */
21+
/* */
22+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29+
/**************************************************************************/
30+
31+
#pragma once
32+
33+
#include "editor/plugins/editor_plugin.h"
34+
35+
#include "navigation_link_3d_gizmo_plugin.h"
36+
37+
class NavigationLink3DEditorPlugin : public EditorPlugin {
38+
GDCLASS(NavigationLink3DEditorPlugin, EditorPlugin);
39+
40+
Ref<NavigationLink3DGizmoPlugin> gizmo_plugin;
41+
42+
public:
43+
virtual String get_plugin_name() const override { return "NavigationLink3D"; }
44+
bool has_main_screen() const override { return false; }
45+
virtual void edit(Object *p_object) override;
46+
virtual bool handles(Object *p_object) const override;
47+
48+
NavigationLink3DEditorPlugin();
49+
};

editor/plugins/gizmos/navigation_link_3d_gizmo_plugin.cpp renamed to modules/navigation_3d/editor/navigation_link_3d_gizmo_plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ void NavigationLink3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
204204
}
205205

206206
String NavigationLink3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {
207-
return p_id == 0 ? TTR("Start Location") : TTR("End Location");
207+
return p_id == 0 ? TTR("Start Position") : TTR("End Position");
208208
}
209209

210210
Variant NavigationLink3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p_gizmo, int p_id, bool p_secondary) const {

modules/navigation_3d/register_types.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#endif // DISABLE_DEPRECATED
3838

3939
#ifdef TOOLS_ENABLED
40+
#include "editor/navigation_link_3d_editor_plugin.h"
4041
#include "editor/navigation_obstacle_3d_editor_plugin.h"
4142
#include "editor/navigation_region_3d_editor_plugin.h"
4243
#endif
@@ -65,6 +66,7 @@ void initialize_navigation_3d_module(ModuleInitializationLevel p_level) {
6566

6667
#ifdef TOOLS_ENABLED
6768
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
69+
EditorPlugins::add_by_type<NavigationLink3DEditorPlugin>();
6870
EditorPlugins::add_by_type<NavigationRegion3DEditorPlugin>();
6971
EditorPlugins::add_by_type<NavigationObstacle3DEditorPlugin>();
7072
}

0 commit comments

Comments
 (0)