1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

Merge pull request #54524 from Calinou/animation-editor-add-bypass-confirmation

Skip keyframe creation dialog when holding Shift in the animation editor
This commit is contained in:
Yuri Sizov
2023-07-26 18:39:01 +02:00
3 changed files with 5 additions and 7 deletions

View File

@@ -3632,13 +3632,15 @@ void AnimationTrackEditor::commit_insert_queue() {
}
}
if (bool(EDITOR_GET("editors/animation/confirm_insert_track")) && num_tracks > 0) {
// Skip the confirmation dialog if the user holds Shift while clicking the key icon.
if (!Input::get_singleton()->is_key_pressed(Key::SHIFT) && num_tracks > 0) {
String shortcut_hint = TTR("Hold Shift when clicking the key icon to skip this dialog.");
// Potentially a 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?"), last_track_query));
insert_confirm_text->set_text(vformat(TTR("Create new track for %s and insert key?") + "\n\n" + shortcut_hint, last_track_query));
} else {
insert_confirm_text->set_text(vformat(TTR("Create %d new tracks and insert keys?"), num_tracks));
insert_confirm_text->set_text(vformat(TTR("Create %d new tracks and insert keys?") + "\n\n" + shortcut_hint, num_tracks));
}
insert_confirm_bezier->set_visible(all_bezier);