Mercurial > libervia-backend
diff frontends/src/wix/card_game.py @ 328:809733b8d9be
Tarot game:
- draw game managed
- we can now play continuously \o/
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 23 May 2011 00:46:51 +0200 |
parents | b1794cbb88e5 |
children | 0806a65a5fa9 |
line wrap: on
line diff
--- a/frontends/src/wix/card_game.py Sun May 22 12:59:25 2011 +0200 +++ b/frontends/src/wix/card_game.py Mon May 23 00:46:51 2011 +0200 @@ -105,7 +105,16 @@ def showScores(self, xml_data, winners, loosers): """Called when the player as to select hist contrat @param xml_data: SàT xml representation of the form""" - form = XMLUI(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL']) + def _new_game(ignore): + self.resetRound() + self.Refresh() + self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, profile_key = self.parent.host.profile) + + if not winners and not loosers: + title = _("Draw game") + else: + title = _('You win \o/') if self.player_nick in winners else _('You loose :(') + form = XMLUI(self.parent.host, xml_data, title = title, options = ['NO_CANCEL'], misc={'callback':_new_game}) def cardsPlayed(self, player, cards): """A card has been played by player"""