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:
parent
2ed9aa4168
commit
b23c2d724e
3 changed files with 8 additions and 13 deletions
|
@ -2075,7 +2075,8 @@ class Game(object):
|
||||||
d = MfxMessageDialog(
|
d = MfxMessageDialog(
|
||||||
self.top, title=_("Game won"),
|
self.top, title=_("Game won"),
|
||||||
text='\n' + congrats + '\n\n' + text + '\n' + top_msg + '\n',
|
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])
|
image=self.app.gimages.logos[5])
|
||||||
elif status == 1:
|
elif status == 1:
|
||||||
top_msg = self.updateStats()
|
top_msg = self.updateStats()
|
||||||
|
@ -2091,7 +2092,8 @@ class Game(object):
|
||||||
d = MfxMessageDialog(
|
d = MfxMessageDialog(
|
||||||
self.top, title=_("Game won"),
|
self.top, title=_("Game won"),
|
||||||
text='\n' + congrats + '\n\n' + text + '\n' + top_msg + '\n',
|
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])
|
image=self.app.gimages.logos[4])
|
||||||
elif self.gstats.updated < 0:
|
elif self.gstats.updated < 0:
|
||||||
self.finished = True
|
self.finished = True
|
||||||
|
@ -2099,14 +2101,14 @@ class Game(object):
|
||||||
d = MfxMessageDialog(
|
d = MfxMessageDialog(
|
||||||
self.top, title=_("Game finished"), bitmap="info",
|
self.top, title=_("Game finished"), bitmap="info",
|
||||||
text=_("\nGame finished\n"),
|
text=_("\nGame finished\n"),
|
||||||
strings=(_("&New game"), None, _("&Cancel")))
|
strings=(_("&New game"), None, None, _("&Close")))
|
||||||
else:
|
else:
|
||||||
self.finished = True
|
self.finished = True
|
||||||
self.playSample("gamelost", priority=1000)
|
self.playSample("gamelost", priority=1000)
|
||||||
d = MfxMessageDialog(
|
d = MfxMessageDialog(
|
||||||
self.top, title=_("Game finished"), bitmap="info",
|
self.top, title=_("Game finished"), bitmap="info",
|
||||||
text=_("\nGame finished, but not without my help...\n"),
|
text=_("\nGame finished, but not without my help...\n"),
|
||||||
strings=(_("&New game"), _("&Restart"), _("&Cancel")))
|
strings=(_("&New game"), _("&Restart"), None, _("&Cancel")))
|
||||||
self.updateMenus()
|
self.updateMenus()
|
||||||
if TOOLKIT == 'kivy':
|
if TOOLKIT == 'kivy':
|
||||||
return True
|
return True
|
||||||
|
@ -2117,6 +2119,8 @@ class Game(object):
|
||||||
elif d.status == 0 and d.button == 1:
|
elif d.status == 0 and d.button == 1:
|
||||||
# restart game
|
# restart game
|
||||||
self.restartGame()
|
self.restartGame()
|
||||||
|
elif d.status == 0 and d.button == 2:
|
||||||
|
self.stopWinAnimation()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -310,8 +310,6 @@ class CribbageShuffle(CribbageSquare):
|
||||||
self._startAndDealRow()
|
self._startAndDealRow()
|
||||||
self.s.talon.flipMove()
|
self.s.talon.flipMove()
|
||||||
|
|
||||||
def checkForWin(self):
|
|
||||||
return 0
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Cribbage Square (Waste)
|
# * Cribbage Square (Waste)
|
||||||
|
@ -319,7 +317,6 @@ class CribbageShuffle(CribbageSquare):
|
||||||
# * Cribbage Square (2 Reserves)
|
# * Cribbage Square (2 Reserves)
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
|
|
||||||
class CribbageSquareWaste(CribbageSquare):
|
class CribbageSquareWaste(CribbageSquare):
|
||||||
NUM_RESERVE = 1
|
NUM_RESERVE = 1
|
||||||
RESERVE_STACK = StackWrapper(ReserveStack, max_cards=5, max_move=0)
|
RESERVE_STACK = StackWrapper(ReserveStack, max_cards=5, max_move=0)
|
||||||
|
|
|
@ -296,9 +296,6 @@ class PokerShuffle(PokerSquare):
|
||||||
self.moveMove(27, self.s.talon, self.s.internals[0], frames=0)
|
self.moveMove(27, self.s.talon, self.s.internals[0], frames=0)
|
||||||
self._startAndDealRow()
|
self._startAndDealRow()
|
||||||
|
|
||||||
def checkForWin(self):
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Poker Square (Waste)
|
# * Poker Square (Waste)
|
||||||
|
@ -359,9 +356,6 @@ class Maverick(PokerShuffle):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def checkForWin(self):
|
|
||||||
return Game.checkForWin(self)
|
|
||||||
|
|
||||||
|
|
||||||
# register the game
|
# register the game
|
||||||
registerGame(GameInfo(139, PokerSquare, "Poker Square",
|
registerGame(GameInfo(139, PokerSquare, "Poker Square",
|
||||||
|
|
Loading…
Add table
Reference in a new issue