diff --git a/editor/scene/3d/node_3d_editor_plugin.cpp b/editor/scene/3d/node_3d_editor_plugin.cpp index 3512210012..dd216b43f3 100644 --- a/editor/scene/3d/node_3d_editor_plugin.cpp +++ b/editor/scene/3d/node_3d_editor_plugin.cpp @@ -3572,8 +3572,7 @@ void Node3DEditorViewport::_notification(int p_what) { if (!ruler->is_inside_tree()) { double snap = EDITOR_GET("interface/inspector/default_float_step"); int snap_step_decimals = Math::range_step_decimals(snap); - set_message(TTR("Translating:") + " (" + String::num(selected_node->get_global_position().x, snap_step_decimals) + ", " + - String::num(selected_node->get_global_position().y, snap_step_decimals) + ", " + String::num(selected_node->get_global_position().z, snap_step_decimals) + ")"); + set_message(vformat(TTR("Translating: %s"), vformat("%.*v", snap_step_decimals, selected_node->get_global_position()))); } selected_node->set_global_position(spatial_editor->snap_point(_get_instance_position(_edit.mouse_pos, selected_node))); @@ -3594,8 +3593,7 @@ void Node3DEditorViewport::_notification(int p_what) { preview_node_pos = spatial_editor->snap_point(_get_instance_position(preview_node_viewport_pos, preview_node)); double snap = EDITOR_GET("interface/inspector/default_float_step"); int snap_step_decimals = Math::range_step_decimals(snap); - set_message(TTR("Instantiating:") + " (" + String::num(preview_node_pos.x, snap_step_decimals) + ", " + - String::num(preview_node_pos.y, snap_step_decimals) + ", " + String::num(preview_node_pos.z, snap_step_decimals) + ")"); + set_message(vformat(TTR("Instantiating: %s"), vformat("%.*v", snap_step_decimals, preview_node_pos))); Transform3D preview_gl_transform = Transform3D(Basis(), preview_node_pos); preview_node->set_global_transform(preview_gl_transform); if (!preview_node->is_visible()) { @@ -5650,8 +5648,23 @@ void Node3DEditorViewport::begin_transform(TransformMode p_mode, bool instant) { _edit.accumulated_rotation_angle = 0.0; _edit.display_rotation_angle = 0.0; _edit.gizmo_initiated = false; + switch (p_mode) { + case TRANSFORM_ROTATE: + _edit.show_rotation_line = true; + set_message(vformat(TTR("Rotating %s degrees."), String::num(0, 0))); + break; + case TRANSFORM_TRANSLATE: + set_message(vformat(TTR("Translating: %s"), vformat("%.0v", Vector3()))); + break; + case TRANSFORM_SCALE: + set_message(vformat(TTR("Scaling: %s"), vformat("%.0v", Vector3()))); + break; + default: + break; + } update_transform_gizmo_view(); set_process_input(instant); + surface->queue_redraw(); } } @@ -5827,8 +5840,7 @@ void Node3DEditorViewport::update_transform(bool p_shift) { motion_snapped.snapf(snap); // This might not be necessary anymore after issue #288 is solved (in 4.0?). // TRANSLATORS: Refers to changing the scale of a node in the 3D editor. - 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) + ")"); + set_message(vformat(TTR("Scaling: %s"), vformat("%.*v", snap_step_decimals, motion_snapped))); if (local_coords) { // TODO: needed? motion = _edit.original.basis.inverse().xform(motion); @@ -5895,8 +5907,7 @@ void Node3DEditorViewport::update_transform(bool p_shift) { Vector3 motion_snapped = motion; motion_snapped.snapf(snap); // TRANSLATORS: Refers to changing the position of a node in the 3D editor. - 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) + ")"); + set_message(vformat(TTR("Translating: %s"), vformat("%.*v", snap_step_decimals, motion_snapped))); if (local_coords) { motion = spatial_editor->get_gizmo_transform().basis.inverse().xform(motion); }