Merge pull request #108987 from timothyqiu/plugins-list-cleanup

Clean up `EditorPluginList`
This commit is contained in:
Thaddeus Crews
2025-11-13 17:43:01 -06:00
7 changed files with 181 additions and 158 deletions
+27 -28
View File
@@ -45,6 +45,7 @@
#include "editor/editor_string_names.h"
#include "editor/editor_undo_redo_manager.h"
#include "editor/gui/editor_spin_slider.h"
#include "editor/plugins/editor_plugin_list.h"
#include "editor/run/editor_run_bar.h"
#include "editor/scene/3d/gizmos/audio_listener_3d_gizmo_plugin.h"
#include "editor/scene/3d/gizmos/audio_stream_player_3d_gizmo_plugin.h"
@@ -1767,28 +1768,33 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
EditorPlugin::AfterGUIInput after = EditorPlugin::AFTER_GUI_INPUT_PASS;
{
EditorNode *en = EditorNode::get_singleton();
EditorPluginList *force_input_forwarding_list = en->get_editor_plugins_force_input_forwarding();
if (!force_input_forwarding_list->is_empty()) {
EditorPlugin::AfterGUIInput discard = force_input_forwarding_list->forward_3d_gui_input(camera, p_event, true);
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
switch (en->get_editor_plugins_force_input_forwarding()->forward_3d_gui_input(camera, p_event, true)) {
case EditorPlugin::AFTER_GUI_INPUT_PASS: {
// Continue processing.
} break;
case EditorPlugin::AFTER_GUI_INPUT_STOP: {
return; // Stop processing.
} break;
case EditorPlugin::AFTER_GUI_INPUT_CUSTOM: {
after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
} break;
}
}
{
EditorNode *en = EditorNode::get_singleton();
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->is_empty()) {
EditorPlugin::AfterGUIInput discard = over_plugin_list->forward_3d_gui_input(camera, p_event, false);
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
if (discard == EditorPlugin::AFTER_GUI_INPUT_CUSTOM) {
switch (en->get_editor_plugins_over()->forward_3d_gui_input(camera, p_event, false)) {
case EditorPlugin::AFTER_GUI_INPUT_PASS: {
// Continue processing.
} break;
case EditorPlugin::AFTER_GUI_INPUT_STOP: {
return; // Stop processing.
} break;
case EditorPlugin::AFTER_GUI_INPUT_CUSTOM: {
after = EditorPlugin::AFTER_GUI_INPUT_CUSTOM;
}
} break;
}
}
@@ -3613,15 +3619,8 @@ static void draw_indicator_bar(Control &p_surface, real_t p_fill, const Ref<Text
}
void Node3DEditorViewport::_draw() {
EditorPluginList *over_plugin_list = EditorNode::get_singleton()->get_editor_plugins_over();
if (!over_plugin_list->is_empty()) {
over_plugin_list->forward_3d_draw_over_viewport(surface);
}
EditorPluginList *force_over_plugin_list = EditorNode::get_singleton()->get_editor_plugins_force_over();
if (!force_over_plugin_list->is_empty()) {
force_over_plugin_list->forward_3d_force_draw_over_viewport(surface);
}
EditorNode::get_singleton()->get_editor_plugins_over()->forward_3d_draw_over_viewport(surface);
EditorNode::get_singleton()->get_editor_plugins_force_over()->forward_3d_force_draw_over_viewport(surface);
if (surface->has_focus() || rotation_control->has_focus()) {
Size2 size = surface->get_size();