NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

skillInjectorBarAmountLabel.py (1619B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\skilltrading\skillInjectorBarAmountLabel.py
      2 import localization
      3 from carbonui import uiconst
      4 from carbonui.primitives.container import Container
      5 from carbonui.primitives.frame import Frame
      6 from carbonui.primitives.sprite import Sprite
      7 from carbonui.uianimations import animations
      8 from eve.client.script.ui.control.eveLabel import EveLabelSmall
      9 
     10 class InjectorBarAmountLabel(Container):
     11     default_height = 17
     12 
     13     def ApplyAttributes(self, attributes):
     14         super(InjectorBarAmountLabel, self).ApplyAttributes(attributes)
     15         self._amount = attributes.get('amount', 0)
     16         self.Layout()
     17 
     18     def Layout(self):
     19         Frame(parent=self, texturePath='res:/UI/Texture/classes/skilltrading/frame.png', cornerSize=3, opacity=0.5)
     20         Sprite(bgParent=self, align=uiconst.TOALL, padding=(4, 4, 4, 4), texturePath='res:/UI/Texture/classes/skilltrading/checker_bg.png', opacity=0.4, tileX=True, tileY=True)
     21         self.label = EveLabelSmall(parent=self, align=uiconst.CENTER)
     22         self.UpdateLabel()
     23 
     24     @property
     25     def amount(self):
     26         return self._amount
     27 
     28     @amount.setter
     29     def amount(self, value):
     30         self._amount = int(value)
     31         self.UpdateLabel()
     32 
     33     def AnimSetAmount(self, amount):
     34         animations.MorphScalar(self, 'amount', startVal=self.amount, endVal=amount, callback=lambda : setattr(self, 'amount', amount))
     35 
     36     def UpdateLabel(self):
     37         text = localization.GetByLabel('UI/SkillTrading/UnallocatedPointsLabel', amount=self.amount)
     38         self.label.SetText(text)