Actually register EditorInterface, SpatialEditor, CanvasItemEditor, and WebNodeEditor as globals.

This commit is contained in:
Relintai 2022-08-23 13:21:09 +02:00
parent 4f9dd569b8
commit bfc1679f14
4 changed files with 13 additions and 0 deletions

View File

@ -6786,6 +6786,7 @@ EditorNode::EditorNode() {
editor_interface = memnew(EditorInterface); editor_interface = memnew(EditorInterface);
add_child(editor_interface); add_child(editor_interface);
Engine::get_singleton()->add_global("EditorInterface", editor_interface);
//more visually meaningful to have this later //more visually meaningful to have this later
raise_bottom_panel_item(AnimationPlayerEditor::get_singleton()); raise_bottom_panel_item(AnimationPlayerEditor::get_singleton());
@ -6992,6 +6993,8 @@ EditorNode::EditorNode() {
} }
EditorNode::~EditorNode() { EditorNode::~EditorNode() {
Engine::get_singleton()->remove_global("EditorInterface");
EditorInspector::cleanup_plugins(); EditorInspector::cleanup_plugins();
remove_print_handler(&print_handler); remove_print_handler(&print_handler);

View File

@ -5818,9 +5818,12 @@ CanvasItemEditorPlugin::CanvasItemEditorPlugin(EditorNode *p_node) {
editor->get_viewport()->add_child(canvas_item_editor); editor->get_viewport()->add_child(canvas_item_editor);
canvas_item_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE); canvas_item_editor->set_anchors_and_margins_preset(Control::PRESET_WIDE);
canvas_item_editor->hide(); canvas_item_editor->hide();
Engine::get_singleton()->add_global("CanvasItemEditor", canvas_item_editor);
} }
CanvasItemEditorPlugin::~CanvasItemEditorPlugin() { CanvasItemEditorPlugin::~CanvasItemEditorPlugin() {
Engine::get_singleton()->remove_global("CanvasItemEditor");
} }
void CanvasItemEditorViewport::_on_mouse_exit() { void CanvasItemEditorViewport::_on_mouse_exit() {

View File

@ -7590,7 +7590,10 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) {
spatial_editor->hide(); spatial_editor->hide();
spatial_editor->connect("transform_key_request", editor->get_inspector_dock(), "_transform_keyed"); spatial_editor->connect("transform_key_request", editor->get_inspector_dock(), "_transform_keyed");
Engine::get_singleton()->add_global("SpatialEditor", spatial_editor);
} }
SpatialEditorPlugin::~SpatialEditorPlugin() { SpatialEditorPlugin::~SpatialEditorPlugin() {
Engine::get_singleton()->remove_global("SpatialEditor");
} }

View File

@ -21,6 +21,7 @@ SOFTWARE.
*/ */
#include "web_editor_plugin.h" #include "web_editor_plugin.h"
#include "core/config/engine.h"
#include "../http/web_node.h" #include "../http/web_node.h"
#include "web_editor.h" #include "web_editor.h"
@ -139,9 +140,12 @@ WebEditorPlugin::WebEditorPlugin(EditorNode *p_node) {
make_visible(false); make_visible(false);
_scene_has_webnode = false; _scene_has_webnode = false;
Engine::get_singleton()->add_global("WebNodeEditor", window);
} }
WebEditorPlugin::~WebEditorPlugin() { WebEditorPlugin::~WebEditorPlugin() {
Engine::get_singleton()->remove_global("WebNodeEditor");
} }
void WebEditorPlugin::_notification(int p_what) { void WebEditorPlugin::_notification(int p_what) {