All checks were successful
Build plugin / build (push) Successful in 1m8s
- Add settings menu with 'Animate GIF covers' toggle (default: off) - When enabled: extract all GIF frames via ffmpeg, build AnimatedTexture - When disabled: extract first frame only (static ImageTexture) - AnimatedTexture starts paused — unpauses only when card has focus - Focus-based pausing via gui_focus_changed signal (walks up to GameCard) - Parse GIF89a frame delays for accurate animation speed - Cache invalidation when setting changes (no restart needed) - Cache AnimatedTextures in memory to avoid re-extraction - Bump to v0.1.13
25 lines
845 B
GDScript
25 lines
845 B
GDScript
extends VBoxContainer
|
|
|
|
## Settings screen for the itch.io art provider.
|
|
##
|
|
## Provides a toggle for animated GIF covers. When enabled, GIF cover art
|
|
## is extracted frame-by-frame and displayed as an AnimatedTexture that
|
|
## pauses when the card loses focus.
|
|
|
|
var settings_manager := load("res://core/global/settings_manager.tres") as SettingsManager
|
|
|
|
const SETTING_SECTION := "plugin.artprovider"
|
|
const SETTING_ANIMATED_GIFS := "animated_gifs"
|
|
|
|
@onready var animated_toggle: Toggle = $%AnimatedGifsToggle
|
|
|
|
|
|
func _ready() -> void:
|
|
animated_toggle.button_pressed = settings_manager.get_value(
|
|
SETTING_SECTION, SETTING_ANIMATED_GIFS, false
|
|
) as bool
|
|
animated_toggle.toggled.connect(_on_animated_gifs_toggled)
|
|
|
|
|
|
func _on_animated_gifs_toggled(pressed: bool) -> void:
|
|
settings_manager.set_value(SETTING_SECTION, SETTING_ANIMATED_GIFS, pressed)
|