Ported some missing changes.

This commit is contained in:
Relintai 2022-08-11 11:20:37 +02:00
parent 3cbdd9cfa1
commit aebf3ecc9d

View File

@ -1361,24 +1361,37 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
return; //do NONE
}
EditorPlugin::AfterGUIInput after = EditorPlugin::AFTER_GUI_INPUT_PASS;
{
EditorNode *en = editor;
EditorPluginList *force_input_forwarding_list = en->get_editor_plugins_force_input_forwarding();
if (!force_input_forwarding_list->empty()) {
bool discard = force_input_forwarding_list->forward_spatial_gui_input(camera, p_event, true);
if (discard) {
EditorPlugin::AfterGUIInput discard = force_input_forwarding_list->forward_spatial_gui_input(camera, p_event, true);
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
}
}
}
{
EditorNode *en = editor;
EditorPluginList *over_plugin_list = en->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
bool discard = over_plugin_list->forward_spatial_gui_input(camera, p_event, false);
if (discard) {
EditorPlugin::AfterGUIInput discard = over_plugin_list->forward_spatial_gui_input(camera, p_event, false);
if (discard == EditorPlugin::AFTER_GUI_INPUT_STOP) {
return;
}
if (discard == EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
after = EditorPlugin::AFTER_GUI_INPUT_DESELECT;
}
}
}
@ -1635,6 +1648,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
clicked = _select_ray(b->get_position());
//TODO is this needed?
@ -1650,6 +1664,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
cursor.region_begin = b->get_position();
cursor.region_end = b->get_position();
}
}
surface->update();
} else {
@ -1659,6 +1674,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
if (after != EditorPlugin::AFTER_GUI_INPUT_DESELECT) {
if (clicked) {
_select_clicked(false);
}
@ -1668,6 +1684,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
cursor.region_select = false;
surface->update();
}
}
selection_in_progress = false;
if (_edit.mode != TRANSFORM_NONE) {