diff --git a/assets/graphics/timeline/copy_tag.png b/assets/graphics/timeline/copy_tag.png new file mode 100644 index 000000000..d906d0e79 Binary files /dev/null and b/assets/graphics/timeline/copy_tag.png differ diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 0c2d518b2..a2b558c8f 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -206,6 +206,7 @@ onready var play_backwards: BaseButton = animation_timeline.find_node("PlayBackw onready var remove_frame_button: BaseButton = animation_timeline.find_node("DeleteFrame") onready var move_left_frame_button: BaseButton = animation_timeline.find_node("MoveLeft") onready var move_right_frame_button: BaseButton = animation_timeline.find_node("MoveRight") +onready var copy_tag_button: BaseButton = animation_timeline.find_node("CopyTag") onready var remove_layer_button: BaseButton = animation_timeline.find_node("RemoveLayer") onready var move_up_layer_button: BaseButton = animation_timeline.find_node("MoveUpLayer") onready var move_down_layer_button: BaseButton = animation_timeline.find_node("MoveDownLayer") diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index 11f232598..539c79e26 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -161,7 +161,7 @@ func change_project() -> void: Global.animation_timeline.project_changed() Global.current_frame_mark_label.text = "%s/%s" % [str(current_frame + 1), frames.size()] - + Global.disable_button(Global.copy_tag_button, animation_tags.size() == 0) Global.disable_button(Global.remove_frame_button, frames.size() == 1) Global.disable_button(Global.move_left_frame_button, frames.size() == 1 or current_frame == 0) Global.disable_button( @@ -540,6 +540,7 @@ func change_cel(new_frame: int, new_layer := -1) -> void: func toggle_frame_buttons() -> void: Global.disable_button(Global.remove_frame_button, frames.size() == 1) Global.disable_button(Global.move_left_frame_button, frames.size() == 1 or current_frame == 0) + Global.disable_button(Global.copy_tag_button, animation_tags.size() == 0) Global.disable_button( Global.move_right_frame_button, frames.size() == 1 or current_frame == frames.size() - 1 ) diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index d0fd169f7..f06941f86 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -395,7 +395,7 @@ func _on_TagList_id_pressed(id: int) -> void: var frames = [] for i in range(tag.from - 1, tag.to): frames.append(i) - copy_frames(frames, Global.current_project.current_frame - 1) + copy_frames(frames, Global.current_project.current_frame) func _on_FrameTagButton_pressed() -> void: diff --git a/src/UI/Timeline/AnimationTimeline.tscn b/src/UI/Timeline/AnimationTimeline.tscn index fe87247aa..1b7f2b419 100644 --- a/src/UI/Timeline/AnimationTimeline.tscn +++ b/src/UI/Timeline/AnimationTimeline.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=44 format=2] +[gd_scene load_steps=45 format=2] [ext_resource path="res://src/UI/Timeline/AnimationTimeline.gd" type="Script" id=1] [ext_resource path="res://assets/graphics/layers/new.png" type="Texture" id=2] @@ -11,6 +11,7 @@ [ext_resource path="res://src/UI/Nodes/ValueSlider.tscn" type="PackedScene" id=9] [ext_resource path="res://assets/graphics/misc/value_arrow.svg" type="Texture" id=10] [ext_resource path="res://src/UI/Timeline/FrameScrollContainer.gd" type="Script" id=11] +[ext_resource path="res://assets/graphics/timeline/copy_tag.png" type="Texture" id=12] [ext_resource path="res://assets/graphics/timeline/new_frame.png" type="Texture" id=19] [ext_resource path="res://assets/graphics/timeline/remove_frame.png" type="Texture" id=20] [ext_resource path="res://assets/graphics/timeline/go_to_first_frame.png" type="Texture" id=21] @@ -427,11 +428,13 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -margin_left = -5.0 +margin_left = -10.0 margin_top = -7.0 -margin_right = 5.0 +margin_right = 10.0 margin_bottom = 7.0 -texture = ExtResource( 27 ) +texture = ExtResource( 12 ) +expand = true +stretch_mode = 6 [node name="TagList" type="PopupMenu" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/CopyTag"] unique_name_in_owner = true diff --git a/src/UI/Timeline/FrameTagDialog.gd b/src/UI/Timeline/FrameTagDialog.gd index b4bfc24b2..370104ac1 100644 --- a/src/UI/Timeline/FrameTagDialog.gd +++ b/src/UI/Timeline/FrameTagDialog.gd @@ -57,6 +57,7 @@ func _on_FrameTagDialog_about_to_show() -> void: func _on_FrameTagDialog_popup_hide() -> void: Global.dialog_open(false) + Global.current_project.toggle_frame_buttons() func _on_AddTag_pressed() -> void: