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

counterBox.py (1354B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\dockedUI\counterBox.py
      2 from carbonui import fontconst
      3 from carbonui.primitives.container import Container
      4 from carbonui.primitives.frame import Frame
      5 from eve.client.script.ui.control.eveLabel import Label
      6 import carbonui.const as uiconst
      7 
      8 class CounterBox(Container):
      9     _number = 0
     10 
     11     def ApplyAttributes(self, attributes):
     12         Container.ApplyAttributes(self, attributes)
     13         self.label = Label(parent=self, align=uiconst.CENTER, fontPath='res:/UI/Fonts/EveSansNeue-Expanded.otf', fontsize=fontconst.EVE_SMALL_FONTSIZE)
     14         Frame(bgParent=self, texturePath='res:/UI/Texture/Shared/counterFrame.png', cornerSize=8, offset=-1, color=(0.2, 0.2, 0.2, 1))
     15         if 'text' in attributes:
     16             self.text = attributes.text
     17         else:
     18             self.display = False
     19 
     20     @apply
     21     def text():
     22 
     23         def fget(self):
     24             return self._number
     25 
     26         def fset(self, value):
     27             self._number = value
     28             self.label.text = value
     29             self.width = max(14, self.label.textwidth + 8)
     30             self.height = max(14, self.label.textheight)
     31             if self.label.text:
     32                 self.display = True
     33             else:
     34                 self.display = False
     35 
     36         return property(**locals())