diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_dialog.cpp | 8 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 46 |
2 files changed, 20 insertions, 34 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 46518d387b..be01df76f7 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -1504,9 +1504,9 @@ EditorFileDialog::EditorFileDialog() { HBoxContainer *pathhb = memnew(HBoxContainer); dir_prev = memnew(ToolButton); - dir_prev->set_tooltip(TTR("Previous Folder")); + dir_prev->set_tooltip(TTR("Go to previous folder.")); dir_next = memnew(ToolButton); - dir_next->set_tooltip(TTR("Next Folder")); + dir_next->set_tooltip(TTR("Go to next folder.")); dir_up = memnew(ToolButton); dir_up->set_tooltip(TTR("Go to parent folder.")); @@ -1525,7 +1525,7 @@ EditorFileDialog::EditorFileDialog() { dir->set_h_size_flags(SIZE_EXPAND_FILL); refresh = memnew(ToolButton); - refresh->set_tooltip(TTR("Refresh")); + refresh->set_tooltip(TTR("Refresh files.")); refresh->connect("pressed", this, "_update_file_list"); pathhb->add_child(refresh); @@ -1538,7 +1538,7 @@ EditorFileDialog::EditorFileDialog() { show_hidden = memnew(ToolButton); show_hidden->set_toggle_mode(true); show_hidden->set_pressed(is_showing_hidden_files()); - show_hidden->set_tooltip(TTR("Toggle visibility of hidden files.")); + show_hidden->set_tooltip(TTR("Toggle the visibility of hidden files.")); show_hidden->connect("toggled", this, "set_show_hidden_files"); pathhb->add_child(show_hidden); diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 52fadf1e71..630f3ba9e1 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -1291,6 +1291,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 ray_pos = _get_ray_pos(m->get_position()); Vector3 ray = _get_ray(m->get_position()); + float snap = EDITOR_GET("interface/inspector/default_float_step"); + int snap_step_decimals = Math::range_step_decimals(snap); switch (_edit.mode) { @@ -1372,18 +1374,14 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_scale_snap() / 100; - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Scaling: ") + motion_snapped); - - } else { - set_message(TTR("Scaling: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + // This might not be necessary anymore after issue #288 is solved (in 4.0?). + set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1502,17 +1500,13 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { // Disable local transformation for TRANSFORM_VIEW bool local_coords = (spatial_editor->are_local_coords_enabled() && _edit.plane != TRANSFORM_VIEW); - float snap = 0; if (_edit.snap || spatial_editor->is_snap_enabled()) { - snap = spatial_editor->get_translate_snap(); - - Vector3 motion_snapped = motion; - motion_snapped.snap(Vector3(snap, snap, snap)); - set_message(TTR("Translating: ") + motion_snapped); - } else { - set_message(TTR("Translating: ") + motion); } + Vector3 motion_snapped = motion; + motion_snapped.snap(Vector3(snap, snap, snap)); + set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { @@ -1601,20 +1595,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) { float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center)); if (_edit.snap || spatial_editor->is_snap_enabled()) { - - float snap = spatial_editor->get_rotate_snap(); - - if (snap) { - angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 - angle -= Math::fmod(angle, snap); - set_message(vformat(TTR("Rotating %s degrees."), rtos(angle))); - angle = Math::deg2rad(angle); - } else - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); - - } else { - set_message(vformat(TTR("Rotating %s degrees."), rtos(Math::rad2deg(angle)))); + snap = spatial_editor->get_rotate_snap(); } + angle = Math::rad2deg(angle) + snap * 0.5; //else it won't reach +180 + angle -= Math::fmod(angle, snap); + set_message(vformat(TTR("Rotating %s degrees."), String::num(angle, snap_step_decimals))); + angle = Math::deg2rad(angle); List<Node *> &selection = editor_selection->get_selected_node_list(); |