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

icons.py (1950B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\omega\upsell\components\icons.py
      2 import eveicon
      3 from carbon.common.script.util.format import FmtAmt
      4 from carbonui import Align, uiconst
      5 from carbonui.primitives.container import Container
      6 from carbonui.primitives.sprite import Sprite
      7 from eve.client.script.ui import eveColor
      8 from eveservices.menu import GetMenuService
      9 from inventorycommon.const import typePlex
     10 from localization import GetByLabel
     11 
     12 class PlexInfoIcon(Container):
     13     default_align = Align.NOALIGN
     14     default_state = uiconst.UI_NORMAL
     15     default_width = 40
     16     default_height = 40
     17 
     18     def __init__(self, amount = None, *args, **kwargs):
     19         super(PlexInfoIcon, self).__init__(*args, **kwargs)
     20         self.amount = amount
     21         self.construct_layout()
     22 
     23     def construct_layout(self):
     24         self.icon = Sprite(parent=self, align=Align.CENTER, state=uiconst.UI_DISABLED, texturePath=eveicon.plex, color=eveColor.PLEX_YELLOW, pos=(0,
     25          0,
     26          self.width,
     27          self.width))
     28 
     29     def LoadTooltipPanel(self, tooltip_panel, *args):
     30         tooltip_panel.LoadGeneric2ColumnTemplate()
     31         tooltip_panel.state = uiconst.UI_NORMAL
     32         if self.amount:
     33             text = ('%s x %s' % (FmtAmt(self.amount), GetByLabel('UI/OmegaUpsell/PlexAbbreviationDescription')),)
     34         else:
     35             text = GetByLabel('UI/OmegaUpsell/PlexAbbreviationDescription')
     36         tooltip_panel.AddLabelMedium(text=text, align=Align.CENTERLEFT)
     37         tooltip_panel.AddInfoIcon(typeID=typePlex, align=Align.CENTERRIGHT)
     38 
     39     def GetMenu(self, *args):
     40         return GetMenuService().GetMenuFromItemIDTypeID(itemID=None, typeID=typePlex)
     41 
     42     def OnClick(self, *args):
     43         sm.GetService('info').ShowInfo(typePlex)
     44 
     45     @property
     46     def icon_color(self):
     47         return self.icon.color
     48 
     49     @icon_color.setter
     50     def icon_color(self, value):
     51         self.icon.color = value