Basic animated cover support

This commit is contained in:
kramo
2023-04-10 23:24:48 +02:00
parent c1715aa328
commit 62aff0e7cc
6 changed files with 79 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ import sys
from gi.repository import GdkPixbuf, Gio, Gtk
from .display_animation import display_animation
from .save_game import save_game
@@ -58,6 +59,12 @@ class game(Gtk.Box): # pylint: disable=invalid-name
self.blacklisted = "blacklisted" in data
self.pixbuf = self.get_cover()
self.animation_path = (
self.parent_widget.data_dir
/ "cartridges"
/ "animated_covers"
/ self.game_id
)
self.cover.set_pixbuf(self.pixbuf)
self.title.set_label(self.name)
@@ -82,6 +89,9 @@ class game(Gtk.Box): # pylint: disable=invalid-name
self.menu_button.set_menu_model(self.game_options)
self.menu_button.get_popover().connect("notify::visible", self.hide_play)
if self.animation_path.is_file():
display_animation(self.cover.set_pixbuf, self.animation_path)
def launch(self):
# Generate launch arguments, either list (no shell) or a string (for shell).
args = (