summaryrefslogtreecommitdiff
path: root/editor/plugins/node_3d_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2023-02-24 22:00:15 +0100
committerGitHub <noreply@github.com>2023-02-24 22:00:15 +0100
commitdaedc158c70491ea3e5f3fea888c0799e61c0a80 (patch)
tree08043d7571e91c940c0e6cda2414c281fd3c7b0b /editor/plugins/node_3d_editor_plugin.cpp
parent6296b46008fb8d8e5cb9b60af05fa1ea26b8f600 (diff)
parentcebfc02d6f1deee4e0a8eafd444e9657a2a86807 (diff)
Merge pull request #73885 from bruvzg/popup_fix
Revert "Reordering emitted signals in PopupMenu" and fix editor selection issue in the safer way.
Diffstat (limited to 'editor/plugins/node_3d_editor_plugin.cpp')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 96f5aeedf0..6580340af4 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -1543,6 +1543,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path);
}
+ selection_results_menu = selection_results;
selection_menu->set_position(get_screen_position() + b->get_position());
selection_menu->reset_size();
selection_menu->popup();
@@ -3609,15 +3610,17 @@ void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
}
void Node3DEditorViewport::_selection_result_pressed(int p_result) {
- if (selection_results.size() <= p_result) {
+ if (selection_results_menu.size() <= p_result) {
return;
}
- clicked = selection_results[p_result].item->get_instance_id();
+ clicked = selection_results_menu[p_result].item->get_instance_id();
if (clicked.is_valid()) {
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
}
+
+ selection_results_menu.clear();
}
void Node3DEditorViewport::_selection_menu_hide() {