Quizz game: first draft

This commit is contained in:
Goffi 2011-06-12 16:28:33 +02:00
commit fb41ecbbf5

View file

@ -30,6 +30,7 @@ from sat.tools.jid import JID
from sat_frontends.quick_frontend.quick_chat import QuickChat
from sat_frontends.wix.contact_list import ContactList
from sat_frontends.wix.card_game import CardPanel
from sat_frontends.wix.quiz_game import QuizPanel
idSEND = 1
@ -118,13 +119,21 @@ class Chat(wx.Frame, QuickChat):
self.sizer.Layout()
self.Fit()
self.splitter.UpdateSize()
elif game_type=="Quiz":
debug (_("configure chat window for Quiz game"))
self.quiz_panel = QuizPanel(self, referee, players, self.nick)
self.sizer.Prepend(self.quiz_panel, 0, flag=wx.EXPAND)
self.sizer.Layout()
self.Fit()
self.splitter.UpdateSize()
def getGame(self, game_type):
"""Return class managing the game type"""
#TODO: check that the game is launched, and manage errors
if game_type=="Tarot":
return self.tarot_panel
elif game_type=="Quiz":
return self.quiz_panel
def setPresents(self, nicks):
"""Set the users presents in the contact list for a group chat