1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-03-12 22:35:18 +00:00

Make the canvas preview play button respect frame tags

This commit is contained in:
Emmanouil Papadeas 2022-07-21 22:26:01 +03:00
parent d7065ad6ae
commit 388c121520

View file

@ -26,11 +26,23 @@ func _draw() -> void:
func _on_AnimationTimer_timeout() -> void:
var first_frame := 0
var last_frame: int = Global.current_project.frames.size() - 1
var current_project: Project = Global.current_project
if frame < current_project.frames.size() - 1:
if Global.play_only_tags:
for tag in current_project.animation_tags:
if (
current_project.current_frame + 1 >= tag.from
&& current_project.current_frame + 1 <= tag.to
):
first_frame = tag.from - 1
last_frame = min(current_project.frames.size() - 1, tag.to - 1)
if frame < last_frame:
frame += 1
else:
frame = 0
frame = first_frame
$AnimationTimer.set_one_shot(true)
$AnimationTimer.wait_time = (