diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-07-26 18:39:01 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-07-26 18:39:01 +0200 |
commit | 3bc842b1b129b379d8e73bb21660e9bb6b0f79f8 (patch) | |
tree | b64fc735d121be27159859c4bd6a021f4a2f1760 | |
parent | 202e4b2c1e7f8b25738b93d0e4d5066453d3edf3 (diff) | |
parent | 5e117ee7bfe55d2c2d559fc8e0ed99de86ea29fe (diff) | |
download | redot-engine-3bc842b1b129b379d8e73bb21660e9bb6b0f79f8.tar.gz |
Merge pull request #54524 from Calinou/animation-editor-add-bypass-confirmation
Skip keyframe creation dialog when holding Shift in the animation editor
-rw-r--r-- | doc/classes/EditorSettings.xml | 3 | ||||
-rw-r--r-- | editor/animation_track_editor.cpp | 8 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 1 |
3 files changed, 5 insertions, 7 deletions
diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 0c6fa2923f..85efe4362e 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -389,9 +389,6 @@ <member name="editors/animation/autorename_animation_tracks" type="bool" setter="" getter=""> If [code]true[/code], automatically updates animation tracks' target paths when renaming or reparenting nodes in the Scene tree dock. </member> - <member name="editors/animation/confirm_insert_track" type="bool" setter="" getter=""> - If [code]true[/code], display a confirmation dialog when adding a new track to an animation by pressing the "key" icon next to a property. - </member> <member name="editors/animation/default_create_bezier_tracks" type="bool" setter="" getter=""> If [code]true[/code], create a Bezier track instead of a standard track when pressing the "key" icon next to a property. Bezier tracks provide more control over animation curves, but are more difficult to adjust quickly. </member> diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 69728133f8..3aa3aa567b 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -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); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 40ae6608d4..4398423529 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -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)); |