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

statusIcon.py (1710B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\statusIcon.py
      2 from carbonui.primitives.container import Container
      3 from carbonui.primitives.fill import Fill
      4 from carbonui.primitives.frame import Frame
      5 from carbonui.primitives.sprite import Sprite
      6 from carbonui.util.color import Color
      7 import carbonui.const as uiconst
      8 from eve.client.script.ui.eveColor import WARNING_ORANGE
      9 BG_BLUE_COLOR = Color.HextoRGBA('#34566f')[:3] + (0.6,)
     10 FRAME_BLUE_COLOR = Color.HextoRGBA('#3e7aa4')[:3] + (0.5,)
     11 
     12 class StatusIcon(Container):
     13     default_align = uiconst.CENTER
     14     default_width = 32
     15     default_height = 32
     16     default_textureSize = 32
     17     default_name = 'StatusIcon'
     18     STATUS_OK = 1
     19     STATUS_CAUTION = 2
     20     STATUS_WARNING = 3
     21 
     22     def ApplyAttributes(self, attributes):
     23         super(StatusIcon, self).ApplyAttributes(attributes)
     24         texturePath = attributes.texturePath
     25         status = attributes.status
     26         textureSize = attributes.get('default_textureSize', self.default_textureSize)
     27         if status == self.STATUS_WARNING:
     28             red = (0.8, 0, 0)
     29             frameColor = red + (0.2,)
     30             fillColor = red + (0.2,)
     31         elif status == self.STATUS_CAUTION:
     32             frameColor = WARNING_ORANGE[:3] + (0.2,)
     33             fillColor = WARNING_ORANGE[:3] + (0.2,)
     34         else:
     35             frameColor = FRAME_BLUE_COLOR
     36             fillColor = BG_BLUE_COLOR
     37         Fill(bgParent=self, color=fillColor)
     38         Frame(bgParent=self, color=frameColor)
     39         sprite = Sprite(parent=self, align=uiconst.CENTER, pos=(0,
     40          0,
     41          textureSize,
     42          textureSize), texturePath=texturePath, state=uiconst.UI_DISABLED)