fix: start AnimatedTextures unpaused to fix race condition

AnimatedTextures were created paused, relying on the gui_focus_changed
handler to unpause them. But get_boxart is async — by the time the
AnimatedTexture is set on the TextureRect, focus may already be on the
card, so gui_focus_changed never fires for it. Animation stays paused.

Start unpaused instead. The focus handler still pauses unfocused cards
and unpauses focused ones, so only the active card animates.

Bump to v0.1.17
This commit is contained in:
Jose Falanga 2026-08-20 00:21:35 -03:00
parent 157593e853
commit 92851f4e1e

View file

@ -449,9 +449,8 @@ func _fetch_image(url: String, cache_flags: int) -> Texture2D:
## Downloads a GIF and converts it to a Godot texture. When animated GIFs
## are enabled, extracts all frames and returns an AnimatedTexture (paused
## by default — the focus handler unpauses it). Otherwise extracts only
## the first frame and returns a static ImageTexture.
## are enabled, extracts all frames and returns an AnimatedTexture. Otherwise
## extracts only the first frame and returns a static ImageTexture.
## Results are cached in _animated_texture_cache keyed by URL.
func _fetch_gif_as_texture(url: String, cache_flags: int) -> Texture2D:
# Return cached result if available.
@ -569,7 +568,6 @@ func _extract_gif_frames(ffmpeg_bin: String, gif_path: String, frames_dir: Strin
func _assemble_animated_texture(frame_files: PackedStringArray, frames_dir: String, delays: Array, url: String) -> AnimatedTexture:
var anim_tex := AnimatedTexture.new()
anim_tex.frames_count = frame_files.size()
anim_tex.pause = true # Start paused — focus handler unpauses.
for i in frame_files.size():
var frame_path := frames_dir + "/" + frame_files[i]