Skip to content

Commit

Permalink
Skip keyframe creation dialog when holding Shift in the animation editor
Browse files Browse the repository at this point in the history
The editor setting to always bypass the confirmation dialog was removed,
since the new shortcut effectively supersedes it in a more granular way.
  • Loading branch information
Calinou committed Jul 17, 2023
1 parent 851bc64 commit 4492990
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions editor/animation_track_editor.cpp
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion editor/editor_settings.cpp
Expand Up @@ -709,7 +709,6 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {

// Animation
_initial_set("editors/animation/autorename_animation_tracks", true);
_initial_set("editors/animation/confirm_insert_track", true);
_initial_set("editors/animation/default_create_bezier_tracks", false);
_initial_set("editors/animation/default_create_reset_tracks", true);
_initial_set("editors/animation/onion_layers_past_color", Color(1, 0, 0));
Expand Down

0 comments on commit 4492990

Please sign in to comment.