comparison frontends/src/wix/quiz_game.py @ 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 84a6e83157c2
children bfabeedbf32e
comparison
equal deleted inserted replaced
679:59c9a7ff903d 680:8281587eb528
150 self.players_data[i]['bubble'] = wx.TextCtrl(self, -1, pos=(39+i*184, 120), size=(180, 56), style=wx.TE_MULTILINE | wx.TE_READONLY) 150 self.players_data[i]['bubble'] = wx.TextCtrl(self, -1, pos=(39+i*184, 120), size=(180, 56), style=wx.TE_MULTILINE | wx.TE_READONLY)
151 self.players_data[i]['bubble'].Hide() 151 self.players_data[i]['bubble'].Hide()
152 self.players_data[i]['answer'] = None #True if the player gave a good answer 152 self.players_data[i]['answer'] = None #True if the player gave a good answer
153 self.players_data[i]['score'] = 0 153 self.players_data[i]['score'] = 0
154 self.answer.Bind(wx.EVT_TEXT_ENTER, self.answered) 154 self.answer.Bind(wx.EVT_TEXT_ENTER, self.answered)
155 self.parent.host.bridge.quizGameReady(player_nick, referee, profile_key = self.parent.host.profile) 155 self.parent.host.bridge.quizGameReady(player_nick, referee, self.parent.host.profile)
156 self.state = None 156 self.state = None
157 157
158 def answered(self, event): 158 def answered(self, event):
159 """Called when the player gave an answer in the box""" 159 """Called when the player gave an answer in the box"""
160 self.last_answer = self.answer.GetValue() 160 self.last_answer = self.answer.GetValue()
161 self.answer.Clear() 161 self.answer.Clear()
162 if self.last_answer: 162 if self.last_answer:
163 self.parent.host.bridge.quizGameAnswer(self.player_nick, self.referee, self.last_answer, profile_key = self.parent.host.profile) 163 self.parent.host.bridge.quizGameAnswer(self.player_nick, self.referee, self.last_answer, self.parent.host.profile)
164 164
165 def quizGameTimerExpired(self): 165 def quizGameTimerExpired(self):
166 """Called when nobody answered the question in time""" 166 """Called when nobody answered the question in time"""
167 self.question.SetValue(_(u"Quel dommage, personne n'a trouvé la réponse\n\nAttention, la prochaine question arrive...")) 167 self.question.SetValue(_(u"Quel dommage, personne n'a trouvé la réponse\n\nAttention, la prochaine question arrive..."))
168 168