mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Failsafe to account for missing cardsets in playable preview.
This commit is contained in:
parent
699ccb00ac
commit
2e9f242ce8
4 changed files with 16 additions and 7 deletions
|
@ -93,7 +93,7 @@ class AcesAndKings(Game):
|
||||||
anchor="center",
|
anchor="center",
|
||||||
font=font)
|
font=font)
|
||||||
stack.texts.misc.config(text=(RANKS[i[0]][0]))
|
stack.texts.misc.config(text=(RANKS[i[0]][0]))
|
||||||
s.foundations.append(stack)
|
s.foundations.append(stack)
|
||||||
|
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x = x + (l.XS / 2)
|
x = x + (l.XS / 2)
|
||||||
|
@ -108,7 +108,7 @@ class AcesAndKings(Game):
|
||||||
anchor="center",
|
anchor="center",
|
||||||
font=font)
|
font=font)
|
||||||
stack.texts.misc.config(text=(RANKS[i[1]][0]))
|
stack.texts.misc.config(text=(RANKS[i[1]][0]))
|
||||||
s.foundations.append(stack)
|
s.foundations.append(stack)
|
||||||
|
|
||||||
x = x + l.XS
|
x = x + l.XS
|
||||||
x, y = l.XM, y + l.YS
|
x, y = l.XM, y + l.YS
|
||||||
|
|
|
@ -420,7 +420,10 @@ class SelectGameDialogWithPreview(MfxDialog):
|
||||||
self.app.loadCardset(cardset, id=gi.category,
|
self.app.loadCardset(cardset, id=gi.category,
|
||||||
tocache=True, noprogress=True)
|
tocache=True, noprogress=True)
|
||||||
c = self.app.cardsets_cache.get(gi.category)
|
c = self.app.cardsets_cache.get(gi.category)
|
||||||
self.preview_app.images = c[2]
|
if c:
|
||||||
|
self.preview_app.images = c[2]
|
||||||
|
else:
|
||||||
|
self.preview_app.images = self.app.subsampled_images
|
||||||
|
|
||||||
self.preview_app.audio = None # turn off audio for initial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
|
|
|
@ -356,10 +356,10 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
sh = self.top.winfo_screenheight()
|
sh = self.top.winfo_screenheight()
|
||||||
|
|
||||||
h = sh * .8
|
h = sh * .8
|
||||||
w1, w2 = min(250, sw / 4), max(sw / 2 + ((sw / 4) - 250), sw / 2)
|
w1, w2 = min(250, sw / 3), max(sw / 2 + ((sw / 3) - 250), sw / 2)
|
||||||
|
|
||||||
# print sw, w1, w2
|
# print sw, w1, w2
|
||||||
w2 = max(200, min(w2, 10 + 12 * (app.subsampled_images.CARDW + 10)))
|
# w2 = max(200, min(w2, 10 + 12 * (app.subsampled_images.CARDW + 10)))
|
||||||
# print sw, w1, w2
|
# print sw, w1, w2
|
||||||
# padx, pady = kw.padx, kw.pady
|
# padx, pady = kw.padx, kw.pady
|
||||||
# padx, pady = kw.padx/2, kw.pady/2
|
# padx, pady = kw.padx/2, kw.pady/2
|
||||||
|
@ -509,7 +509,10 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
self.app.loadCardset(cardset, id=gi.category,
|
self.app.loadCardset(cardset, id=gi.category,
|
||||||
tocache=True, noprogress=True)
|
tocache=True, noprogress=True)
|
||||||
c = self.app.cardsets_cache.get(gi.category)
|
c = self.app.cardsets_cache.get(gi.category)
|
||||||
self.preview_app.images = c[2]
|
if c:
|
||||||
|
self.preview_app.images = c[2]
|
||||||
|
else:
|
||||||
|
self.preview_app.images = self.app.subsampled_images
|
||||||
|
|
||||||
self.preview_app.audio = None # turn off audio for initial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
|
|
|
@ -511,7 +511,10 @@ class SelectGameDialogWithPreview(SelectGameDialog):
|
||||||
self.app.loadCardset(cardset, id=gi.category,
|
self.app.loadCardset(cardset, id=gi.category,
|
||||||
tocache=True, noprogress=True)
|
tocache=True, noprogress=True)
|
||||||
c = self.app.cardsets_cache.get(gi.category)
|
c = self.app.cardsets_cache.get(gi.category)
|
||||||
self.preview_app.images = c[2]
|
if c:
|
||||||
|
self.preview_app.images = c[2]
|
||||||
|
else:
|
||||||
|
self.preview_app.images = self.app.subsampled_images
|
||||||
|
|
||||||
self.preview_app.audio = None # turn off audio for initial dealing
|
self.preview_app.audio = None # turn off audio for initial dealing
|
||||||
if animations >= 0:
|
if animations >= 0:
|
||||||
|
|
Loading…
Add table
Reference in a new issue