Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
327:7c9784658163 | 328:809733b8d9be |
---|---|
103 form = XMLUI(self.parent.host, xml_data, title = _('Please choose your contrat'), options = ['NO_CANCEL'], misc = misc) | 103 form = XMLUI(self.parent.host, xml_data, title = _('Please choose your contrat'), options = ['NO_CANCEL'], misc = misc) |
104 | 104 |
105 def showScores(self, xml_data, winners, loosers): | 105 def showScores(self, xml_data, winners, loosers): |
106 """Called when the player as to select hist contrat | 106 """Called when the player as to select hist contrat |
107 @param xml_data: SàT xml representation of the form""" | 107 @param xml_data: SàT xml representation of the form""" |
108 form = XMLUI(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL']) | 108 def _new_game(ignore): |
109 self.resetRound() | |
110 self.Refresh() | |
111 self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, profile_key = self.parent.host.profile) | |
112 | |
113 if not winners and not loosers: | |
114 title = _("Draw game") | |
115 else: | |
116 title = _('You win \o/') if self.player_nick in winners else _('You loose :(') | |
117 form = XMLUI(self.parent.host, xml_data, title = title, options = ['NO_CANCEL'], misc={'callback':_new_game}) | |
109 | 118 |
110 def cardsPlayed(self, player, cards): | 119 def cardsPlayed(self, player, cards): |
111 """A card has been played by player""" | 120 """A card has been played by player""" |
112 QuickCardGame.cardsPlayed(self, player, cards) | 121 QuickCardGame.cardsPlayed(self, player, cards) |
113 self.Refresh() | 122 self.Refresh() |