structureDeedInvCont.py (2326B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\structureDeedInvCont.py 2 import localization 3 from carbonui import uiconst 4 from carbonui.primitives.containerAutoSize import ContainerAutoSize 5 from dogma.const import attributeStructureRequiresDeedType 6 from eve.client.script.ui.control.eveLabel import EveLabelMedium 7 from eve.client.script.ui.control.themeColored import FillThemeColored 8 from eve.client.script.ui.shared.container import _InvContBase 9 10 class StructureDeedInvCont(_InvContBase): 11 __guid__ = 'invCont.StructureDeedInvCont' 12 __invControllerClass__ = None 13 default_clipChildren = True 14 15 def ApplyAttributes(self, attributes): 16 _InvContBase.ApplyAttributes(self, attributes) 17 18 def ConstructUI(self): 19 self.ConstructDeedSlotUI() 20 _InvContBase.ConstructUI(self) 21 22 def ConstructDeedSlotUI(self): 23 dogmaLocation = sm.GetService('clientDogmaIM').GetDogmaLocation() 24 requireTypeID = int(dogmaLocation.GetAttributeValue(self.itemID, attributeStructureRequiresDeedType)) 25 if not requireTypeID: 26 dogmaLocation.LogWarn("ConstructDeedSlotUI - structure does not have the necessary value for attribute 'StructureRequiresDeedType'", self.itemID) 27 return 28 topCont = ContainerAutoSize(parent=self, align=uiconst.TOTOP, maxHeight=60) 29 FillThemeColored(bgParent=topCont, colorType=uiconst.COLORTYPE_UIHILIGHT) 30 StructureDeedInvContDescriptionLabel(parent=topCont, state=uiconst.UI_NORMAL, align=uiconst.TOTOP, text=localization.GetByLabel('UI/Structures/DeedInventoryRequirementsDescription', typeID=requireTypeID), autoFitToText=True, padding=(3, 2, 3, 2), toolTipTextHeightThreshold=51) 31 32 33 class StructureDeedInvContDescriptionLabel(EveLabelMedium): 34 35 def ApplyAttributes(self, attributes): 36 self.toolTipTextHeightThreshold = attributes.get('toolTipTextHeightThreshold', 0) 37 EveLabelMedium.ApplyAttributes(self, attributes) 38 self.SetBottomAlphaFade(fadeEnd=self.toolTipTextHeightThreshold, maxFadeHeight=10) 39 40 def LoadTooltipPanel(self, tooltipPanel, *args): 41 if self.textheight > self.toolTipTextHeightThreshold: 42 tooltipPanel.LoadGeneric1ColumnTemplate() 43 tooltipPanel.AddLabelMedium(text=self.text, wrapWidth=200)