diff browser_side/panels.py @ 36:1d406077b49b

Tarot Game: first draft
author Goffi <goffi@goffi.org>
date Tue, 17 May 2011 01:33:12 +0200
parents d43d6e4b9dc8
children b306aa090438
line wrap: on
line diff
--- a/browser_side/panels.py	Mon May 16 18:19:35 2011 +0200
+++ b/browser_side/panels.py	Tue May 17 01:33:12 2011 +0200
@@ -47,6 +47,7 @@
 
 from pyjamas.dnd import makeDraggable
 from pyjamas.ui.DragWidget import DragWidget, DragContainer
+from card_game import CardPanel 
 from jid import JID
 from tools import html_sanitize
 from datetime import datetime
@@ -555,6 +556,13 @@
             return
         self.content.add(ChatText(timestamp, nick, mymess, msg))
         self.content_scroll.scrollToBottom()
+    
+    def startGame(self, game_type, referee, players):
+        """Configure the chat window to start a game"""
+        if game_type=="Tarot":
+            self.tarot_panel = CardPanel(self, referee, players, self.nick)
+            self.vpanel.insert(self.tarot_panel, 1)
+            self.vpanel.setCellHeight(self.tarot_panel, self.tarot_panel.getHeight())
 
 class MainDiscussionPanel(HorizontalPanel):