fix: promote focus handler logs from DEBUG to INFO
All checks were successful
Build plugin / build (push) Successful in 1m13s

Default logger level is INFO, so all debug logs in _on_focus_changed
were silently filtered. Promoted to INFO to diagnose why the handler
never fires. Also log viewport connection on startup.

Bump to v0.1.19
This commit is contained in:
Jose Falanga 2026-08-20 00:45:21 -03:00
parent d9e59a411f
commit 494a00bb2a

View file

@ -62,6 +62,7 @@ func _ready() -> void:
logger.info("itch.io Art Provider loaded (animated_gifs=%s)" % str(_last_animated_setting))
add_child(http_image)
get_viewport().gui_focus_changed.connect(_on_focus_changed)
logger.info("Connected gui_focus_changed signal on viewport: %s" % str(get_viewport()))
## Returns whether animated GIF covers are enabled in settings.
@ -75,41 +76,41 @@ func _on_focus_changed(control: Control) -> void:
# Pause the previously focused animation.
if _focused_animated_texture != null:
if is_instance_valid(_focused_animated_texture):
logger.debug("Focus: pausing previous AnimatedTexture")
logger.info("Focus: pausing previous AnimatedTexture")
_focused_animated_texture.pause = true
_focused_animated_texture = null
if control == null:
logger.debug("Focus: control is null")
logger.info("Focus: control is null")
return
logger.debug("Focus: control=%s (%s)" % [control.name, control.get_class()])
logger.info("Focus: control=%s (%s)" % [control.name, control.get_class()])
# Walk up the tree to find the GameCard parent.
var card: Control = control
while card != null:
if not is_instance_valid(card):
logger.debug("Focus: invalid node while walking up")
logger.info("Focus: invalid node while walking up")
return
if card is GameCard:
break
card = card.get_parent()
if card == null:
logger.debug("Focus: no GameCard ancestor found for %s" % control.name)
logger.info("Focus: no GameCard ancestor found for %s" % control.name)
return
# Check if the card's TextureRect has an AnimatedTexture.
var texture_rect := card.get_node_or_null("%TextureRect") as TextureRect
if texture_rect == null:
logger.debug("Focus: %%TextureRect not found in card %s" % card.name)
logger.info("Focus: %%TextureRect not found in card %s" % card.name)
return
if texture_rect.texture is AnimatedTexture:
_focused_animated_texture = texture_rect.texture as AnimatedTexture
_focused_animated_texture.pause = false
logger.debug("Focus: unpaused AnimatedTexture on %s (%d frames)" % [card.name, _focused_animated_texture.frames_count])
logger.info("Focus: unpaused AnimatedTexture on %s (%d frames)" % [card.name, _focused_animated_texture.frames_count])
else:
logger.debug("Focus: texture on %s is %s (not AnimatedTexture)" % [card.name, str(texture_rect.texture)])
logger.info("Focus: texture on %s is %s (not AnimatedTexture)" % [card.name, str(texture_rect.texture)])
## Strips HTML srcset artifacts from a URL. Butlerd sometimes passes through