예제 #1
0
 def __init__(self, menu_args, user):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.user = user
     self.dialog = YesNoDialog(
         base.a2dBottomLeft,
         text=_('%s wants to be a (XMPP) friend of you, do you agree?') %
         user,
         text_wordwrap=16,
         text_fg=menu_args.text_active,
         text_font=menu_args.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_args.text_active,
         button_text_font=menu_args.font,
         buttonValueList=['yes', 'no'],
         command=self.on_btn)
     size = self.dialog['frameSize']
     self.dialog.set_pos(-size[0] + .05, 1, -size[2] + .05)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #2
0
파일: invite_dlg.py 프로젝트: cflavio/yorg
 def __init__(self, menu_props, from_, roomname):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.from_ = from_
     self.roomname = roomname
     self.dialog = YesNoDialog(
         base.a2dBottomLeft,
         text=_('%s has invited you to a match, do you agree?') % from_,
         text_wordwrap=16,
         text_fg=menu_props.text_active_col,
         text_font=menu_props.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_props.text_active_col,
         button_text_font=menu_props.font,
         buttonValueList=['yes', 'no'],
         command=self.on_btn)
     size = self.dialog['frameSize']
     self.dialog.set_pos(-size[0] + .05, 1, -size[2] + .05)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #3
0
 def __init__(self, countdown_sfx, font):
     Subject.__init__(self)
     self.countdown_sfx = loader.loadSfx(countdown_sfx)
     self.__countdown_txt = OnscreenText(
         '', pos=(0, 0), scale=.2, fg=(1, 1, 1, 1), font=font)
     self.countdown_cnt = 3
     meth = self.process_countdown
     self.tsk = taskMgr.doMethodLater(1.0, meth, 'countdown')
예제 #4
0
파일: forms.py 프로젝트: cflavio/yorg
 def __init__(self, uid, is_supporter, pos, parent, menu_props,
              msg_btn_x=.58):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.menu_props = menu_props
     self.frm = Btn(
         frame_size=(-.01, 2.54, .05, -.03), frame_col=(1, 1, 1, 0),
         pos=pos, parent=parent, cmd=self.on_cmd, extra_args=[uid])
     self.lab = UserLabel(uid, self.frm, menu_props, is_supporter)
     self.frm.bind(ENTER, self.on_enter)
     self.frm.bind(EXIT, self.on_exit)
예제 #5
0
 def __init__(self, menu_props, txt):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.dialog = OkDialog(text=txt,
                            text_wordwrap=16,
                            text_fg=menu_props.text_active_col,
                            text_font=menu_props.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_props.text_active_col,
                            button_text_font=menu_props.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #6
0
 def __init__(self, menu_args, msg):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.msg = msg
     self.dialog = OkDialog(text=_('you have been removed from the match'),
                            text_wordwrap=16,
                            text_fg=menu_args.text_active,
                            text_font=menu_args.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_args.text_active,
                            button_text_font=menu_args.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #7
0
 def __init__(self,
              uid,
              is_supporter,
              pos,
              parent,
              menu_props,
              msg_btn_x=.58):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.menu_props = menu_props
     self.frm = Btn(frame_size=(-.01, 2.54, .05, -.03),
                    frame_col=(1, 1, 1, 0),
                    pos=pos,
                    parent=parent,
                    cmd=self.on_cmd,
                    extra_args=[uid])
     self.lab = UserLabel(uid, self.frm, menu_props, is_supporter)
     self.frm.bind(ENTER, self.on_enter)
     self.frm.bind(EXIT, self.on_exit)
예제 #8
0
파일: already_dlg.py 프로젝트: oriolrg/yorg
 def __init__(self, menu_props, key, cmd):
     Subject.__init__(self)
     GameObject.__init__(self)
     msg = _('The key %s is already used for %s.' % (key, cmd))
     self.dialog = OkDialog(text=msg,
                            text_wordwrap=16,
                            text_fg=menu_props.text_active_col,
                            text_font=menu_props.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_props.text_active_col,
                            button_text_font=menu_props.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #9
0
파일: reset_dlg.py 프로젝트: cflavio/yorg
 def __init__(self, menu_props, txt):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.dialog = OkDialog(
         text=txt,
         text_wordwrap=16,
         text_fg=menu_props.text_active_col,
         text_font=menu_props.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_props.text_active_col,
         button_text_font=menu_props.font,
         command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #10
0
 def __init__(self, menu_args, msg):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.user = str(msg['muc']['nick'])
     self.msg = msg
     self.dialog = OkDialog(text=_('the server user %s has quitted') %
                            self.user,
                            text_wordwrap=16,
                            text_fg=menu_args.text_active,
                            text_font=menu_args.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_args.text_active,
                            button_text_font=menu_args.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #11
0
파일: already_dlg.py 프로젝트: cflavio/yorg
 def __init__(self, menu_props, key, player, cmd):
     Subject.__init__(self)
     GameObject.__init__(self)
     msg = _('The key %s is already used by player %s for %s.' % (
             key, player, cmd))
     self.dialog = OkDialog(
         text=msg,
         text_wordwrap=16,
         text_fg=menu_props.text_active_col,
         text_font=menu_props.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_props.text_active_col,
         button_text_font=menu_props.font,
         command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #12
0
 def __init__(self, menu_args):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.dialog = OkDialog(text=_(
         "The jabber id that you've inserted is not correct: it "
         "should be something like [email protected] where "
         "nickname is your nickname and domainname.tld is a valid "
         "domain."),
                            text_wordwrap=16,
                            text_fg=menu_args.text_active,
                            text_font=menu_args.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_args.text_active,
                            button_text_font=menu_args.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #13
0
 def __init__(self, menu_args):
     Subject.__init__(self)
     GameObject.__init__(self)
     net_msg = _(
         'Connection error. Please check that your router is configured '
         'for doing port-forwarding for port 9099 on your host and your '
         'firewall allows traffic for Yorg on port 9099.')
     self.dialog = OkDialog(text=net_msg,
                            text_wordwrap=16,
                            text_fg=menu_args.text_active,
                            text_font=menu_args.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_args.text_active,
                            button_text_font=menu_args.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #14
0
 def __init__(self,
              name,
              name_full,
              is_supporter,
              is_online,
              pos,
              parent,
              menu_args,
              msg_btn_x=.58):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.name_full = name_full
     self.menu_args = menu_args
     self.frm = Btn(frameSize=(-.01, .79, .05, -.03),
                    frameColor=(1, 1, 1, 0),
                    pos=pos,
                    parent=parent)
     name = name.split('@')[0] + '\1smaller\1@' + name.split('@')[1] + '\2'
     self.lab = UserLabel(name, self.frm, menu_args, is_supporter,
                          is_online, name_full)
     self.frm.bind(ENTER, self.on_enter)
     self.frm.bind(EXIT, self.on_exit)
예제 #15
0
 def __init__(self, menu_args):
     Subject.__init__(self)
     GameObject.__init__(self)
     net_msg = _(
         'Connection error. Please check that (i) your firewall allows '
         'traffic for Yorg on port 9099 and (ii) the server user has '
         'opened her port 9099 (here is a guide for checking it: '
         'http://www.ya2.it/pages/check-your-ports.html).')
     self.dialog = OkDialog(text=net_msg,
                            text_wordwrap=16,
                            text_fg=menu_args.text_active,
                            text_font=menu_args.font,
                            pad=(.03, .03),
                            topPad=0,
                            midPad=.01,
                            relief=FLAT,
                            frameColor=(.8, .8, .8, .9),
                            button_relief=FLAT,
                            button_frameColor=(.2, .2, .2, .2),
                            button_text_fg=menu_args.text_active,
                            button_text_font=menu_args.font,
                            command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #16
0
파일: friend_dlg.py 프로젝트: cflavio/yorg
 def __init__(self, menu_props, user):
     Subject.__init__(self)
     GameObject.__init__(self)
     self.user = user
     self.dialog = YesNoDialog(
         base.a2dBottomLeft,
         text=_('%s wants to be a (XMPP) friend of you, do you agree?') % user,
         text_wordwrap=16,
         text_fg=menu_props.text_active_col,
         text_font=menu_props.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_props.text_active_col,
         button_text_font=menu_props.font,
         buttonValueList=['yes', 'no'],
         command=self.on_btn)
     size = self.dialog['frameSize']
     self.dialog.set_pos(-size[0] + .05, 1, -size[2] + .05)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #17
0
파일: network_dlg.py 프로젝트: cflavio/yorg
 def __init__(self, menu_props):
     Subject.__init__(self)
     GameObject.__init__(self)
     net_msg = _(
         'Connection error. Please check that (i) your firewall allows '
         'traffic for Yorg on port 9099 and (ii) the server user has '
         'opened her port 9099 (here is a guide for checking it: '
         'https://www.ya2.it/pages/check-your-ports.html).')
     self.dialog = OkDialog(
         text=net_msg,
         text_wordwrap=16,
         text_fg=menu_props.text_active_col,
         text_font=menu_props.font,
         pad=(.03, .03),
         topPad=0,
         midPad=.01,
         relief=FLAT,
         frameColor=(.8, .8, .8, .9),
         button_relief=FLAT,
         button_frameColor=(.2, .2, .2, .2),
         button_text_fg=menu_props.text_active_col,
         button_text_font=menu_props.font,
         command=self.on_btn)
     self.eng.log('created dialog ' + self.dialog['text'])
예제 #18
0
 def __init__(self, result_props):
     Subject.__init__(self)
     self.__res_txts = []
     self.__buttons = []
     self.result_frm = None
     self.props = result_props