From 069c8e8a7bb9e24532130910dbdffd1445c85baf Mon Sep 17 00:00:00 2001 From: Joe R Date: Sun, 26 Nov 2023 12:02:40 -0500 Subject: [PATCH] Fixed bug with the preview using the wrong cardset after loading one with a subtype. --- pysollib/pysolgtk/selectgame.py | 4 ++++ pysollib/tile/selectgame.py | 4 ++++ pysollib/tk/selectgame.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/pysollib/pysolgtk/selectgame.py b/pysollib/pysolgtk/selectgame.py index 80b4fbee..c4704b66 100644 --- a/pysollib/pysolgtk/selectgame.py +++ b/pysollib/pysolgtk/selectgame.py @@ -427,6 +427,10 @@ class SelectGameDialogWithPreview(MfxDialog): c = self.app.cardsets_cache.get(gi.category) if c: c2 = c.get(gi.subcategory) + if not c2: + c = self.app.cardsets_cache.get(cardset.type) + if c: + c2 = c.get(cardset.subtype) if c2: self.preview_app.images = c2[2] else: diff --git a/pysollib/tile/selectgame.py b/pysollib/tile/selectgame.py index 5238e79a..2cd5801a 100644 --- a/pysollib/tile/selectgame.py +++ b/pysollib/tile/selectgame.py @@ -745,6 +745,10 @@ class SelectGameDialogWithPreview(SelectGameDialog): c = self.app.cardsets_cache.get(gi.category) if c: c2 = c.get(gi.subcategory) + if not c2: + c = self.app.cardsets_cache.get(cardset.type) + if c: + c2 = c.get(cardset.subtype) if c2: self.preview_app.images = c2[2] else: diff --git a/pysollib/tk/selectgame.py b/pysollib/tk/selectgame.py index 6b3f2622..57ec26d0 100644 --- a/pysollib/tk/selectgame.py +++ b/pysollib/tk/selectgame.py @@ -520,6 +520,10 @@ class SelectGameDialogWithPreview(SelectGameDialog): c = self.app.cardsets_cache.get(gi.category) if c: c2 = c.get(gi.subcategory) + if not c2: + c = self.app.cardsets_cache.get(cardset.type) + if c: + c2 = c.get(cardset.subtype) if c2: self.preview_app.images = c2[2] else: