Ejemplo n.º 1
0
    def on_message(self, _type, *args):
        if _type == "server_dropped":
            ConfirmBox(u"已经与服务器断开链接,请重新启动游戏!", parent=Screen.cur_overlay)

        elif _type == "invite_request":
            uid, uname, gid, gtype = args[0]
            from gamepack import gamemodes as modes

            gtype = modes.get(gtype, None)
            gtype = gtype and gtype.ui_meta.name

            invite_text = u"%s 邀请你一起玩 %s 模式" % (uname, gtype)

            from utils import notify

            notify(u"东方符斗祭 - 邀请提醒", invite_text)

            box = ConfirmBox(invite_text, parent=self, buttons=((u"确定", True), (u"取消", False)), default=False)

            @box.event
            def on_confirm(val, uid=uid):
                Executive.call("invite_grant", ui_message, [gid, val])

        else:
            Overlay.on_message(self, _type, *args)
Ejemplo n.º 2
0
    def on_message(self, _type, *args):
        if _type == 'server_dropped':
            ConfirmBox(u'已经与服务器断开链接,请重新启动游戏!', parent=Screen.cur_overlay)

        elif _type == 'invite_request':
            uid, uname, gid, gtype = args[0]
            from gamepack import gamemodes as modes

            gtype = modes.get(gtype, None)
            gtype = gtype and gtype.ui_meta.name

            invite_text = u'%s 邀请你一起玩 %s 模式' % (uname, gtype)

            from utils import notify
            notify(u'东方符斗祭 - 邀请提醒', invite_text)

            box = ConfirmBox(
                invite_text,
                parent=self, buttons=((u'确定', True), (u'取消', False)), default=False
            )

            @box.event
            def on_confirm(val, uid=uid):
                Executive.call('invite_grant', ui_message, [gid, val])

        else:
            Overlay.on_message(self, _type, *args)
Ejemplo n.º 3
0
 def on_message(self, _type, *args):
     if _type == 'server_dropped':
         ConfirmBox(u'已经与服务器断开链接,请重新启动游戏!', parent=Screen.cur_overlay)
     else:
         Overlay.on_message(self, _type, *args)