diff options
Diffstat (limited to 'editor/animation_track_editor.h')
-rw-r--r-- | editor/animation_track_editor.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 05cf91de1d..2a2b20ada9 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,8 +48,8 @@ #include "scene_tree_editor.h" class AnimationPlayer; - class AnimationTrackEdit; +class ViewPanner; class AnimationTimelineEdit : public Range { GDCLASS(AnimationTimelineEdit, Range); @@ -81,9 +81,11 @@ class AnimationTimelineEdit : public Range { bool editing; bool use_fps; - bool panning_timeline; - float panning_timeline_from; - float panning_timeline_at; + Ref<ViewPanner> panner; + void _scroll_callback(Vector2 p_scroll_vec); + void _pan_callback(Vector2 p_scroll_vec); + void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin); + bool dragging_timeline; bool dragging_hsize; float dragging_hsize_from; @@ -140,6 +142,7 @@ class AnimationTrackEdit : public Control { MENU_LOOP_CLAMP, MENU_KEY_INSERT, MENU_KEY_DUPLICATE, + MENU_KEY_ADD_RESET, MENU_KEY_DELETE }; AnimationTimelineEdit *timeline; @@ -159,7 +162,7 @@ class AnimationTrackEdit : public Control { Rect2 update_mode_rect; Rect2 interp_mode_rect; - Rect2 loop_mode_rect; + Rect2 loop_wrap_rect; Rect2 remove_rect; Rect2 bezier_edit_rect; @@ -373,6 +376,11 @@ class AnimationTrackEditor : public VBoxContainer { PropertyInfo _find_hint_for_track(int p_idx, NodePath &r_base_path, Variant *r_current_val = nullptr); + Ref<ViewPanner> panner; + void _scroll_callback(Vector2 p_scroll_vec); + void _pan_callback(Vector2 p_scroll_vec); + void _zoom_callback(Vector2 p_scroll_vec, Vector2 p_origin); + void _timeline_value_changed(double); float insert_key_from_track_call_ofs; @@ -466,6 +474,7 @@ class AnimationTrackEditor : public VBoxContainer { Animation::TrackType track_type = Animation::TrackType::TYPE_ANIMATION; Animation::InterpolationType interp_type = Animation::InterpolationType::INTERPOLATION_CUBIC; Animation::UpdateMode update_mode = Animation::UpdateMode::UPDATE_CAPTURE; + Animation::LoopMode loop_mode = Animation::LoopMode::LOOP_LINEAR; bool loop_wrap = false; bool enabled = false; @@ -499,6 +508,7 @@ public: EDIT_SCALE_CONFIRM, EDIT_DUPLICATE_SELECTION, EDIT_DUPLICATE_TRANSPOSED, + EDIT_ADD_RESET_KEY, EDIT_DELETE_SELECTION, EDIT_GOTO_NEXT_STEP, EDIT_GOTO_PREV_STEP, |