1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-12 08:43:08 +00:00

Compare commits

..

7 commits

Author SHA1 Message Date
Emmanouil Papadeas 26f728c8d1
Merge ae2c80e0b7 into b5d5c44c4b 2024-12-14 18:07:35 +00:00
Emmanouil Papadeas ae2c80e0b7 New translations translations.pot (Italian) 2024-12-14 20:07:32 +02:00
Emmanouil Papadeas b5d5c44c4b Use the linked cel rectangle for audio cels 2024-12-14 18:01:46 +02:00
Emmanouil Papadeas 8e55b91a39 Unmute audio layes when making them visible while the animation is playing 2024-12-14 17:18:52 +02:00
Emmanouil Papadeas 0fad406967 Fix extension entry enlarged thumbnail dialog not being on top 2024-12-14 16:58:43 +02:00
Emmanouil Papadeas 4b12f764b5 Add a MarginContainer in the timeline's animation buttons 2024-12-14 16:10:05 +02:00
Emmanouil Papadeas 02d1900dc2 Make brush size in draw tools not affect the draw tiles mode
We could change it again if we implement it in a non-confusing way
2024-12-14 16:05:51 +02:00
7 changed files with 106 additions and 76 deletions

View file

@ -10,7 +10,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Language-Team: Italian\n" "Language-Team: Italian\n"
"Language: it_IT\n" "Language: it_IT\n"
"PO-Revision-Date: 2024-12-13 22:43\n" "PO-Revision-Date: 2024-12-14 18:07\n"
msgid "OK" msgid "OK"
msgstr "OK" msgstr "OK"
@ -1850,7 +1850,7 @@ msgstr "Se abilitata, la finestra dell'applicazione può diventare trasparente.
#. An option found in the preferences, under the Performance section. #. An option found in the preferences, under the Performance section.
msgid "Use dummy audio driver" msgid "Use dummy audio driver"
msgstr "" msgstr "Usa driver audio fittizio"
#. Found in the Preferences, under Drivers. Specifies the renderer/video driver being used. #. Found in the Preferences, under Drivers. Specifies the renderer/video driver being used.
msgid "Renderer:" msgid "Renderer:"
@ -2287,7 +2287,7 @@ msgstr "Scollega celle"
#. An option found in the right click menu of an audio cel. If selected, the audio of the audio layer will start playing from this frame. #. An option found in the right click menu of an audio cel. If selected, the audio of the audio layer will start playing from this frame.
msgid "Play audio here" msgid "Play audio here"
msgstr "" msgstr "Riproduci audio qui"
msgid "Properties" msgid "Properties"
msgstr "Proprietà" msgstr "Proprietà"
@ -2330,7 +2330,7 @@ msgid "Tilemap"
msgstr "Mappa caselle" msgstr "Mappa caselle"
msgid "Audio" msgid "Audio"
msgstr "" msgstr "Audio"
msgid "Layers" msgid "Layers"
msgstr "Livelli" msgstr "Livelli"
@ -2367,7 +2367,7 @@ msgstr "Aggiungi Livello Mappa caselle"
#. One of the options of the create new layer button. #. One of the options of the create new layer button.
#: src/UI/Timeline/AnimationTimeline.tscn #: src/UI/Timeline/AnimationTimeline.tscn
msgid "Add Audio Layer" msgid "Add Audio Layer"
msgstr "" msgstr "Aggiungi Livello Audio"
#: src/UI/Timeline/AnimationTimeline.tscn #: src/UI/Timeline/AnimationTimeline.tscn
msgid "Remove current layer" msgid "Remove current layer"
@ -2502,14 +2502,14 @@ msgstr "Espandere/comprimere gruppo"
#. Refers to the audio file of an audio layer. #. Refers to the audio file of an audio layer.
msgid "Audio file:" msgid "Audio file:"
msgstr "" msgstr "File audio:"
msgid "Load file" msgid "Load file"
msgstr "" msgstr "Carica file"
#. An option in the audio layer properties, allows users to play the audio starting from a specific frame. #. An option in the audio layer properties, allows users to play the audio starting from a specific frame.
msgid "Play at frame:" msgid "Play at frame:"
msgstr "" msgstr "Riproduci al fotogramma:"
msgid "Palette" msgid "Palette"
msgstr "Palette" msgstr "Palette"

View file

@ -212,8 +212,7 @@ func update_brush() -> void:
$DensityValueSlider.visible = _brush.type not in IMAGE_BRUSHES $DensityValueSlider.visible = _brush.type not in IMAGE_BRUSHES
$ColorInterpolation.visible = _brush.type in IMAGE_BRUSHES $ColorInterpolation.visible = _brush.type in IMAGE_BRUSHES
$RotationOptions.visible = _brush.type in IMAGE_BRUSHES $RotationOptions.visible = _brush.type in IMAGE_BRUSHES
var canvas_indicators := Global.canvas.indicators Global.canvas.indicators.queue_redraw()
canvas_indicators.queue_redraw()
func update_random_image() -> void: func update_random_image() -> void:
@ -378,6 +377,8 @@ func _prepare_tool() -> void:
func _draw_tool(pos: Vector2) -> PackedVector2Array: func _draw_tool(pos: Vector2) -> PackedVector2Array:
if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn(): if !Global.current_project.layers[Global.current_project.current_layer].can_layer_get_drawn():
return PackedVector2Array() # empty fallback return PackedVector2Array() # empty fallback
if Tools.is_placing_tiles():
return _compute_draw_tool_pixel(pos)
match _brush.type: match _brush.type:
Brushes.PIXEL: Brushes.PIXEL:
return _compute_draw_tool_pixel(pos) return _compute_draw_tool_pixel(pos)
@ -428,9 +429,12 @@ func draw_fill_gap(start: Vector2i, end: Vector2i) -> void:
## Compute the array of coordinates that should be drawn ## Compute the array of coordinates that should be drawn
func _compute_draw_tool_pixel(pos: Vector2) -> PackedVector2Array: func _compute_draw_tool_pixel(pos: Vector2) -> PackedVector2Array:
var brush_size := _brush_size_dynamics
if Tools.is_placing_tiles():
brush_size = 1
var result := PackedVector2Array() var result := PackedVector2Array()
var start := pos - Vector2.ONE * (_brush_size_dynamics >> 1) var start := pos - Vector2.ONE * (brush_size >> 1)
var end := start + Vector2.ONE * _brush_size_dynamics var end := start + Vector2.ONE * brush_size
for y in range(start.y, end.y): for y in range(start.y, end.y):
for x in range(start.x, end.x): for x in range(start.x, end.x):
result.append(Vector2(x, y)) result.append(Vector2(x, y))

View file

@ -194,7 +194,7 @@ func _on_ProgressTimer_timeout() -> void:
update_progress() update_progress()
func _manage_enlarded_thumbnail_close() -> void: func _manage_enlarged_thumbnail_close() -> void:
enlarged_picture.get_parent().hide() enlarged_picture.get_parent().hide()

View file

@ -93,6 +93,7 @@ unique_name_in_owner = true
[node name="Alert" type="AcceptDialog" parent="."] [node name="Alert" type="AcceptDialog" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
size = Vector2i(421, 106) size = Vector2i(421, 106)
always_on_top = true
[node name="Text" type="Label" parent="Alert"] [node name="Text" type="Label" parent="Alert"]
anchors_preset = 15 anchors_preset = 15
@ -104,15 +105,16 @@ offset_right = -8.0
offset_bottom = -49.0 offset_bottom = -49.0
horizontal_alignment = 1 horizontal_alignment = 1
[node name="EnlardedThumbnail" type="Window" parent="."] [node name="EnlargedThumbnail" type="Window" parent="."]
title = "Image" title = "Image"
position = Vector2i(0, 36) position = Vector2i(0, 36)
size = Vector2i(440, 360) size = Vector2i(440, 360)
visible = false visible = false
transient = true transient = true
exclusive = true exclusive = true
always_on_top = true
[node name="Enlarged" type="TextureRect" parent="EnlardedThumbnail"] [node name="Enlarged" type="TextureRect" parent="EnlargedThumbnail"]
unique_name_in_owner = true unique_name_in_owner = true
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -131,5 +133,5 @@ stretch_mode = 5
[connection signal="request_completed" from="DownloadRequest" to="." method="_on_DownloadRequest_request_completed"] [connection signal="request_completed" from="DownloadRequest" to="." method="_on_DownloadRequest_request_completed"]
[connection signal="close_requested" from="Alert" to="." method="_manage_alert_close"] [connection signal="close_requested" from="Alert" to="." method="_manage_alert_close"]
[connection signal="focus_exited" from="Alert" to="." method="_manage_alert_close"] [connection signal="focus_exited" from="Alert" to="." method="_manage_alert_close"]
[connection signal="close_requested" from="EnlardedThumbnail" to="." method="_manage_enlarded_thumbnail_close"] [connection signal="close_requested" from="EnlargedThumbnail" to="." method="_manage_enlarged_thumbnail_close"]
[connection signal="focus_exited" from="EnlardedThumbnail" to="." method="_manage_enlarded_thumbnail_close"] [connection signal="focus_exited" from="EnlargedThumbnail" to="." method="_manage_enlarged_thumbnail_close"]

View file

@ -427,17 +427,20 @@ vertical_scroll_mode = 0
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 10 size_flags_horizontal = 10
[node name="AnimationButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools"] [node name="MarginContainer" type="MarginContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools"]
layout_mode = 2
[node name="AnimationButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer"]
custom_minimum_size = Vector2(0, 24) custom_minimum_size = Vector2(0, 24)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 3 size_flags_horizontal = 3
theme_override_constants/separation = 24 theme_override_constants/separation = 24
alignment = 2 alignment = 2
[node name="FrameButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons"] [node name="FrameButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons"]
layout_mode = 2 layout_mode = 2
[node name="AddFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]] [node name="AddFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
@ -446,7 +449,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_mvoxm") shortcut = SubResource("Shortcut_mvoxm")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/AddFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons/AddFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -458,7 +461,7 @@ offset_right = 6.0
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("19") texture = ExtResource("19")
[node name="DeleteFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]] [node name="DeleteFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -468,7 +471,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_o40ql") shortcut = SubResource("Shortcut_o40ql")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/DeleteFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons/DeleteFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -482,7 +485,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("20") texture = ExtResource("20")
[node name="CopyFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]] [node name="CopyFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
@ -491,7 +494,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_5g7t7") shortcut = SubResource("Shortcut_5g7t7")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/CopyFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons/CopyFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -503,7 +506,7 @@ offset_right = 5.0
offset_bottom = 7.0 offset_bottom = 7.0
texture = ExtResource("27") texture = ExtResource("27")
[node name="MoveFrameLeft" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]] [node name="MoveFrameLeft" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -513,7 +516,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_kwn1u") shortcut = SubResource("Shortcut_kwn1u")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/MoveFrameLeft"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons/MoveFrameLeft"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -526,7 +529,7 @@ offset_bottom = 5.5
texture = ExtResource("8") texture = ExtResource("8")
flip_h = true flip_h = true
[node name="MoveFrameRight" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons" groups=["UIButtons"]] [node name="MoveFrameRight" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -536,7 +539,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_m2mvi") shortcut = SubResource("Shortcut_m2mvi")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/FrameButtons/MoveFrameRight"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/FrameButtons/MoveFrameRight"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -548,10 +551,10 @@ offset_right = 7.5
offset_bottom = 5.5 offset_bottom = 5.5
texture = ExtResource("8") texture = ExtResource("8")
[node name="PlaybackButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons"] [node name="PlaybackButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons"]
layout_mode = 2 layout_mode = 2
[node name="FirstFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="FirstFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
tooltip_text = "Jump to the first frame" tooltip_text = "Jump to the first frame"
@ -559,7 +562,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("4") shortcut = SubResource("4")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/FirstFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/FirstFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -571,7 +574,7 @@ offset_right = 5.5
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("21") texture = ExtResource("21")
[node name="PreviousFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="PreviousFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
tooltip_text = "Go to the previous frame" tooltip_text = "Go to the previous frame"
@ -579,7 +582,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("6") shortcut = SubResource("6")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PreviousFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/PreviousFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -591,7 +594,7 @@ offset_right = 5.5
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("23") texture = ExtResource("23")
[node name="PlayBackwards" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="PlayBackwards" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -601,7 +604,7 @@ mouse_default_cursor_shape = 2
toggle_mode = true toggle_mode = true
shortcut = SubResource("8") shortcut = SubResource("8")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PlayBackwards"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/PlayBackwards"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -613,7 +616,7 @@ offset_right = 3.0
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("24") texture = ExtResource("24")
[node name="PlayForward" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="PlayForward" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -624,7 +627,7 @@ mouse_default_cursor_shape = 2
toggle_mode = true toggle_mode = true
shortcut = SubResource("10") shortcut = SubResource("10")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PlayForward"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/PlayForward"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -636,7 +639,7 @@ offset_right = 3.5
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("22") texture = ExtResource("22")
[node name="NextFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="NextFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
tooltip_text = "Go to the next frame" tooltip_text = "Go to the next frame"
@ -644,7 +647,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("12") shortcut = SubResource("12")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/NextFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/NextFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -656,7 +659,7 @@ offset_right = 5.5
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("26") texture = ExtResource("26")
[node name="LastFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons" groups=["UIButtons"]] [node name="LastFrame" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
tooltip_text = "Jump to the last frame" tooltip_text = "Jump to the last frame"
@ -664,7 +667,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("14") shortcut = SubResource("14")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/LastFrame"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/LastFrame"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -676,10 +679,10 @@ offset_right = 5.5
offset_bottom = 6.0 offset_bottom = 6.0
texture = ExtResource("25") texture = ExtResource("25")
[node name="LoopButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons"] [node name="LoopButtons" type="HBoxContainer" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons"]
layout_mode = 2 layout_mode = 2
[node name="TimelineSettingsButton" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" groups=["UIButtons"]] [node name="TimelineSettingsButton" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons" groups=["UIButtons"]]
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
@ -688,7 +691,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_tke6v") shortcut = SubResource("Shortcut_tke6v")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/TimelineSettingsButton"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons/TimelineSettingsButton"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -702,7 +705,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("30") texture = ExtResource("30")
[node name="OnionSkinning" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" groups=["UIButtons"]] [node name="OnionSkinning" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -711,7 +714,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_pouu1") shortcut = SubResource("Shortcut_pouu1")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/OnionSkinning"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons/OnionSkinning"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -725,7 +728,7 @@ size_flags_horizontal = 0
size_flags_vertical = 0 size_flags_vertical = 0
texture = ExtResource("29") texture = ExtResource("29")
[node name="LoopAnim" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" groups=["UIButtons"]] [node name="LoopAnim" type="Button" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons" groups=["UIButtons"]]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(24, 24) custom_minimum_size = Vector2(24, 24)
layout_mode = 2 layout_mode = 2
@ -734,7 +737,7 @@ focus_mode = 0
mouse_default_cursor_shape = 2 mouse_default_cursor_shape = 2
shortcut = SubResource("Shortcut_1onr8") shortcut = SubResource("Shortcut_1onr8")
[node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons/LoopAnim"] [node name="TextureRect" type="TextureRect" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons/LoopAnim"]
layout_mode = 0 layout_mode = 0
anchor_left = 0.5 anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
@ -746,7 +749,7 @@ offset_right = 7.0
offset_bottom = 7.0 offset_bottom = 7.0
texture = ExtResource("31") texture = ExtResource("31")
[node name="FPSValue" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/LoopButtons" instance=ExtResource("9")] [node name="FPSValue" parent="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons" instance=ExtResource("9")]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(72, 24) custom_minimum_size = Vector2(72, 24)
layout_mode = 2 layout_mode = 2
@ -1139,21 +1142,21 @@ color = Color(0, 0.741176, 1, 0.501961)
[connection signal="pressed" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/LayerButtons/MergeDownLayer" to="." method="_on_MergeDownLayer_pressed"] [connection signal="pressed" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/LayerButtons/MergeDownLayer" to="." method="_on_MergeDownLayer_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/LayerButtons/LayerFX" to="." method="_on_layer_fx_pressed"] [connection signal="pressed" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/LayerButtons/LayerFX" to="." method="_on_layer_fx_pressed"]
[connection signal="item_selected" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/BlendContainer/BlendModes" to="." method="_on_blend_modes_item_selected"] [connection signal="item_selected" from="TimelineContainer/TimelineButtons/LayerTools/MarginContainer/LayerSettingsContainer/BlendContainer/BlendModes" to="." method="_on_blend_modes_item_selected"]
[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/MarginContainer/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/MarginContainer/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/MarginContainer/AnimationButtons/FrameButtons/CopyFrame" to="." method="_on_CopyFrame_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/MarginContainer/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/MarginContainer/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"] [connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/FirstFrame" to="." method="_on_FirstFrame_pressed"]
[connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PreviousFrame" to="." method="_on_PreviousFrame_pressed"] [connection signal="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/PreviousFrame" to="." method="_on_PreviousFrame_pressed"]
[connection signal="toggled" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PlayBackwards" to="." method="_on_PlayBackwards_toggled"] [connection signal="toggled" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/PlaybackButtons/PlayBackwards" to="." method="_on_PlayBackwards_toggled"]
[connection signal="toggled" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/AnimationButtons/PlaybackButtons/PlayForward" to="." method="_on_PlayForward_toggled"] [connection signal="toggled" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/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/MarginContainer/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/MarginContainer/AnimationButtons/PlaybackButtons/LastFrame" to="." method="_on_LastFrame_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/MarginContainer/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/MarginContainer/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="pressed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/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"] [connection signal="value_changed" from="TimelineContainer/TimelineButtons/VBoxContainer/AnimationToolsScrollContainer/AnimationTools/MarginContainer/AnimationButtons/LoopButtons/FPSValue" to="." method="_on_FPSValue_value_changed"]
[connection signal="dragged" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_layer_frame_h_split_dragged"] [connection signal="dragged" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_layer_frame_h_split_dragged"]
[connection signal="gui_input" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_LayerFrameSplitContainer_gui_input"] [connection signal="gui_input" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit" to="." method="_on_LayerFrameSplitContainer_gui_input"]
[connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalVisibilityButton" to="." method="_on_global_visibility_button_pressed"] [connection signal="pressed" from="TimelineContainer/MainBodyPanel/MainBodyVBoxContainer/MarginContainer/LayerFrameHeaderHSplit/LayerHeaderContainer/GlobalVisibilityButton" to="." method="_on_global_visibility_button_pressed"]

View file

@ -9,7 +9,7 @@ var cel: BaseCel
var _is_guide_stylebox := false var _is_guide_stylebox := false
@onready var popup_menu: PopupMenu = get_node_or_null("PopupMenu") @onready var popup_menu: PopupMenu = get_node_or_null("PopupMenu")
@onready var linked: ColorRect = $Linked @onready var linked_rect: ColorRect = $Linked
@onready var cel_texture: TextureRect = $CelTexture @onready var cel_texture: TextureRect = $CelTexture
@onready var transparent_checker: ColorRect = $CelTexture/TransparentChecker @onready var transparent_checker: ColorRect = $CelTexture/TransparentChecker
@onready var properties: AcceptDialog = Global.control.find_child("CelProperties") @onready var properties: AcceptDialog = Global.control.find_child("CelProperties")
@ -35,6 +35,7 @@ func _ready() -> void:
popup_menu.add_item("Play audio here") popup_menu.add_item("Play audio here")
_is_playing_audio() _is_playing_audio()
Global.cel_switched.connect(_is_playing_audio) Global.cel_switched.connect(_is_playing_audio)
Themes.theme_switched.connect(_is_playing_audio)
Global.current_project.fps_changed.connect(_is_playing_audio) Global.current_project.fps_changed.connect(_is_playing_audio)
Global.current_project.layers[layer].audio_changed.connect(_is_playing_audio) Global.current_project.layers[layer].audio_changed.connect(_is_playing_audio)
Global.current_project.layers[layer].playback_frame_changed.connect(_is_playing_audio) Global.current_project.layers[layer].playback_frame_changed.connect(_is_playing_audio)
@ -75,10 +76,10 @@ func button_setup() -> void:
tooltip_text = tr("Frame: %s, Layer: %s") % [frame + 1, base_layer.name] tooltip_text = tr("Frame: %s, Layer: %s") % [frame + 1, base_layer.name]
if cel is not AudioCel: if cel is not AudioCel:
cel_texture.texture = cel.image_texture cel_texture.texture = cel.image_texture
if is_instance_valid(linked): if is_instance_valid(linked_rect):
linked.visible = cel.link_set != null linked_rect.visible = cel.link_set != null
if cel.link_set != null: if cel.link_set != null:
linked.color.h = cel.link_set["hue"] linked_rect.color.h = cel.link_set["hue"]
func _on_CelButton_pressed() -> void: func _on_CelButton_pressed() -> void:
@ -411,13 +412,26 @@ func _sort_cel_indices_by_frame(a: Array, b: Array) -> bool:
func _is_playing_audio() -> void: func _is_playing_audio() -> void:
var frame_class := Global.current_project.frames[frame] var project := Global.current_project
var layer_class := Global.current_project.layers[layer] as AudioLayer var frame_class := project.frames[frame]
var layer_class := project.layers[layer] as AudioLayer
var audio_length := layer_class.get_audio_length() var audio_length := layer_class.get_audio_length()
var frame_pos := frame_class.position_in_seconds( var frame_pos := frame_class.position_in_seconds(project, layer_class.playback_frame)
Global.current_project, layer_class.playback_frame var audio_color := Color.LIGHT_GRAY
) var pressed_stylebox := Global.control.theme.get_stylebox(&"pressed", &"CelButton")
if frame_pos >= 0 and frame_pos < audio_length: if pressed_stylebox is StyleBoxFlat:
audio_color = pressed_stylebox.border_color
var is_last_frame := frame + 1 >= project.frames.size()
if not is_last_frame:
is_last_frame = (
project.frames[frame + 1].position_in_seconds(project, layer_class.playback_frame)
>= audio_length
)
if frame_pos == 0 or (is_last_frame and frame_pos < audio_length):
cel_texture.texture = preload("res://assets/graphics/misc/musical_note.png") cel_texture.texture = preload("res://assets/graphics/misc/musical_note.png")
cel_texture.self_modulate = audio_color
linked_rect.visible = false
else: else:
linked_rect.visible = frame_pos < audio_length and frame_pos > 0
linked_rect.color = audio_color
cel_texture.texture = null cel_texture.texture = null

View file

@ -36,7 +36,7 @@ func _ready() -> void:
Global.cel_switched.connect(_on_cel_switched) Global.cel_switched.connect(_on_cel_switched)
var layer := Global.current_project.layers[layer_index] var layer := Global.current_project.layers[layer_index]
layer.name_changed.connect(func(): label.text = layer.name) layer.name_changed.connect(func(): label.text = layer.name)
layer.visibility_changed.connect(update_buttons) layer.visibility_changed.connect(_on_layer_visibility_changed)
if layer is PixelLayer: if layer is PixelLayer:
linked_button.visible = true linked_button.visible = true
elif layer is GroupLayer: elif layer is GroupLayer:
@ -86,6 +86,13 @@ func _on_cel_switched() -> void:
_play_audio(true) _play_audio(true)
func _on_layer_visibility_changed() -> void:
update_buttons()
var layer := Global.current_project.layers[layer_index]
if layer is AudioLayer:
_play_audio(not animation_running)
func _on_animation_started(_dir: bool) -> void: func _on_animation_started(_dir: bool) -> void:
animation_running = true animation_running = true
_play_audio(false) _play_audio(false)