summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-05 15:07:29 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-05 15:07:29 +0200
commitd2fc2a35b3de255a4ef7f64f1856ea0ce325c19e (patch)
tree472eae530ea66b76254f1b0497d74bf93c9489fd /editor
parent4f953cc8ab3a57f767f8da1c2e1b0ba8dc9bba30 (diff)
parent21345defe9c0c0da84bed9ae65067904a664f574 (diff)
downloadredot-engine-d2fc2a35b3de255a4ef7f64f1856ea0ce325c19e.tar.gz
Merge pull request #92985 from KoBeWi/confirm_insert_shift
Restore "Confirm Insert Track" editor setting
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp16
-rw-r--r--editor/editor_settings.cpp1
2 files changed, 13 insertions, 4 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 9c7c275053..6810b802a1 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -3867,15 +3867,23 @@ void AnimationTrackEditor::commit_insert_queue() {
}
// 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.");
+ // If `confirm_insert_track` editor setting is disabled, the behavior is reversed.
+ bool confirm_insert = EDITOR_GET("editors/animation/confirm_insert_track");
+ if ((Input::get_singleton()->is_key_pressed(Key::SHIFT) != confirm_insert) && num_tracks > 0) {
+ String dialog_text;
+
// 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?") + "\n\n" + shortcut_hint, last_track_query));
+ dialog_text = vformat(TTR("Create new track for %s and insert key?"), last_track_query);
} else {
- insert_confirm_text->set_text(vformat(TTR("Create %d new tracks and insert keys?") + "\n\n" + shortcut_hint, num_tracks));
+ dialog_text = vformat(TTR("Create %d new tracks and insert keys?"), num_tracks);
+ }
+
+ if (confirm_insert) {
+ dialog_text += +"\n\n" + TTR("Hold Shift when clicking the key icon to skip this dialog.");
}
+ insert_confirm_text->set_text(dialog_text);
insert_confirm_bezier->set_visible(all_bezier);
insert_confirm_reset->set_visible(reset_allowed);
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 85e60df1dd..5d3cc80da9 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -786,6 +786,7 @@ 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));