diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 1d7c98030..7b58581e5 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -1407,3 +1407,9 @@ msgstr "" msgid "and" msgstr "" + +msgid "Move the selected frame to the left." +msgstr "" + +msgid "Move the selected frame to the right." +msgstr "" diff --git a/assets/graphics/dark_themes/timeline/move_arrow.png b/assets/graphics/dark_themes/timeline/move_arrow.png new file mode 100644 index 000000000..fc8ed305f Binary files /dev/null and b/assets/graphics/dark_themes/timeline/move_arrow.png differ diff --git a/assets/graphics/dark_themes/timeline/move_arrow.png.import b/assets/graphics/dark_themes/timeline/move_arrow.png.import new file mode 100644 index 000000000..7e2fe653e --- /dev/null +++ b/assets/graphics/dark_themes/timeline/move_arrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/move_arrow.png-a7e1075bf6415244d8e7290d244180b2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/dark_themes/timeline/move_arrow.png" +dest_files=[ "res://.import/move_arrow.png-a7e1075bf6415244d8e7290d244180b2.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/assets/graphics/light_themes/timeline/move_arrow.png b/assets/graphics/light_themes/timeline/move_arrow.png new file mode 100644 index 000000000..5050ce3f7 Binary files /dev/null and b/assets/graphics/light_themes/timeline/move_arrow.png differ diff --git a/assets/graphics/light_themes/timeline/move_arrow.png.import b/assets/graphics/light_themes/timeline/move_arrow.png.import new file mode 100644 index 000000000..1a856669b --- /dev/null +++ b/assets/graphics/light_themes/timeline/move_arrow.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/move_arrow.png-5ac1f48e226beb6e78d77de0e04d0b5e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/light_themes/timeline/move_arrow.png" +dest_files=[ "res://.import/move_arrow.png-5ac1f48e226beb6e78d77de0e04d0b5e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/src/UI/Timeline/AnimationTimeline.gd b/src/UI/Timeline/AnimationTimeline.gd index 0264bf7b7..247d0797c 100644 --- a/src/UI/Timeline/AnimationTimeline.gd +++ b/src/UI/Timeline/AnimationTimeline.gd @@ -166,6 +166,17 @@ func _on_CopyFrame_pressed(frame := -1) -> void: func _on_FrameTagButton_pressed() -> void: Global.tag_dialog.popup_centered() +func _on_MoveLeft_pressed() -> void: + var frame : int = Global.current_project.current_frame + if frame == 0: + return + Global.current_project.layers[Global.current_project.current_layer].frame_container.get_child(frame).change_frame_order(-1) + +func _on_MoveRight_pressed() -> void: + var frame : int = Global.current_project.current_frame + if frame == last_frame: + return + Global.current_project.layers[Global.current_project.current_layer].frame_container.get_child(frame).change_frame_order(1) func _on_OnionSkinning_pressed() -> void: Global.onion_skinning = !Global.onion_skinning @@ -176,7 +187,6 @@ func _on_OnionSkinning_pressed() -> void: else: Global.change_button_texturerect(texture_button, "onion_skinning_off.png") - func _on_OnionSkinningSettings_pressed() -> void: $OnionSkinningSettings.popup(Rect2(Global.onion_skinning_button.rect_global_position.x - $OnionSkinningSettings.rect_size.x - 16, Global.onion_skinning_button.rect_global_position.y - 106, 136, 126)) @@ -474,3 +484,4 @@ func _on_OpacitySlider_value_changed(value) -> void: func _on_OnionSkinningSettings_popup_hide() -> void: Global.can_draw = true + diff --git a/src/UI/Timeline/AnimationTimeline.tscn b/src/UI/Timeline/AnimationTimeline.tscn index f2d8b2f11..d05cf4225 100644 --- a/src/UI/Timeline/AnimationTimeline.tscn +++ b/src/UI/Timeline/AnimationTimeline.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=43 format=2] +[gd_scene load_steps=44 format=2] [ext_resource path="res://src/UI/Timeline/AnimationTimeline.gd" type="Script" id=1] [ext_resource path="res://assets/graphics/dark_themes/layers/new_layer.png" type="Texture" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://assets/graphics/dark_themes/layers/move_down_disabled.png" type="Texture" id=5] [ext_resource path="res://assets/graphics/dark_themes/layers/merge_down_disabled.png" type="Texture" id=6] [ext_resource path="res://assets/graphics/dark_themes/layers/clone_layer.png" type="Texture" id=7] +[ext_resource path="res://assets/graphics/dark_themes/timeline/move_arrow.png" type="Texture" id=8] [ext_resource path="res://src/UI/Timeline/LayerButton.tscn" type="PackedScene" id=18] [ext_resource path="res://assets/graphics/dark_themes/timeline/new_frame.png" type="Texture" id=19] [ext_resource path="res://assets/graphics/dark_themes/timeline/remove_frame.png" type="Texture" id=20] @@ -319,19 +320,19 @@ __meta__ = { [node name="Control" type="Control" parent="AnimationContainer/TimelineContainer/TimelineButtons"] margin_left = 225.0 -margin_right = 434.0 +margin_right = 386.0 margin_bottom = 38.0 size_flags_horizontal = 3 [node name="PanelContainer" type="PanelContainer" parent="AnimationContainer/TimelineContainer/TimelineButtons"] -margin_left = 438.0 +margin_left = 390.0 margin_right = 902.0 margin_bottom = 38.0 [node name="AnimationButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer"] margin_left = 7.0 margin_top = 7.0 -margin_right = 457.0 +margin_right = 505.0 margin_bottom = 31.0 rect_min_size = Vector2( 0, 24 ) size_flags_horizontal = 3 @@ -339,7 +340,7 @@ custom_constants/separation = 40 alignment = 2 [node name="FrameButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons"] -margin_right = 92.0 +margin_right = 140.0 margin_bottom = 24.0 [node name="AddFrame" type="Button" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons" groups=[ @@ -455,9 +456,64 @@ __meta__ = { "_edit_use_anchors_": false } +[node name="MoveLeft" type="Button" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons" groups=[ +"UIButtons", +]] +margin_left = 96.0 +margin_top = 2.0 +margin_right = 116.0 +margin_bottom = 22.0 +rect_min_size = Vector2( 20, 0 ) +hint_tooltip = "Move the selected frame to the left." +mouse_default_cursor_shape = 2 +size_flags_horizontal = 0 +size_flags_vertical = 4 + +[node name="TextureRect" type="TextureRect" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/MoveLeft"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -7.0 +margin_top = -7.0 +margin_right = 8.0 +margin_bottom = 8.0 +texture = ExtResource( 8 ) +flip_h = true +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MoveRight" type="Button" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons" groups=[ +"UIButtons", +]] +margin_left = 120.0 +margin_top = 2.0 +margin_right = 140.0 +margin_bottom = 22.0 +rect_min_size = Vector2( 20, 0 ) +hint_tooltip = "Move the selected frame to the right." +mouse_default_cursor_shape = 2 +size_flags_horizontal = 0 +size_flags_vertical = 4 + +[node name="TextureRect" type="TextureRect" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/MoveRight"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -7.0 +margin_top = -7.0 +margin_right = 7.0 +margin_bottom = 7.0 +texture = ExtResource( 8 ) +__meta__ = { +"_edit_use_anchors_": false +} + [node name="PlaybackButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons"] -margin_left = 132.0 -margin_right = 272.0 +margin_left = 180.0 +margin_right = 320.0 margin_bottom = 24.0 [node name="FirstFrame" type="Button" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/PlaybackButtons" groups=[ @@ -637,8 +693,8 @@ __meta__ = { } [node name="LoopButtons" type="HBoxContainer" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons"] -margin_left = 312.0 -margin_right = 450.0 +margin_left = 360.0 +margin_right = 498.0 margin_bottom = 24.0 [node name="OnionSkinningSettings" type="Button" parent="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/LoopButtons" groups=[ @@ -942,6 +998,8 @@ __meta__ = { [connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/DeleteFrame" to="." method="_on_DeleteFrame_pressed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/CopyFrame" to="." method="_on_CopyFrame_pressed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/FrameTagButton" to="." method="_on_FrameTagButton_pressed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/MoveLeft" to="." method="_on_MoveLeft_pressed"] +[connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/FrameButtons/MoveRight" to="." method="_on_MoveRight_pressed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/PlaybackButtons/FirstFrame" to="." method="_on_FirstFrame_pressed"] [connection signal="pressed" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/PlaybackButtons/PreviousFrame" to="." method="_on_PreviousFrame_pressed"] [connection signal="toggled" from="AnimationContainer/TimelineContainer/TimelineButtons/PanelContainer/AnimationButtons/PlaybackButtons/PlayBackwards" to="." method="_on_PlayBackwards_toggled"]