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

industryLine.py (2186B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\industry\views\industryLine.py
      2 from carbonui.const import TOALL
      3 from carbonui.primitives.vectorlinetrace import VectorLineTrace
      4 from carbonui.util.color import Color
      5 from eve.client.script.ui.shared.industry.industryUIConst import OPACITY_LINES, COLOR_FRAME, COLOR_NOTREADY, COLOR_READY
      6 import trinity
      7 from carbonui.uicore import uicore
      8 COLOR_OPTIONAL_NOTREADY = (0.2, 0.2, 0.2, 1.0)
      9 
     10 class IndustryLineTrace(VectorLineTrace):
     11     default_name = 'IndustryLineTrace'
     12     default_spriteEffect = trinity.TR2_SFX_COPY
     13     default_textureWidth = 12.0
     14     default_texturePath = 'res:/UI/Texture/classes/Industry/input/lineSolid.png'
     15     default_lineWidth = 8.0
     16     default_opacity = OPACITY_LINES
     17 
     18     def UpdateColor(self, isReady, isOptional = False, isOptionSelected = True, animate = True):
     19         color = IndustryLineTrace.GetLineColor(isReady, isOptionSelected=isOptionSelected)
     20         if animate:
     21             uicore.animations.SpColorMorphTo(self, self.GetRGBA(), color, duration=0.3)
     22         else:
     23             self.SetRGBA(*color)
     24         if isOptional:
     25             self.texturePath = 'res:/UI/Texture/classes/Industry/input/lineOptional.png'
     26         elif isReady:
     27             self.texturePath = 'res:/UI/Texture/classes/Industry/input/lineSolid.png'
     28         else:
     29             self.texturePath = 'res:/UI/Texture/classes/Industry/input/line.png'
     30 
     31     @staticmethod
     32     def GetLineColor(isReady, isOptionSelected):
     33         if not isOptionSelected:
     34             color = COLOR_OPTIONAL_NOTREADY
     35         elif isReady:
     36             color = COLOR_READY
     37         else:
     38             color = COLOR_NOTREADY
     39         color = Color(*color).SetAlpha(OPACITY_LINES).GetRGBA()
     40         return color
     41 
     42     def AnimEntry(self, timeOffset = 0.0, i = 1, animate = True):
     43         if animate:
     44             uicore.animations.FadeTo(self, 0.0, OPACITY_LINES, duration=0.2, timeOffset=0.15 + timeOffset + i * 0.05)
     45             uicore.animations.MorphScalar(self, 'end', 0.0, 1.0, duration=0.4, timeOffset=timeOffset + i * 0.1)
     46         else:
     47             self.opacity = OPACITY_LINES
     48             self.end = 1.0