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

attributePanel.py (2395B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\fittingScreen\fittingPanels\attributePanel.py
      2 import dogma.data as dogma_data
      3 from carbonui import const as uiconst
      4 from eve.client.script.ui.control.eveIcon import Icon
      5 from eve.client.script.ui.control.eveLabel import EveLabelMedium
      6 from eve.client.script.ui.shared.fittingScreen.fittingPanels.basePanel import BaseMenuPanel
      7 from eve.client.script.ui.tooltips.tooltipUtil import SetTooltipHeaderAndDescription
      8 from localization import GetByMessageID
      9 
     10 class AttributePanel(BaseMenuPanel):
     11 
     12     def ApplyAttributes(self, attributes):
     13         BaseMenuPanel.ApplyAttributes(self, attributes)
     14 
     15     def LoadPanel(self, initialLoad = False):
     16         self.Flush()
     17         self.ResetStatsDicts()
     18 
     19     def LoadPanelIfNeeded(self):
     20         if not self.panelLoaded:
     21             self.LoadPanel()
     22 
     23     def AddAttributeCont(self, attribute, parentGrid, attributeID = None, texturePath = None):
     24         if attributeID is None:
     25             attributeID = attribute.attributeID
     26         attributeCont = self.GetValueCont(self.iconSize)
     27         parentGrid.AddCell(cellObject=attributeCont)
     28         if texturePath:
     29             graphicID = None
     30         else:
     31             graphicID = attribute.iconID
     32         displayName = dogma_data.get_attribute_display_name(attribute.attributeID)
     33         icon = Icon(graphicID=graphicID, pos=(3,
     34          0,
     35          self.iconSize,
     36          self.iconSize), hint=displayName, name=displayName, ignoreSize=True, state=uiconst.UI_DISABLED, icon=texturePath, align=uiconst.CENTERLEFT)
     37         attributeCont.AddCell(cellObject=icon)
     38         label = EveLabelMedium(text='', left=0, state=uiconst.UI_DISABLED, align=uiconst.CENTERLEFT)
     39         attributeCont.AddCell(cellObject=label)
     40         attributeCont.hint = displayName
     41         tooltipTitleID = attribute.tooltipTitleID
     42         if tooltipTitleID:
     43             tooltipTitle = GetByMessageID(tooltipTitleID)
     44             tooltipDescr = GetByMessageID(attribute.tooltipDescriptionID)
     45             SetTooltipHeaderAndDescription(targetObject=attributeCont, headerText=tooltipTitle, descriptionText=tooltipDescr)
     46         self.statsLabelsByIdentifier[attributeID] = label
     47         self.statsIconsByIdentifier[attributeID] = icon
     48         self.statsContsByIdentifier[attributeID] = attributeCont
     49         return (icon, label, attributeCont)