changeset 680:8281587eb528

primitivus, wix: fixed bridge methods calls for plugins radiocol and card game
author souliane <souliane@mailoo.org>
date Tue, 22 Oct 2013 16:24:11 +0200
parents 59c9a7ff903d
children 66633443bcd7
files frontends/src/primitivus/card_game.py frontends/src/quick_frontend/quick_card_game.py frontends/src/wix/card_game.py frontends/src/wix/quiz_game.py
diffstat 4 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/card_game.py	Tue Oct 22 09:41:27 2013 +0200
+++ b/frontends/src/primitivus/card_game.py	Tue Oct 22 16:24:11 2013 +0200
@@ -224,7 +224,7 @@
         self.hand_wid = Hand(selectable = True, on_click = self.onClick)
         self.main_frame = urwid.Frame(self.center,header=self.top, footer=self.hand_wid, focus_part='footer')
         urwid.WidgetWrap.__init__(self,self.main_frame)
-        self.parent.host.bridge.tarotGameReady(player_nick, referee, profile_key = self.parent.host.profile)
+        self.parent.host.bridge.tarotGameReady(player_nick, referee, self.parent.host.profile)
 
     def loadCards(self):
         """Load all the cards in memory"""
@@ -275,7 +275,7 @@
             for location in ['top','left','bottom','right']:
                 self.table.putCard(location, None)
             self.parent.host.redraw()
-            self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, profile_key = self.parent.host.profile)
+            self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, self.parent.host.profile)
         if not winners and not loosers:
             title = _("Draw game")
         else:
@@ -329,7 +329,7 @@
                 self.parent.host.showPopUp(pop_up_widget)
         elif self.state == "play":
             card = card_wid.getCard()
-            self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], profile_key = self.parent.host.profile)
+            self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], self.parent.host.profile)
             self.hand.remove(card)
             self.hand_wid.update(self.hand)
             self.state = "wait"
@@ -341,6 +341,6 @@
             ecart.append((card.suit, card.value))
             self.hand.remove(card)
         self.hand_wid.update(self.hand)
-        self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, ecart, profile_key = self.parent.host.profile)
+        self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, ecart, self.parent.host.profile)
         self.state = "wait"
         self.parent.host.removePopUp()
--- a/frontends/src/quick_frontend/quick_card_game.py	Tue Oct 22 09:41:27 2013 +0200
+++ b/frontends/src/quick_frontend/quick_card_game.py	Tue Oct 22 16:24:11 2013 +0200
@@ -118,7 +118,7 @@
         if self._autoplay >= len(self.hand):
             self._autoplay = 0
         card = self.hand[self._autoplay]
-        self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], profile_key = self.parent.host.profile)
+        self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], self.parent.host.profile)
         del self.hand[self._autoplay]
         self.state = "wait"
         self._autoplay+=1
--- a/frontends/src/wix/card_game.py	Tue Oct 22 09:41:27 2013 +0200
+++ b/frontends/src/wix/card_game.py	Tue Oct 22 16:24:11 2013 +0200
@@ -70,7 +70,8 @@
         self.Bind(wx.EVT_PAINT, self.onPaint)
         self.Bind(wx.EVT_MOTION, self.onMouseMove)
         self.Bind(wx.EVT_LEFT_UP, self.onMouseClick)
-        self.parent.host.bridge.tarotGameReady(player_nick, referee, profile_key = self.parent.host.profile)
+
+        self.parent.host.bridge.tarotGameReady(player_nick, referee, self.parent.host.profile)
 
     def loadCards(self, dir):
         """Load all the cards in memory
@@ -106,7 +107,7 @@
         def _new_game(ignore):
             self.resetRound()
             self.Refresh()
-            self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, profile_key = self.parent.host.profile)
+            self.parent.host.bridge.tarotGameReady(self.player_nick, self.referee, self.parent.host.profile)
 
         if not winners and not loosers:
             title = _("Draw game")
@@ -245,14 +246,14 @@
                                    ecart.append((card.suit, card.value))
                                    self.hand.remove(card)
                                del self.selected[:]
-                               self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, ecart, profile_key = self.parent.host.profile)
+                               self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, ecart, self.parent.host.profile)
                                self.state = "wait"
 
                    self._recalc_ori()
                    self.Refresh()
                if self.state == "play":
                    card = self.hand[idx]
-                   self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], profile_key = self.parent.host.profile)
+                   self.parent.host.bridge.tarotGamePlayCards(self.player_nick, self.referee, [(card.suit, card.value)], self.parent.host.profile)
                    del self.hand[idx]
                    self.state = "wait"
                    self._recalc_ori()
--- a/frontends/src/wix/quiz_game.py	Tue Oct 22 09:41:27 2013 +0200
+++ b/frontends/src/wix/quiz_game.py	Tue Oct 22 16:24:11 2013 +0200
@@ -152,7 +152,7 @@
             self.players_data[i]['answer'] = None #True if the player gave a good answer
             self.players_data[i]['score'] = 0
         self.answer.Bind(wx.EVT_TEXT_ENTER, self.answered)
-        self.parent.host.bridge.quizGameReady(player_nick, referee, profile_key = self.parent.host.profile)
+        self.parent.host.bridge.quizGameReady(player_nick, referee, self.parent.host.profile)
         self.state = None
 
     def answered(self, event):
@@ -160,7 +160,7 @@
         self.last_answer = self.answer.GetValue()
         self.answer.Clear()
         if self.last_answer:
-            self.parent.host.bridge.quizGameAnswer(self.player_nick, self.referee, self.last_answer, profile_key = self.parent.host.profile)
+            self.parent.host.bridge.quizGameAnswer(self.player_nick, self.referee, self.last_answer, self.parent.host.profile)
 
     def quizGameTimerExpired(self):
         """Called when nobody answered the question in time"""