Beispiel #1
0
    def update(self):
        p = self.player
        if not p:
            return

        nick = u"<%s>" % p.account.username
        if self.dropped:
            if self.fleed:
                prefix = u"(逃跑)"
            else:
                prefix = u"(掉线)"

            nick = prefix + nick

        self.caption = nick
        char = self.character

        if char:
            meta = char.ui_meta
            self.bg = L(meta.port_image)
            self.update_bg()
            self.set_charname(meta.name)
            desc = char_desc(char)
            if self._last_balloon != desc:
                self.balloon.set_balloon(desc, (2, 74, 145, 96))
                self._last_balloon = desc

        self.bot_reserve = 74
        self.gray_tex = None
        Frame.update(self)
        self.update_position()
        self.update_color()
        self.tagarrange()
Beispiel #2
0
    def update(self):
        p = self.player
        if not p: return

        nick = u"<%s>" % p.account.username
        if self.dropped:
            if self.fleed:
                prefix = u'(逃跑)'
            else:
                prefix = u'(掉线)'

            nick = prefix + nick

        self.caption = nick
        char = self.character

        if char:
            meta = char.ui_meta
            self.bg = L(meta.port_image)
            self.update_bg()
            self.set_charname(meta.name)
            desc = char_desc(char)
            if self._last_balloon != desc:
                self.balloon.set_balloon(desc, (2, 74, 145, 96))
                self._last_balloon = desc

        self.bot_reserve = 74
        self.gray_tex = None
        Frame.update(self)
        self.update_position()
        self.update_color()
        self.tagarrange()
Beispiel #3
0
    def __init__(self, choice, group, x=0, y=0, *a, **k):

        self.choice = choice
        cc = choice.char_cls
        meta = cc.ui_meta
        pimg = L(meta.port_image)

        self.x = x
        self.y = y
        ImageSelector.__init__(self, pimg, group, *a, **k)

        self.balloon.set_balloon(char_desc(cc))
Beispiel #4
0
    def __init__(self, choice, group, x=0, y=0, *a, **k):

        self.choice = choice
        cc = choice.char_cls
        meta = cc.ui_meta
        pimg = L(meta.port_image)

        self.x = x
        self.y = y
        ImageSelector.__init__(
            self, pimg, group, *a, **k
        )

        self.balloon.set_balloon(char_desc(cc))
Beispiel #5
0
    def balloon_show(self):
        char = self.character
        try:
            meta = char.ui_meta
            figure_image = L(meta.figure_image)
        except:
            return self.balloon.balloon_show()

        try:
            figure_image_alter = L(meta.figure_image_alter)
            if figure_image_alter.decrypted:
                figure_image = figure_image_alter.reference

        except:
            pass

        return _CharacterFigure(figure_image, char_desc(char), parent=self.parent)
Beispiel #6
0
    def balloon_show(self):
        char = self.character
        try:
            meta = char.ui_meta
            figure_image = L(meta.figure_image)
        except:
            return self.balloon.balloon_show()

        try:
            figure_image_alter = L(meta.figure_image_alter)
            if figure_image_alter.decrypted:
                figure_image = figure_image_alter.reference

        except:
            pass

        return _CharacterFigure(
            figure_image,
            char_desc(char),
            parent=self.parent,
        )
Beispiel #7
0
        "fulltextindex":
        unidecode(v['description']).replace(' ', '').lower(),
        "deck":
        find_cards(k),
    })

#  --- Characters ---
excludes = [
    characters.akari.Akari,
]

for k, v in metadata.iteritems():
    if not issubclass(k, characters.baseclasses.Character): continue
    if k in excludes: continue
    if not getattr(k, 'categories', False): continue
    desc = char_desc(k)
    result['Characters'].append({
        "token":
        k.__name__,
        "image":
        "{}.png".format(v['port_image'].replace('-', '/')),
        "name":
        v['name'],
        "maxlife":
        k.maxlife,
        "modes":
        k.categories,
        "description":
        to_html(desc),
        "fulltextindex":
        unidecode(desc).replace(' ', '').lower(),
Beispiel #8
0
        "description":   to_html(v['description']),
        "fulltextindex": unidecode(v['description']).replace(' ', '').lower(),
        "deck":          find_cards(k),
    })


#  --- Characters ---
excludes = [
    characters.akari.Akari,
]

for k, v in metadata.iteritems():
    if not issubclass(k, characters.baseclasses.Character): continue
    if k in excludes: continue
    if not getattr(k, 'categories', False): continue
    desc = char_desc(k)
    result['Characters'].append({
        "token":         k.__name__,
        "image":         "{}.png".format(v['port_image'].replace('-', '/')),
        "name":          v['name'],
        "maxlife":       k.maxlife,
        "modes":         k.categories,
        "description":   to_html(desc),
        "fulltextindex": unidecode(desc).replace(' ', '').lower(),
        "positions":     ("暂缺",),
    })


#  --- Modes ---
for k, v in metadata.iteritems():
    if not issubclass(k, Game): continue