numRunsIndicator.py (1914B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\cosmetics\ship\controls\numRunsIndicator.py 2 import eveformat 3 import eveicon 4 from carbonui import Align, PickState, uiconst 5 from carbonui.text.styles import TextBody 6 from carbonui.primitives.containerAutoSize import ContainerAutoSize 7 from carbonui.primitives.sprite import Sprite 8 from carbonui.primitives.stretchspritehorizontal import StretchSpriteHorizontal 9 from cosmetics.common.ships.skins.live_data.component_license_type import ComponentLicenseType 10 from eve.client.script.ui import eveColor 11 from localization import GetByLabel 12 13 class NumRunsIndicator(ContainerAutoSize): 14 default_minHeight = 30 15 default_minWidth = 30 16 default_state = uiconst.UI_NORMAL 17 18 def __init__(self, num_runs, licence_type, **kw): 19 super(NumRunsIndicator, self).__init__(**kw) 20 self.license_type = licence_type 21 self.num_runs = num_runs 22 StretchSpriteHorizontal(name='runs_icon', bgParent=self, texturePath='res:/UI/Texture/classes/Cosmetics/Ship/overlays/runs_remaining_bg.png', leftEdgeSize=15, rightEdgeSize=15) 23 if licence_type == ComponentLicenseType.LIMITED: 24 TextBody(name='runs_remaining_label', parent=self, align=Align.CENTER, text=eveformat.number_readable_short(num_runs), padding=(9, 0, 9, 0), color=eveColor.WHITE) 25 else: 26 Sprite(parent=self, align=Align.CENTER, pos=(0, 0, 16, 16), texturePath=eveicon.infinity, pickState=PickState.OFF) 27 28 def GetHint(self): 29 if self.license_type == ComponentLicenseType.UNLIMITED: 30 return GetByLabel('UI/Personalization/ShipSkins/SKINR/Studio/UnlimitedDesignElement') 31 else: 32 return u'{}\n{} X {}'.format(GetByLabel('UI/Personalization/ShipSkins/SKINR/Studio/LimitedDesignElement'), self.num_runs, GetByLabel('UI/Personalization/ShipSkins/SKINR/Sequencing/SequencingRuns'))