class AchievementEntry(Container):
    default_height = 20
    default_state = uiconst.UI_NORMAL

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.achievement = attributes.Get('achievement', None)
        if self.achievement.isEnabled:
            alpha = 0.75
        else:
            alpha = 0.25
        if self.achievement.completed:
            textColor = (0.0, 1.0, 0.0, 1.0)
        else:
            textColor = (1.0, 1.0, 1.0, alpha)
        if self.achievement.isClientAchievement:
            clientText = ' (client)'
        else:
            clientText = ''
        self.label = EveLabelMedium(name='myLabel',
                                    parent=self,
                                    align=uiconst.CENTERLEFT,
                                    text='%s - %s%s' %
                                    (self.achievement.achievementID,
                                     self.achievement.name, clientText),
                                    left=4,
                                    color=textColor)
        self.hint = self.achievement.description
        self.UpdateState()

    def UpdateState(self):
        if self.achievement.completed:
            self.label.SetTextColor((0.0, 1.0, 0.0, 1.0))
Пример #2
0
class AchievementEntry(Container):
    default_height = 20
    default_state = uiconst.UI_NORMAL

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.achievement = attributes.Get('achievement', None)
        textColor = (1.0, 0.5, 0.5)
        if self.achievement.completed:
            textColor = (0.0, 0.7, 0.0)
        self.label = EveLabelMedium(name='myLabel', parent=self, align=uiconst.CENTERLEFT, text='%s - %s' % (self.achievement.id, self.achievement.name), left=4, hint='bleggibleg', textColor=textColor)
        self.label.SetTextColor(textColor)
        self.hint = self.achievement.description
        Line(parent=self, align=uiconst.TOBOTTOM, opacity=0.1)

    def blingUnlocked(self):
        self.label.SetTextColor((0.0, 1.0, 0.0))