Skip to content

Commit 60c6c4a

Browse files
committed
Merge pull request #99795 from YeldhamDev/selection_menu_for_all!
Make the alt selection menu available for all modes
2 parents 9048776 + 5d70208 commit 60c6c4a

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

editor/plugins/canvas_item_editor_plugin.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2368,12 +2368,12 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
23682368

23692369
if (drag_type == DRAG_NONE || (drag_type == DRAG_BOX_SELECTION && b.is_valid() && !b->is_pressed())) {
23702370
if (b.is_valid() && b->is_pressed() &&
2371-
((b->get_button_index() == MouseButton::RIGHT && b->is_alt_pressed() && tool == TOOL_SELECT) ||
2371+
((b->get_button_index() == MouseButton::RIGHT && b->is_alt_pressed()) ||
23722372
(b->get_button_index() == MouseButton::LEFT && tool == TOOL_LIST_SELECT))) {
23732373
// Popup the selection menu list
23742374
Point2 click = transform.affine_inverse().xform(b->get_position());
23752375

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

23782378
if (selection_results.size() == 1) {
23792379
CanvasItem *item = selection_results[0].item;
@@ -5376,7 +5376,7 @@ CanvasItemEditor::CanvasItemEditor() {
53765376
select_button->set_pressed(true);
53775377
select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q));
53785378
select_button->set_shortcut_context(this);
5379-
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."));
5379+
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."));
53805380

53815381
main_menu_hbox->add_child(memnew(VSeparator));
53825382

editor/plugins/node_3d_editor_plugin.cpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ bool Node3DEditorViewport::_is_node_locked(const Node *p_node) const {
15671567

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

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

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

16001600
if (clicked.is_valid()) {
1601-
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
1601+
_select_clicked(b->is_alt_pressed());
16021602
}
16031603
} else if (!selection_results.is_empty()) {
16041604
NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
@@ -1717,33 +1717,33 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
17171717
}
17181718
} break;
17191719
case MouseButton::RIGHT: {
1720-
if (b->is_pressed() && _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-
}
1720+
if (b->is_pressed()) {
1721+
if (_edit.gizmo.is_valid()) {
1722+
// Restore.
1723+
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
1724+
_edit.gizmo = Ref<EditorNode3DGizmo>();
1725+
}
17251726

1726-
if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) {
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;
1727+
if (_edit.mode == TRANSFORM_NONE) {
1728+
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")) {
1729+
break;
1730+
} 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")) {
1731+
break;
1732+
} 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")) {
1733+
break;
1734+
}
17331735
}
17341736

17351737
if (b->is_alt_pressed()) {
17361738
_list_select(b);
17371739
return;
17381740
}
1739-
}
17401741

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

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

39383938
if (clicked.is_valid()) {
3939-
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
3939+
_select_clicked(true);
39403940
}
39413941

39423942
selection_results_menu.clear();
@@ -8698,7 +8698,7 @@ Node3DEditor::Node3DEditor() {
86988698
tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT));
86998699
tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q));
87008700
tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this);
8701-
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."));
8701+
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.)"));
87028702
main_menu_hbox->add_child(memnew(VSeparator));
87038703

87048704
tool_button[TOOL_MODE_MOVE] = memnew(Button);

0 commit comments

Comments
 (0)