summaryrefslogtreecommitdiff
path: root/editor/animation_track_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/animation_track_editor.cpp')
-rw-r--r--editor/animation_track_editor.cpp35
1 files changed, 23 insertions, 12 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 91835c1866..ff2818f027 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -2555,17 +2555,17 @@ void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
ERR_FAIL_COND(p_event.is_null());
if (p_event->is_pressed()) {
- if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) {
+ if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->matches_event(p_event)) {
emit_signal(SNAME("duplicate_request"));
accept_event();
}
- if (ED_GET_SHORTCUT("animation_editor/duplicate_selection_transposed")->is_shortcut(p_event)) {
+ if (ED_GET_SHORTCUT("animation_editor/duplicate_selection_transposed")->matches_event(p_event)) {
emit_signal(SNAME("duplicate_transpose_request"));
accept_event();
}
- if (ED_GET_SHORTCUT("animation_editor/delete_selection")->is_shortcut(p_event)) {
+ if (ED_GET_SHORTCUT("animation_editor/delete_selection")->matches_event(p_event)) {
emit_signal(SNAME("delete_request"));
accept_event();
}
@@ -3418,6 +3418,7 @@ void AnimationTrackEditor::_query_insert(const InsertData &p_id) {
if (bool(EDITOR_DEF("editors/animation/confirm_insert_track", true))) {
//potential new key, does not exist
if (num_tracks == 1) {
+ // TRANSLATORS: %s will be replaced by a phrase describing the target of track.
insert_confirm_text->set_text(vformat(TTR("Create new track for %s and insert key?"), p_id.query));
} else {
insert_confirm_text->set_text(vformat(TTR("Create %d new tracks and insert keys?"), num_tracks));
@@ -3525,7 +3526,8 @@ void AnimationTrackEditor::insert_transform_key(Node3D *p_node, const String &p_
id.track_idx = track_idx;
id.value = p_xform;
id.type = Animation::TYPE_TRANSFORM3D;
- id.query = "node '" + p_node->get_name() + "'";
+ // TRANSLATORS: This describes the target of new animation track, will be inserted into another string.
+ id.query = vformat(TTR("node '%s'"), p_node->get_name());
id.advance = false;
//dialog insert
@@ -3547,7 +3549,8 @@ void AnimationTrackEditor::_insert_animation_key(NodePath p_path, const Variant
id.track_idx = i;
id.value = p_value;
id.type = Animation::TYPE_ANIMATION;
- id.query = "animation";
+ // TRANSLATORS: This describes the target of new animation track, will be inserted into another string.
+ id.query = TTR("animation");
id.advance = false;
//dialog insert
_query_insert(id);
@@ -3560,7 +3563,7 @@ void AnimationTrackEditor::_insert_animation_key(NodePath p_path, const Variant
id.track_idx = -1;
id.value = p_value;
id.type = Animation::TYPE_ANIMATION;
- id.query = "animation";
+ id.query = TTR("animation");
id.advance = false;
//dialog insert
_query_insert(id);
@@ -3609,7 +3612,8 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
id.track_idx = i;
id.value = p_value;
id.type = Animation::TYPE_VALUE;
- id.query = "property '" + p_property + "'";
+ // TRANSLATORS: This describes the target of new animation track, will be inserted into another string.
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = false;
//dialog insert
_query_insert(id);
@@ -3639,7 +3643,7 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
id.track_idx = i;
id.value = value;
id.type = Animation::TYPE_BEZIER;
- id.query = "property '" + p_property + "'";
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = false;
//dialog insert
_query_insert(id);
@@ -3655,7 +3659,7 @@ void AnimationTrackEditor::insert_node_value_key(Node *p_node, const String &p_p
id.track_idx = -1;
id.value = p_value;
id.type = Animation::TYPE_VALUE;
- id.query = "property '" + p_property + "'";
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = false;
//dialog insert
_query_insert(id);
@@ -3708,7 +3712,7 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari
id.track_idx = i;
id.value = p_value;
id.type = Animation::TYPE_VALUE;
- id.query = "property '" + p_property + "'";
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = p_advance;
//dialog insert
_query_insert(id);
@@ -3733,7 +3737,7 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari
id.track_idx = i;
id.value = value;
id.type = Animation::TYPE_BEZIER;
- id.query = "property '" + p_property + "'";
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = p_advance;
//dialog insert
_query_insert(id);
@@ -3747,7 +3751,7 @@ void AnimationTrackEditor::insert_value_key(const String &p_property, const Vari
id.track_idx = -1;
id.value = p_value;
id.type = Animation::TYPE_VALUE;
- id.query = "property '" + p_property + "'";
+ id.query = vformat(TTR("property '%s'"), p_property);
id.advance = p_advance;
//dialog insert
_query_insert(id);
@@ -5638,6 +5642,11 @@ float AnimationTrackEditor::snap_time(float p_value, bool p_relative) {
snap_increment = step->get_value();
}
+ if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
+ // Use more precise snapping when holding Shift.
+ snap_increment *= 0.25;
+ }
+
if (p_relative) {
double rel = Math::fmod(timeline->get_value(), snap_increment);
p_value = Math::snapped(p_value + rel, snap_increment) - rel;
@@ -5755,6 +5764,8 @@ void AnimationTrackEditor::_pick_track_filter_input(const Ref<InputEvent> &p_ie)
pick_track->get_scene_tree()->get_scene_tree()->call("_gui_input", k);
pick_track->get_filter_line_edit()->accept_event();
} break;
+ default:
+ break;
}
}
}