Add toggle to insert keys/markers at current time or mouse position

Adds a new editor setting editors/animation/insert_at_current_time and a toggle button in the Animation Track Editor to let users choose whether to insert keys and markers at the current timeline cursor (when enabled) or at the mouse position (default behavior).

- Key insertion
- Paste and duplicate operations
- Editor setting persistence
- Icon by @TokageItLab

Fixes #103272
This commit is contained in:
shadow-foss
2025-06-14 03:43:11 +05:30
parent c6d130abd9
commit c5490f7284
5 changed files with 38 additions and 2 deletions

View File

@ -613,6 +613,7 @@ class AnimationTrackEditor : public VBoxContainer {
Label *nearest_fps_label = nullptr;
TextureRect *zoom_icon = nullptr;
Button *snap_keys = nullptr;
Button *insert_at_current_time = nullptr;
Button *snap_timeline = nullptr;
Button *bezier_edit_icon = nullptr;
OptionButton *snap_mode = nullptr;
@ -954,6 +955,8 @@ public:
bool is_moving_selection() const;
bool is_snap_timeline_enabled() const;
bool is_snap_keys_enabled() const;
bool is_insert_at_current_time_enabled() const;
void resolve_insertion_offset(float &r_offset) const;
bool is_bezier_editor_active() const;
bool can_add_reset_key() const;
void _on_filter_updated(const String &p_filter);