1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Added option to return to the game after winning, and enabled winning of Cribbage/Poker Shuffle.

This commit is contained in:
Joe R 2021-08-23 19:18:21 -04:00
parent 2ed9aa4168
commit b23c2d724e
3 changed files with 8 additions and 13 deletions

View file

@ -2075,7 +2075,8 @@ class Game(object):
d = MfxMessageDialog(
self.top, title=_("Game won"),
text='\n' + congrats + '\n\n' + text + '\n' + top_msg + '\n',
strings=(_("&New game"), None, _("&Cancel")),
strings=(_("&New game"), None, _("&Back to game"),
_("&Cancel")),
image=self.app.gimages.logos[5])
elif status == 1:
top_msg = self.updateStats()
@ -2091,7 +2092,8 @@ class Game(object):
d = MfxMessageDialog(
self.top, title=_("Game won"),
text='\n' + congrats + '\n\n' + text + '\n' + top_msg + '\n',
strings=(_("&New game"), None, _("&Cancel")),
strings=(_("&New game"), None, _("&Back to game"),
_("&Cancel")),
image=self.app.gimages.logos[4])
elif self.gstats.updated < 0:
self.finished = True
@ -2099,14 +2101,14 @@ class Game(object):
d = MfxMessageDialog(
self.top, title=_("Game finished"), bitmap="info",
text=_("\nGame finished\n"),
strings=(_("&New game"), None, _("&Cancel")))
strings=(_("&New game"), None, None, _("&Close")))
else:
self.finished = True
self.playSample("gamelost", priority=1000)
d = MfxMessageDialog(
self.top, title=_("Game finished"), bitmap="info",
text=_("\nGame finished, but not without my help...\n"),
strings=(_("&New game"), _("&Restart"), _("&Cancel")))
strings=(_("&New game"), _("&Restart"), None, _("&Cancel")))
self.updateMenus()
if TOOLKIT == 'kivy':
return True
@ -2117,6 +2119,8 @@ class Game(object):
elif d.status == 0 and d.button == 1:
# restart game
self.restartGame()
elif d.status == 0 and d.button == 2:
self.stopWinAnimation()
return True
#

View file

@ -310,8 +310,6 @@ class CribbageShuffle(CribbageSquare):
self._startAndDealRow()
self.s.talon.flipMove()
def checkForWin(self):
return 0
# ************************************************************************
# * Cribbage Square (Waste)
@ -319,7 +317,6 @@ class CribbageShuffle(CribbageSquare):
# * Cribbage Square (2 Reserves)
# ************************************************************************
class CribbageSquareWaste(CribbageSquare):
NUM_RESERVE = 1
RESERVE_STACK = StackWrapper(ReserveStack, max_cards=5, max_move=0)

View file

@ -296,9 +296,6 @@ class PokerShuffle(PokerSquare):
self.moveMove(27, self.s.talon, self.s.internals[0], frames=0)
self._startAndDealRow()
def checkForWin(self):
return 0
# ************************************************************************
# * Poker Square (Waste)
@ -359,9 +356,6 @@ class Maverick(PokerShuffle):
return False
return True
def checkForWin(self):
return Game.checkForWin(self)
# register the game
registerGame(GameInfo(139, PokerSquare, "Poker Square",