Tarot: bidding phase

- quick_app: command line is now parsed, "profile" option allow to select it
- xml_tools: list-single is now managed
- plugin tarot: method and signal to manage contract (contrat): tarotChooseContrat & tarotGameContratChoosed
- wix: Q&D Form hack to manage more generic form (not only registration), used to show contract selection form
This commit is contained in:
Goffi 2010-05-27 19:26:19 +09:30
commit 2f2a611ba3

View file

@ -26,8 +26,7 @@ import os.path, glob
import pdb
from logging import debug, info, error
from tools.jid import JID
from quick_frontend.quick_chat import QuickChat
from contact_list import ContactList
from form import Form
CARD_WIDTH = 74
CARD_HEIGHT = 136
@ -140,6 +139,21 @@ class CardPanel(wx.Panel):
self.hand.sort()
self.my_turn = True
def contratSelected(self, data):
"""Called when the contrat has been choosed
@param data: form result"""
debug (_("Contrat choosed"))
print "\n\n\n===============>>>> \o/ :) :) :) ", data, "\n\n\n"
contrat = data[0][1]
self.parent.host.bridge.tarotGameContratChoosed(self.user, self.referee, contrat or 'Passe', self.parent.host.profile)
def chooseContrat(self, xml_data):
"""Called when the player as to select hist contrat
@param xml_data: SàT xml representation of the form"""
misc = {'callback': self.contratSelected}
form = Form(self.parent.host, xml_data, title = _('Please choose your contrat'), options = ['NO_CANCEL'], misc = misc)
def _is_on_hand(self, pos_x, pos_y):
"""Return True if the coordinate are on the hand cards"""
if pos_x > self.orig_x and pos_y > self.orig_y \