mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-03-13 14:55:18 +00:00
Make the canvas preview play button respect frame tags
This commit is contained in:
parent
d7065ad6ae
commit
388c121520
1 changed files with 14 additions and 2 deletions
|
@ -26,11 +26,23 @@ func _draw() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_AnimationTimer_timeout() -> 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
|
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
|
frame += 1
|
||||||
else:
|
else:
|
||||||
frame = 0
|
frame = first_frame
|
||||||
|
|
||||||
$AnimationTimer.set_one_shot(true)
|
$AnimationTimer.set_one_shot(true)
|
||||||
$AnimationTimer.wait_time = (
|
$AnimationTimer.wait_time = (
|
||||||
|
|
Loading…
Add table
Reference in a new issue