Skip to content

Commit 5d70208

Browse files
committed
Make the alt selection menu available for all modes
1 parent 9aed9ec commit 5d70208

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

editor/plugins/canvas_item_editor_plugin.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,12 +2358,12 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
23582358

23592359
if (drag_type == DRAG_NONE || (drag_type == DRAG_BOX_SELECTION && b.is_valid() && !b->is_pressed())) {
23602360
if (b.is_valid() && b->is_pressed() &&
2361-
((b->get_button_index() == MouseButton::RIGHT && b->is_alt_pressed() && tool == TOOL_SELECT) ||
2361+
((b->get_button_index() == MouseButton::RIGHT && b->is_alt_pressed()) ||
23622362
(b->get_button_index() == MouseButton::LEFT && tool == TOOL_LIST_SELECT))) {
23632363
// Popup the selection menu list
23642364
Point2 click = transform.affine_inverse().xform(b->get_position());
23652365

2366-
_get_canvas_items_at_pos(click, selection_results, b->is_alt_pressed() && tool == TOOL_SELECT);
2366+
_get_canvas_items_at_pos(click, selection_results, b->is_alt_pressed());
23672367

23682368
if (selection_results.size() == 1) {
23692369
CanvasItem *item = selection_results[0].item;
@@ -5358,7 +5358,7 @@ CanvasItemEditor::CanvasItemEditor() {
53585358
select_button->set_pressed(true);
53595359
select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q));
53605360
select_button->set_shortcut_context(this);
5361-
select_button->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+Drag: Scale selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("RMB: Add node at position clicked."));
5361+
select_button->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Alt+Drag: Scale selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)") + "\n" + TTR("RMB: Add node at position clicked."));
53625362

53635363
main_menu_hbox->add_child(memnew(VSeparator));
53645364

editor/plugins/node_3d_editor_plugin.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ bool Node3DEditorViewport::_is_node_locked(const Node *p_node) const {
15661566

15671567
void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
15681568
Vector<_RayResult> potential_selection_results;
1569-
_find_items_at_pos(b->get_position(), potential_selection_results, spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
1569+
_find_items_at_pos(b->get_position(), potential_selection_results, b->is_alt_pressed());
15701570

15711571
Node *edited_scene = EditorNode::get_singleton()->get_edited_scene();
15721572

@@ -1597,7 +1597,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
15971597
selection_results.clear();
15981598

15991599
if (clicked.is_valid()) {
1600-
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
1600+
_select_clicked(b->is_alt_pressed());
16011601
}
16021602
} else if (!selection_results.is_empty()) {
16031603
NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
@@ -1716,33 +1716,33 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
17161716
}
17171717
} break;
17181718
case MouseButton::RIGHT: {
1719-
if (b->is_pressed() && _edit.gizmo.is_valid()) {
1720-
//restore
1721-
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
1722-
_edit.gizmo = Ref<EditorNode3DGizmo>();
1723-
}
1719+
if (b->is_pressed()) {
1720+
if (_edit.gizmo.is_valid()) {
1721+
// Restore.
1722+
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
1723+
_edit.gizmo = Ref<EditorNode3DGizmo>();
1724+
}
17241725

1725-
if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) {
1726-
if (orbit_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_2")) {
1727-
break;
1728-
} else if (pan_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_2")) {
1729-
break;
1730-
} else if (zoom_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_2")) {
1731-
break;
1726+
if (_edit.mode == TRANSFORM_NONE) {
1727+
if (orbit_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_orbit_modifier_2")) {
1728+
break;
1729+
} else if (pan_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_pan_modifier_2")) {
1730+
break;
1731+
} else if (zoom_mouse_preference == NAVIGATION_RIGHT_MOUSE && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_1") && _is_nav_modifier_pressed("spatial_editor/viewport_zoom_modifier_2")) {
1732+
break;
1733+
}
17321734
}
17331735

17341736
if (b->is_alt_pressed()) {
17351737
_list_select(b);
17361738
return;
17371739
}
1738-
}
17391740

1740-
if (_edit.mode != TRANSFORM_NONE && b->is_pressed()) {
1741-
cancel_transform();
1742-
break;
1743-
}
1741+
if (_edit.mode != TRANSFORM_NONE) {
1742+
cancel_transform();
1743+
break;
1744+
}
17441745

1745-
if (b->is_pressed()) {
17461746
const Key mod = _get_key_modifier(b);
17471747
if (!orthogonal) {
17481748
if (mod == _get_key_modifier_setting("editors/3d/freelook/freelook_activation_modifier")) {
@@ -3917,7 +3917,7 @@ void Node3DEditorViewport::_selection_result_pressed(int p_result) {
39173917
clicked = selection_results_menu[p_result]->get_instance_id();
39183918

39193919
if (clicked.is_valid()) {
3920-
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
3920+
_select_clicked(true);
39213921
}
39223922

39233923
selection_results_menu.clear();
@@ -8679,7 +8679,7 @@ Node3DEditor::Node3DEditor() {
86798679
tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT));
86808680
tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q));
86818681
tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this);
8682-
tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked."));
8682+
tool_button[TOOL_MODE_SELECT]->set_tooltip_text(keycode_get_string((Key)KeyModifierMask::CMD_OR_CTRL) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + TTR("(Available in all modes.)"));
86838683
main_menu_hbox->add_child(memnew(VSeparator));
86848684

86858685
tool_button[TOOL_MODE_MOVE] = memnew(Button);

0 commit comments

Comments
 (0)