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

Unmute audio layes when making them visible while the animation is playing

This commit is contained in:
Emmanouil Papadeas 2024-12-14 17:18:52 +02:00
parent 0fad406967
commit 8e55b91a39

View file

@ -36,7 +36,7 @@ func _ready() -> void:
Global.cel_switched.connect(_on_cel_switched)
var layer := Global.current_project.layers[layer_index]
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:
linked_button.visible = true
elif layer is GroupLayer:
@ -86,6 +86,13 @@ func _on_cel_switched() -> void:
_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:
animation_running = true
_play_audio(false)