1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 09:09:47 +00:00

Remove frame tag button & make onion skinning settings into general timeline settings

The "Animation plays only on frames of the same tag" button has been moved to the general timeline settings, along with a new slider that resizes the cel buttons in the timeline.
This commit is contained in:
Emmanouil Papadeas 2024-05-08 01:09:20 +03:00
parent ecb1890024
commit 5a64dde3e5
7 changed files with 129 additions and 294 deletions

View file

@ -1785,7 +1785,7 @@ msgstr ""
msgid "Jump to the last frame\n"
msgstr ""
msgid "Onion Skinning settings"
msgid "Timeline settings"
msgstr ""
msgid "Enable/disable Onion Skinning"
@ -1844,7 +1844,11 @@ msgid "If it's selected, the animation plays only on the frames that have the sa
"If it's not, the animation will play for all frames, ignoring tags."
msgstr ""
#. Found in the timeline, inside the onion skinning settings. If this is enabled, the past and future frames will have appear tinted.
#. Found in the timeline, inside the timeline settings. It's a slider that sets the size of the cel buttons in the timeline.
msgid "Cel size:"
msgstr ""
#. Found in the timeline, inside the timeline settings. If this is enabled, the past and future frames will have appear tinted.
msgid "Color mode"
msgstr ""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

View file

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://i13jhsg117kd"
path="res://.godot/imported/tag.png-d40c07fde0f15ca4aa9533f283d8253f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/timeline/tag.png"
dest_files=["res://.godot/imported/tag.png-d40c07fde0f15ca4aa9533f283d8253f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View file

@ -5,7 +5,6 @@ signal animation_finished
const FRAME_BUTTON_TSCN := preload("res://src/UI/Timeline/FrameButton.tscn")
const LAYER_FX_SCENE_PATH := "res://src/UI/Timeline/LayerEffects/LayerEffectsSettings.tscn"
const FRAME_TAG_DIALOG_SCENE_PATH := "res://src/UI/Timeline/FrameTagDialog.tscn"
var is_animation_running := false
var animation_loop := 1 ## 0 is no loop, 1 is cycle loop, 2 is ping-pong loop
@ -25,12 +24,6 @@ var layer_effect_settings: AcceptDialog:
layer_effect_settings = load(LAYER_FX_SCENE_PATH).instantiate()
add_child(layer_effect_settings)
return layer_effect_settings
var frame_tag_dialog: AcceptDialog:
get:
if not is_instance_valid(frame_tag_dialog):
frame_tag_dialog = load(FRAME_TAG_DIALOG_SCENE_PATH).instantiate()
add_child(frame_tag_dialog)
return frame_tag_dialog
@onready var old_scroll := 0 ## The previous scroll state of $ScrollContainer
@onready var tag_spacer := %TagSpacer as Control
@ -54,7 +47,8 @@ var frame_tag_dialog: AcceptDialog:
@onready var play_forward := %PlayForward as Button
@onready var fps_spinbox := %FPSValue as ValueSlider
@onready var onion_skinning_button := %OnionSkinning as BaseButton
@onready var onion_skinning_settings := $OnionSkinningSettings as Popup
@onready var timeline_settings := $TimelineSettings as Popup
@onready var cel_size_slider := %CelSizeSlider as ValueSlider
@onready var loop_animation_button := %LoopAnim as BaseButton
@onready var drag_highlight := $DragHighlight as ColorRect
@ -64,6 +58,9 @@ func _ready() -> void:
min_cel_size = get_tree().current_scene.theme.default_font_size + 24
layer_container.custom_minimum_size.x = layer_settings_container.size.x + 12
cel_size = min_cel_size
cel_size_slider.min_value = min_cel_size
cel_size_slider.max_value = max_cel_size
cel_size_slider.value = cel_size
add_layer_list.get_popup().id_pressed.connect(add_layer)
frame_scroll_bar.value_changed.connect(_frame_scroll_changed)
Global.animation_timer.wait_time = 1 / Global.current_project.fps
@ -201,6 +198,7 @@ func _cel_size_changed(value: int) -> void:
if cel_size == value:
return
cel_size = clampi(value, min_cel_size, max_cel_size)
cel_size_slider.value = cel_size
update_minimum_size()
Global.config_cache.set_value("timeline", "cel_size", cel_size)
for layer_button: Control in Global.layer_vbox.get_children():
@ -497,10 +495,6 @@ func copy_frames(
project.undo_redo.commit_action()
func _on_FrameTagButton_pressed() -> void:
frame_tag_dialog.popup_centered()
func _on_MoveLeft_pressed() -> void:
if Global.current_project.current_frame == 0:
return
@ -566,9 +560,9 @@ func _on_OnionSkinning_pressed() -> void:
Global.change_button_texturerect(texture_button, "onion_skinning_off.png")
func _on_OnionSkinningSettings_pressed() -> void:
var pos := Vector2i(onion_skinning_button.global_position) - onion_skinning_settings.size
onion_skinning_settings.popup(Rect2i(pos.x - 16, pos.y + 32, 136, 126))
func _on_timeline_settings_button_pressed() -> void:
var pos := Vector2i(onion_skinning_button.global_position) - timeline_settings.size
timeline_settings.popup(Rect2i(pos.x - 16, pos.y + 32, 136, 126))
func _on_LoopAnim_pressed() -> void:
@ -770,6 +764,10 @@ func _on_BlueRedMode_toggled(button_pressed: bool) -> void:
Global.canvas.queue_redraw()
func _on_play_only_tags_toggled(toggled_on: bool) -> void:
Global.play_only_tags = toggled_on
func _on_PastPlacement_item_selected(index: int) -> void:
past_above_canvas = (index == 0)
Global.config_cache.set_value("timeline", "past_above_canvas", past_above_canvas)
@ -1054,12 +1052,12 @@ func _on_OpacitySlider_value_changed(value: float) -> void:
Global.canvas.queue_redraw()
func _on_onion_skinning_settings_close_requested() -> void:
onion_skinning_settings.hide()
func _on_timeline_settings_close_requested() -> void:
timeline_settings.hide()
func _on_onion_skinning_settings_visibility_changed() -> void:
Global.can_draw = not onion_skinning_settings.visible
func _on_timeline_settings_visibility_changed() -> void:
Global.can_draw = not timeline_settings.visible
# Methods to update the UI in response to changes in the current project
@ -1231,3 +1229,7 @@ func project_cel_removed(frame: int, layer: int) -> void:
func _on_layer_fx_pressed() -> void:
layer_effect_settings.popup_centered()
Global.dialog_open(true)
func _on_cel_size_slider_value_changed(value: float) -> void:
cel_size = value

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=76 format=3 uid="uid://dbr6mulku2qju"]
[gd_scene load_steps=74 format=3 uid="uid://dbr6mulku2qju"]
[ext_resource type="Script" path="res://src/UI/Timeline/AnimationTimeline.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://d36mlbmq06q4e" path="res://assets/graphics/layers/new.png" id="2"]
@ -21,8 +21,8 @@
[ext_resource type="Texture2D" uid="uid://esistdjfbrc4" path="res://assets/graphics/timeline/play_backwards.png" id="24"]
[ext_resource type="Texture2D" uid="uid://l4jj86y1hukm" path="res://assets/graphics/timeline/go_to_last_frame.png" id="25"]
[ext_resource type="Texture2D" uid="uid://b2ndrc0cvy1m5" path="res://assets/graphics/timeline/next_frame.png" id="26"]
[ext_resource type="Script" path="res://src/UI/Nodes/ValueSlider.gd" id="26_tfw1u"]
[ext_resource type="Texture2D" uid="uid://cerkv5yx4cqeh" path="res://assets/graphics/timeline/copy_frame.png" id="27"]
[ext_resource type="Texture2D" uid="uid://i13jhsg117kd" path="res://assets/graphics/timeline/tag.png" id="28"]
[ext_resource type="Texture2D" uid="uid://dukip7mvotxsp" path="res://assets/graphics/timeline/onion_skinning_off.png" id="29"]
[ext_resource type="Texture2D" uid="uid://dinubfua8gqhw" path="res://assets/graphics/timeline/expandable.png" id="30"]
[ext_resource type="Texture2D" uid="uid://fbwld5ofmocm" path="res://assets/graphics/timeline/loop.png" id="31"]
@ -81,12 +81,6 @@ action = &"clone_frame"
[sub_resource type="Shortcut" id="Shortcut_5g7t7"]
events = [SubResource("InputEventAction_yptjb")]
[sub_resource type="InputEventAction" id="InputEventAction_jp76a"]
action = &"manage_frame_tags"
[sub_resource type="Shortcut" id="Shortcut_renbb"]
events = [SubResource("InputEventAction_jp76a")]
[sub_resource type="InputEventAction" id="InputEventAction_ar42u"]
action = &"move_frame_left"
@ -501,27 +495,6 @@ offset_right = 5.0
offset_bottom = 7.0
texture = ExtResource("27")
[node name="FrameTagButton" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "Manage frame tags"
focus_mode = 0
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_renbb")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/FrameTagButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -7.0
offset_top = -7.0
offset_right = 7.0
offset_bottom = 7.0
texture = ExtResource("28")
[node name="MoveFrameLeft" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]]
unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24)
@ -698,16 +671,16 @@ texture = ExtResource("25")
[node name="LoopButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons"]
layout_mode = 2
[node name="OnionSkinningSettings" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" groups=["UIButtons"]]
[node name="TimelineSettingsButton" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24)
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "Onion Skinning settings"
tooltip_text = "Timeline settings"
focus_mode = 0
mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_tke6v")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/OnionSkinningSettings"]
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/TimelineSettingsButton"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
@ -806,6 +779,7 @@ size_flags_horizontal = 3
[node name="MainBodyPanel" type="PanelContainer" parent="TimelineContainer"]
layout_mode = 2
size_flags_vertical = 3
mouse_filter = 1
[node name="MainBodyVBoxContainer" type="VBoxContainer" parent="TimelineContainer/MainBodyPanel"]
layout_mode = 2
@ -901,62 +875,101 @@ size_flags_horizontal = 3
[node name="AnimationTimer" type="Timer" parent="."]
[node name="OnionSkinningSettings" type="Popup" parent="."]
[node name="TimelineSettings" type="Popup" parent="."]
position = Vector2i(0, 24)
size = Vector2i(296, 211)
unresizable = false
borderless = false
[node name="MarginContainer" type="MarginContainer" parent="OnionSkinningSettings"]
offset_right = 16.0
offset_bottom = 4.0
[node name="MarginContainer" type="MarginContainer" parent="TimelineSettings"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="OnionSkinningButtons" type="VBoxContainer" parent="OnionSkinningSettings/MarginContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="TimelineSettings/MarginContainer"]
layout_mode = 2
[node name="OnionSkinningPast" type="Label" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons"]
layout_mode = 2
text = "Past Frames"
[node name="PastOnionSkinning" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons" instance=ExtResource("9")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 1
max_value = 10.0
value = 1.0
allow_greater = true
suffix = "Frames"
[node name="OnionSkinningFuture" type="Label" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons"]
layout_mode = 2
text = "Future Frames"
[node name="FutureOnionSkinning" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons" instance=ExtResource("9")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 1
max_value = 10.0
value = 1.0
allow_greater = true
suffix = "Frames"
[node name="BlueRedMode" type="CheckBox" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons"]
unique_name_in_owner = true
[node name="PlayOnlyTags" type="CheckBox" parent="TimelineSettings/MarginContainer/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "If it's selected, the animation plays only on the frames that have the same tag.
If it's not, the animation will play for all frames, ignoring tags."
mouse_default_cursor_shape = 2
text = "Color mode"
button_pressed = true
text = "Animation plays only on frames of the same tag"
[node name="GridContainer" type="GridContainer" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons"]
[node name="GridContainer" type="GridContainer" parent="TimelineSettings/MarginContainer/VBoxContainer"]
layout_mode = 2
columns = 2
[node name="CelSizeLabel" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/GridContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Cel size:"
[node name="CelSizeSlider" type="TextureProgressBar" parent="TimelineSettings/MarginContainer/VBoxContainer/GridContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
focus_mode = 2
theme_type_variation = &"ValueSlider"
nine_patch_stretch = true
stretch_margin_left = 3
stretch_margin_top = 3
stretch_margin_right = 3
stretch_margin_bottom = 3
script = ExtResource("26_tfw1u")
[node name="HeaderContainer" type="HBoxContainer" parent="TimelineSettings/MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="HeaderLabel" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/HeaderContainer"]
layout_mode = 2
theme_type_variation = &"HeaderSmall"
text = "Onion Skinning"
[node name="HSeparator" type="HSeparator" parent="TimelineSettings/MarginContainer/VBoxContainer/HeaderContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="OnionSkinningOptionsContainer" type="GridContainer" parent="TimelineSettings/MarginContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/h_separation = 8
columns = 2
[node name="PastPlacementLabel" type="Label" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer"]
[node name="OnionSkinningPast" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
layout_mode = 2
text = "Past Frames"
[node name="PastOnionSkinning" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer" instance=ExtResource("9")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 1
max_value = 10.0
value = 1.0
allow_greater = true
suffix = "Frames"
[node name="OnionSkinningFuture" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
layout_mode = 2
text = "Future Frames"
[node name="FutureOnionSkinning" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer" instance=ExtResource("9")]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 1
max_value = 10.0
value = 1.0
allow_greater = true
suffix = "Frames"
[node name="PastPlacementLabel" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
layout_mode = 2
text = "Show past frames:"
[node name="PastPlacement" type="OptionButton" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer"]
[node name="PastPlacement" type="OptionButton" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
@ -967,11 +980,11 @@ popup/item_0/id = 0
popup/item_1/text = "Below canvas"
popup/item_1/id = 1
[node name="FuturePlacementLabel" type="Label" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer"]
[node name="FuturePlacementLabel" type="Label" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
layout_mode = 2
text = "Show future frames:"
[node name="FuturePlacement" type="OptionButton" parent="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer"]
[node name="FuturePlacement" type="OptionButton" parent="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer"]
unique_name_in_owner = true
layout_mode = 2
mouse_default_cursor_shape = 2
@ -981,8 +994,16 @@ popup/item_0/id = 0
popup/item_1/text = "Below canvas"
popup/item_1/id = 1
[node name="BlueRedMode" type="CheckBox" parent="TimelineSettings/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 0
mouse_default_cursor_shape = 2
text = "Color mode"
[node name="DragHighlight" type="ColorRect" parent="."]
visible = false
z_index = 2
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
@ -1058,7 +1079,6 @@ autowrap_mode = 3
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/AddFrame" to="." method="add_frame"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/DeleteFrame" to="." method="_on_DeleteFrame_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/CopyFrame" to="." method="_on_CopyFrame_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/FrameTagButton" to="." method="_on_FrameTagButton_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/MoveFrameLeft" to="." method="_on_MoveLeft_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/MoveFrameRight" to="." method="_on_MoveRight_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/FirstFrame" to="." method="_on_FirstFrame_pressed"]
@ -1067,7 +1087,7 @@ autowrap_mode = 3
[connection signal="toggled" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PlayForward" to="." method="_on_PlayForward_toggled"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/NextFrame" to="." method="_on_NextFrame_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/LastFrame" to="." method="_on_LastFrame_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/OnionSkinningSettings" to="." method="_on_OnionSkinningSettings_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/TimelineSettingsButton" to="." method="_on_timeline_settings_button_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/OnionSkinning" to="." method="_on_OnionSkinning_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/LoopAnim" to="." method="_on_LoopAnim_pressed"]
[connection signal="value_changed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/FPSValue" to="." method="_on_FPSValue_value_changed"]
@ -1075,10 +1095,12 @@ autowrap_mode = 3
[connection signal="value_changed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/MarginContainer/OpacitySlider" to="." method="_on_OpacitySlider_value_changed"]
[connection signal="resized" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/TimelineScroll/MarginContainer/LayerFrameHSplit/LayerContainer/LayerVBox" to="." method="_on_LayerVBox_resized"]
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]
[connection signal="close_requested" from="OnionSkinningSettings" to="." method="_on_onion_skinning_settings_close_requested"]
[connection signal="visibility_changed" from="OnionSkinningSettings" to="." method="_on_onion_skinning_settings_visibility_changed"]
[connection signal="value_changed" from="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/PastOnionSkinning" to="." method="_on_PastOnionSkinning_value_changed"]
[connection signal="value_changed" from="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/FutureOnionSkinning" to="." method="_on_FutureOnionSkinning_value_changed"]
[connection signal="toggled" from="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/BlueRedMode" to="." method="_on_BlueRedMode_toggled"]
[connection signal="item_selected" from="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer/PastPlacement" to="." method="_on_PastPlacement_item_selected"]
[connection signal="item_selected" from="OnionSkinningSettings/MarginContainer/OnionSkinningButtons/GridContainer/FuturePlacement" to="." method="_on_FuturePlacement_item_selected"]
[connection signal="close_requested" from="TimelineSettings" to="." method="_on_timeline_settings_close_requested"]
[connection signal="visibility_changed" from="TimelineSettings" to="." method="_on_timeline_settings_visibility_changed"]
[connection signal="toggled" from="TimelineSettings/MarginContainer/VBoxContainer/PlayOnlyTags" to="." method="_on_play_only_tags_toggled"]
[connection signal="value_changed" from="TimelineSettings/MarginContainer/VBoxContainer/GridContainer/CelSizeSlider" to="." method="_on_cel_size_slider_value_changed"]
[connection signal="value_changed" from="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer/PastOnionSkinning" to="." method="_on_PastOnionSkinning_value_changed"]
[connection signal="value_changed" from="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer/FutureOnionSkinning" to="." method="_on_FutureOnionSkinning_value_changed"]
[connection signal="item_selected" from="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer/PastPlacement" to="." method="_on_PastPlacement_item_selected"]
[connection signal="item_selected" from="TimelineSettings/MarginContainer/VBoxContainer/OnionSkinningOptionsContainer/FuturePlacement" to="." method="_on_FuturePlacement_item_selected"]
[connection signal="toggled" from="TimelineSettings/MarginContainer/VBoxContainer/BlueRedMode" to="." method="_on_BlueRedMode_toggled"]

View file

@ -1,91 +0,0 @@
extends AcceptDialog
var tag_vboxes := []
var called_tag_properties := false ## True when tag properties has been shown by this dialog
@onready var main_vbox_cont: VBoxContainer = $VBoxContainer/ScrollContainer/VBoxTagContainer
@onready var add_tag_button: Button = $VBoxContainer/ScrollContainer/VBoxTagContainer/AddTag
@onready var tag_properties := Global.control.find_child("TagProperties") as ConfirmationDialog
func _ready() -> void:
tag_properties.visibility_changed.connect(_on_tag_options_visibility_changed)
func _on_tag_options_visibility_changed() -> void:
if called_tag_properties:
called_tag_properties = false
popup_centered.call_deferred()
func _on_FrameTagDialog_about_to_show() -> void:
Global.dialog_open(true)
for vbox in tag_vboxes:
vbox.queue_free()
tag_vboxes.clear()
var i := 0
for tag in Global.current_project.animation_tags:
var vbox_cont := VBoxContainer.new()
var hbox_cont := HBoxContainer.new()
var tag_label := Label.new()
if tag.from == tag.to:
tag_label.text = tr("Tag %s (Frame %s)") % [i + 1, tag.from]
else:
tag_label.text = tr("Tag %s (Frames %s-%s)") % [i + 1, tag.from, tag.to]
hbox_cont.add_child(tag_label)
var edit_button := Button.new()
edit_button.text = "Edit"
edit_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
edit_button.pressed.connect(_on_EditButton_pressed.bind(i, edit_button))
hbox_cont.add_child(edit_button)
vbox_cont.add_child(hbox_cont)
var name_label := Label.new()
name_label.text = tag.name
name_label.modulate = tag.color
vbox_cont.add_child(name_label)
var hsep := HSeparator.new()
hsep.size_flags_horizontal = Control.SIZE_EXPAND_FILL
vbox_cont.add_child(hsep)
main_vbox_cont.add_child(vbox_cont)
tag_vboxes.append(vbox_cont)
i += 1
add_tag_button.visible = true
main_vbox_cont.move_child(add_tag_button, main_vbox_cont.get_child_count() - 1)
func _on_FrameTagDialog_visibility_changed() -> void:
if not visible:
Global.dialog_open(false)
func _on_AddTag_pressed() -> void:
var x_pos := add_tag_button.global_position.x
var y_pos := add_tag_button.global_position.y + 2 * add_tag_button.size.y
var dialog_position := Rect2i(position + Vector2i(x_pos, y_pos), tag_properties.size)
var current_tag_id := Global.current_project.animation_tags.size()
# Determine tag values (array sort method)
var frames := PackedInt32Array([])
for cel in Global.current_project.selected_cels:
frames.append(cel[0])
frames.sort()
tag_properties.show_dialog(dialog_position, current_tag_id, false, frames)
called_tag_properties = true
func _on_EditButton_pressed(_tag_id: int, edit_button: Button) -> void:
var x_pos := edit_button.global_position.x
var y_pos := edit_button.global_position.y + 2 * edit_button.size.y
var dialog_position := Rect2i(position + Vector2i(x_pos, y_pos), tag_properties.size)
tag_properties.show_dialog(dialog_position, _tag_id, true)
called_tag_properties = true
func _on_PlayOnlyTags_toggled(button_pressed: bool) -> void:
Global.play_only_tags = button_pressed

View file

@ -1,68 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://c6je8lgr850wf"]
[ext_resource type="Script" path="res://src/UI/Timeline/FrameTagDialog.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://d1urikaf1lxwl" path="res://assets/graphics/timeline/new_frame.png" id="2"]
[node name="FrameTagDialog" type="AcceptDialog"]
title = "Frame Tag Properties"
size = Vector2i(413, 300)
exclusive = false
popup_window = true
script = ExtResource("1")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
custom_minimum_size = Vector2(0, 100)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -49.0
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxTagContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxTagContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="AddTag" type="Button" parent="VBoxContainer/ScrollContainer/VBoxTagContainer" groups=["UIButtons"]]
custom_minimum_size = Vector2(20, 20)
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
tooltip_text = "Add a new frame tag"
mouse_default_cursor_shape = 2
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ScrollContainer/VBoxTagContainer/AddTag"]
layout_mode = 0
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -6.0
offset_top = -6.0
offset_right = 6.0
offset_bottom = 6.0
texture = ExtResource("2")
[node name="PlayOnlyTags" type="CheckBox" parent="VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
tooltip_text = "If it's selected, the animation plays only on the frames that have the same tag.
If it's not, the animation will play for all frames, ignoring tags."
mouse_default_cursor_shape = 2
button_pressed = true
text = "Animation plays only on frames of the same tag"
[connection signal="about_to_popup" from="." to="." method="_on_FrameTagDialog_about_to_show"]
[connection signal="visibility_changed" from="." to="." method="_on_FrameTagDialog_visibility_changed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxTagContainer/AddTag" to="." method="_on_AddTag_pressed"]
[connection signal="toggled" from="VBoxContainer/PlayOnlyTags" to="." method="_on_PlayOnlyTags_toggled"]