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

standingsSection.py (3439B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\standings\standingsSection.py
      2 import math
      3 from carbonui import uiconst
      4 from carbonui.primitives.container import Container
      5 from carbonui.primitives.containerAutoSize import ContainerAutoSize
      6 from carbonui.primitives.sprite import Sprite
      7 from eve.client.script.ui.control.eveIcon import OwnerIcon
      8 from eve.client.script.ui.control.eveLabel import EveLabelMedium
      9 from eve.client.script.ui.control.themeColored import FillThemeColored, GradientThemeColored
     10 from eve.client.script.ui.shared.standings.standingEntries import StandingsEntryOneWay, StandingsEntryTwoWay
     11 from eve.client.script.ui.shared.standings.standingsUIUtil import GetStandingIconTexturePath, GetStandingColor
     12 
     13 class StandingsSection(ContainerAutoSize):
     14     default_name = 'StandingsSection'
     15 
     16     def ApplyAttributes(self, attributes):
     17         ContainerAutoSize.ApplyAttributes(self, attributes)
     18         self.text = attributes.text
     19         self.commonOwnerID = attributes.ownerID
     20         self.standingsData = attributes.standingsData
     21         self.ConstructHeader()
     22         self.mainCont = ContainerAutoSize(name='mainCont', parent=self, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, padTop=0)
     23         self.ConstructCommonOwnerCont()
     24         self.standingsCont = ContainerAutoSize(name='standingsCont', parent=self.mainCont, align=uiconst.TOTOP, minHeight=36)
     25         self.ConstructStandingsEntries()
     26 
     27     def ConstructStandingsEntries(self):
     28         for i, standingData in enumerate(self.standingsData):
     29             if standingData.IsTwoWay():
     30                 StandingsEntryTwoWay(parent=self.standingsCont, align=uiconst.TOTOP, height=22, standingData=standingData, commonOwnerID=self.commonOwnerID, padBottom=4, isEvenRow=bool(i % 2))
     31             else:
     32                 StandingsEntryOneWay(parent=self.standingsCont, align=uiconst.TOTOP, height=22, top=7, standingData=standingData, commonOwnerID=self.commonOwnerID, isEvenRow=bool(i % 2))
     33 
     34     def ConstructCommonOwnerCont(self):
     35         align = uiconst.TOLEFT if self.standingsData[0].ownerID1 == self.commonOwnerID else uiconst.TORIGHT
     36         cont = Container(name='commonOwnerLayer', parent=self.mainCont, padding=(0, -4, 0, -4))
     37         self.commonOwnerCont = Container(name='commonOwnerCont', parent=cont, align=align, width=70)
     38         GradientThemeColored(bgParent=self.commonOwnerCont, alphaData=((0.0, 0.0),
     39          (0.25, 1.0),
     40          (0.75, 1.0),
     41          (1.0, 0.0)), colorType=uiconst.COLORTYPE_UIBASECONTRAST, rotation=math.pi / 2.0)
     42         iconSize = 32 if self.commonOwnerID == session.charid or len(self.standingsData) == 1 else 64
     43         OwnerIcon(parent=self.commonOwnerCont, ownerID=self.commonOwnerID, size=iconSize, pos=(0,
     44          0,
     45          iconSize,
     46          iconSize), align=uiconst.CENTER)
     47 
     48     def ConstructHeader(self):
     49         self.headerCont = Container(parent=self, name='headerCont', align=uiconst.TOTOP, height=26, padBottom=4)
     50         FillThemeColored(parent=self.headerCont, padBottom=1, colorType=uiconst.COLORTYPE_UIHILIGHT)
     51 
     52 
     53 class StandingGoodOrBadIcon(Sprite):
     54     default_state = uiconst.UI_DISABLED
     55 
     56     def ApplyAttributes(self, attributes):
     57         Sprite.ApplyAttributes(self, attributes)
     58         standing = attributes.standing
     59         self.texturePath = GetStandingIconTexturePath(standing)
     60         color = GetStandingColor(standing)
     61         self.SetRGBA(*color)