|
@@ -571,7 +571,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b
|
|
|
return closest;
|
|
|
}
|
|
|
|
|
|
-void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select) {
|
|
|
+void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select, bool p_include_locked_nodes) {
|
|
|
Vector3 ray = _get_ray(p_pos);
|
|
|
Vector3 pos = _get_ray_pos(p_pos);
|
|
|
|
|
@@ -614,6 +614,10 @@ void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_inclu
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
+ if (!p_include_locked_nodes && _is_node_locked(spat)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
if (editor_selection->is_selected(spat)) {
|
|
|
r_includes_current = true;
|
|
|
}
|
|
@@ -1034,7 +1038,7 @@ bool Node3DEditorViewport ::_is_node_locked(const Node *p_node) {
|
|
|
}
|
|
|
|
|
|
void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
|
|
|
- _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->is_shift_pressed());
|
|
|
+ _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->is_shift_pressed(), spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
|
|
|
|
|
Node *scene = editor->get_edited_scene();
|
|
|
|
|
@@ -1054,7 +1058,7 @@ void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
|
|
|
selection_results.clear();
|
|
|
|
|
|
if (clicked.is_valid()) {
|
|
|
- _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT);
|
|
|
+ _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
|
|
clicked = ObjectID();
|
|
|
}
|
|
|
|
|
@@ -3306,7 +3310,7 @@ void Node3DEditorViewport::_selection_result_pressed(int p_result) {
|
|
|
clicked = selection_results[p_result].item->get_instance_id();
|
|
|
|
|
|
if (clicked.is_valid()) {
|
|
|
- _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT);
|
|
|
+ _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT);
|
|
|
clicked = ObjectID();
|
|
|
}
|
|
|
}
|
|
@@ -6759,7 +6763,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
|
|
|
tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
|
|
|
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(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection"));
|
|
|
+ tool_button[TOOL_MODE_SELECT]->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Show list of all nodes at position clicked, including locked."));
|
|
|
|
|
|
hbc_menu->add_child(memnew(VSeparator));
|
|
|
|
|
@@ -6798,14 +6802,14 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
|
|
|
tool_button[TOOL_MODE_LIST_SELECT]->set_flat(true);
|
|
|
button_binds.write[0] = MENU_TOOL_LIST_SELECT;
|
|
|
tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
|
|
|
- tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode)."));
|
|
|
+ tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show list of selectable nodes at position clicked."));
|
|
|
|
|
|
tool_button[TOOL_LOCK_SELECTED] = memnew(Button);
|
|
|
hbc_menu->add_child(tool_button[TOOL_LOCK_SELECTED]);
|
|
|
tool_button[TOOL_LOCK_SELECTED]->set_flat(true);
|
|
|
button_binds.write[0] = MENU_LOCK_SELECTED;
|
|
|
tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
|
|
|
- tool_button[TOOL_LOCK_SELECTED]->set_tooltip(TTR("Lock the selected object in place (can't be moved)."));
|
|
|
+ tool_button[TOOL_LOCK_SELECTED]->set_tooltip(TTR("Lock selected node, preventing selection and movement."));
|
|
|
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
|
|
|
tool_button[TOOL_LOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/lock_selected_nodes", TTR("Lock Selected Node(s)"), KEY_MASK_CMD | KEY_L));
|
|
|
|
|
@@ -6814,7 +6818,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
|
|
|
tool_button[TOOL_UNLOCK_SELECTED]->set_flat(true);
|
|
|
button_binds.write[0] = MENU_UNLOCK_SELECTED;
|
|
|
tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
|
|
|
- tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock the selected object (can be moved)."));
|
|
|
+ tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock selected node, allowing selection and movement."));
|
|
|
// Define the shortcut globally (without a context) so that it works if the Scene tree dock is currently focused.
|
|
|
tool_button[TOOL_UNLOCK_SELECTED]->set_shortcut(ED_SHORTCUT("editor/unlock_selected_nodes", TTR("Unlock Selected Node(s)"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_L));
|
|
|
|