comparison frontends/primitivus/card_game.py @ 162:ae50b53ff868

misc Tarot fixes - wix, primitivus, quick_frontend: autoplay fonction is activated by changing self._autoplay from None to 0 in quick card game - primitivus: added forgotten import of log methods - primitivus: fix bad selected color for notification messages - primitivus: score are now shown
author Goffi <goffi@goffi.org>
date Fri, 06 Aug 2010 12:18:50 +0800
parents 2fa58703f1b7
children 3198bfd66daa
comparison
equal deleted inserted replaced
161:c37826d80f2a 162:ae50b53ff868
273 273
274 def showScores(self, xml_data, winners, loosers): 274 def showScores(self, xml_data, winners, loosers):
275 """Called when the player as to select hist contrat 275 """Called when the player as to select hist contrat
276 @param xml_data: SàT xml representation of the form""" 276 @param xml_data: SàT xml representation of the form"""
277 form = XMLUI(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL']) 277 form = XMLUI(self.parent.host, xml_data, title = _('You win \o/') if self.player_nick in winners else _('You loose :('), options = ['NO_CANCEL'])
278 form.show()
278 279
279 def invalidCards(self, phase, played_cards, invalid_cards): 280 def invalidCards(self, phase, played_cards, invalid_cards):
280 """Invalid cards have been played 281 """Invalid cards have been played
281 @param phase: phase of the game 282 @param phase: phase of the game
282 @param played_cards: all the cards played 283 @param played_cards: all the cards played
283 @param invalid_cards: cards which are invalid""" 284 @param invalid_cards: cards which are invalid"""
284 QuickCardGame.invalidCards(self, phase, played_cards, invalid_cards) 285 QuickCardGame.invalidCards(self, phase, played_cards, invalid_cards)
285 self.hand_wid.update(self.hand) 286 self.hand_wid.update(self.hand)
286 self.parent.host.notify(_('Cards played are invalid !')) 287 if self._autoplay==None: #No dialog if there is autoplay
288 self.parent.host.notify(_('Cards played are invalid !'))
287 self.parent.host.redraw() 289 self.parent.host.redraw()
288 290
289 def cardsPlayed(self, player, cards): 291 def cardsPlayed(self, player, cards):
290 """A card has been played by player""" 292 """A card has been played by player"""
291 QuickCardGame.cardsPlayed(self, player, cards) 293 QuickCardGame.cardsPlayed(self, player, cards)