You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Make the alt selection menu available for all modes
This commit is contained in:
@@ -1566,7 +1566,7 @@ bool Node3DEditorViewport::_is_node_locked(const Node *p_node) const {
|
||||
|
||||
void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
|
||||
Vector<_RayResult> potential_selection_results;
|
||||
_find_items_at_pos(b->get_position(), potential_selection_results, spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
||||
_find_items_at_pos(b->get_position(), potential_selection_results, b->is_alt_pressed());
|
||||
|
||||
Node *edited_scene = EditorNode::get_singleton()->get_edited_scene();
|
||||
|
||||
@@ -1597,7 +1597,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
|
||||
selection_results.clear();
|
||||
|
||||
if (clicked.is_valid()) {
|
||||
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
||||
_select_clicked(b->is_alt_pressed());
|
||||
}
|
||||
} else if (!selection_results.is_empty()) {
|
||||
NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
|
||||
@@ -1716,33 +1716,33 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
} break;
|
||||
case MouseButton::RIGHT: {
|
||||
if (b->is_pressed() && _edit.gizmo.is_valid()) {
|
||||
//restore
|
||||
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
|
||||
_edit.gizmo = Ref<EditorNode3DGizmo>();
|
||||
}
|
||||
if (b->is_pressed()) {
|
||||
if (_edit.gizmo.is_valid()) {
|
||||
// Restore.
|
||||
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, true);
|
||||
_edit.gizmo = Ref<EditorNode3DGizmo>();
|
||||
}
|
||||
|
||||
if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) {
|
||||
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")) {
|
||||
break;
|
||||
} 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")) {
|
||||
break;
|
||||
} 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")) {
|
||||
break;
|
||||
if (_edit.mode == TRANSFORM_NONE) {
|
||||
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")) {
|
||||
break;
|
||||
} 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")) {
|
||||
break;
|
||||
} 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")) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (b->is_alt_pressed()) {
|
||||
_list_select(b);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (_edit.mode != TRANSFORM_NONE && b->is_pressed()) {
|
||||
cancel_transform();
|
||||
break;
|
||||
}
|
||||
if (_edit.mode != TRANSFORM_NONE) {
|
||||
cancel_transform();
|
||||
break;
|
||||
}
|
||||
|
||||
if (b->is_pressed()) {
|
||||
const Key mod = _get_key_modifier(b);
|
||||
if (!orthogonal) {
|
||||
if (mod == _get_key_modifier_setting("editors/3d/freelook/freelook_activation_modifier")) {
|
||||
@@ -3917,7 +3917,7 @@ void Node3DEditorViewport::_selection_result_pressed(int p_result) {
|
||||
clicked = selection_results_menu[p_result]->get_instance_id();
|
||||
|
||||
if (clicked.is_valid()) {
|
||||
_select_clicked(spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
||||
_select_clicked(true);
|
||||
}
|
||||
|
||||
selection_results_menu.clear();
|
||||
@@ -8679,7 +8679,7 @@ Node3DEditor::Node3DEditor() {
|
||||
tool_button[TOOL_MODE_SELECT]->connect(SceneStringName(pressed), callable_mp(this, &Node3DEditor::_menu_item_pressed).bind(MENU_TOOL_SELECT));
|
||||
tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), Key::Q));
|
||||
tool_button[TOOL_MODE_SELECT]->set_shortcut_context(this);
|
||||
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."));
|
||||
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.)"));
|
||||
main_menu_hbox->add_child(memnew(VSeparator));
|
||||
|
||||
tool_button[TOOL_MODE_MOVE] = memnew(Button);
|
||||
|
||||
Reference in New Issue
Block a user