comparison 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
comparison
equal deleted inserted replaced
35:d43d6e4b9dc8 36:1d406077b49b
45 from pyjamas import DOM 45 from pyjamas import DOM
46 from __pyjamas__ import JS, doc 46 from __pyjamas__ import JS, doc
47 47
48 from pyjamas.dnd import makeDraggable 48 from pyjamas.dnd import makeDraggable
49 from pyjamas.ui.DragWidget import DragWidget, DragContainer 49 from pyjamas.ui.DragWidget import DragWidget, DragContainer
50 from card_game import CardPanel
50 from jid import JID 51 from jid import JID
51 from tools import html_sanitize 52 from tools import html_sanitize
52 from datetime import datetime 53 from datetime import datetime
53 from time import time 54 from time import time
54 from dialog import ContactsChooser 55 from dialog import ContactsChooser
553 if msg.startswith('/me '): 554 if msg.startswith('/me '):
554 self.printInfo('* %s %s' % (nick, msg[4:]),type='me') 555 self.printInfo('* %s %s' % (nick, msg[4:]),type='me')
555 return 556 return
556 self.content.add(ChatText(timestamp, nick, mymess, msg)) 557 self.content.add(ChatText(timestamp, nick, mymess, msg))
557 self.content_scroll.scrollToBottom() 558 self.content_scroll.scrollToBottom()
559
560 def startGame(self, game_type, referee, players):
561 """Configure the chat window to start a game"""
562 if game_type=="Tarot":
563 self.tarot_panel = CardPanel(self, referee, players, self.nick)
564 self.vpanel.insert(self.tarot_panel, 1)
565 self.vpanel.setCellHeight(self.tarot_panel, self.tarot_panel.getHeight())
558 566
559 class MainDiscussionPanel(HorizontalPanel): 567 class MainDiscussionPanel(HorizontalPanel):
560 568
561 def __init__(self, host): 569 def __init__(self, host):
562 self.host=host 570 self.host=host