skillsPanelUtil.py (4276B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\skillPlan\skillsCatalogue\skillsPanelUtil.py 2 import carbonui.const as uiconst 3 import dogma.data as dogma_data 4 from carbonui.primitives.containerAutoSize import ContainerAutoSize 5 from carbonui.primitives.fill import Fill 6 from carbonui.primitives.layoutGrid import LayoutGridCell 7 from carbonui.primitives.sprite import Sprite 8 from carbonui.util.color import Color 9 from clonegrade.const import COLOR_OMEGA_GOLD 10 from eve.client.script.ui.control.eveLabel import Label 11 from fsdBuiltData.common.iconIDs import GetIconFile 12 from localization import GetByLabel 13 from skills.skillConst import ATTRIBUTES_BY_GROUPID 14 15 def LoadSkillGroupTooltipPanel(controller, tooltipPanel): 16 tooltipPanel.LoadStandardSpacing() 17 tooltipPanel.columns = 2 18 tooltipPanel.AddMediumHeader(text=controller.GetName()) 19 tooltipPanel.AddLabelMedium(text=controller.GetDescription(), width=300, colSpan=2) 20 AddLevelsTrained(controller, tooltipPanel) 21 AddPointsTrained(controller, tooltipPanel) 22 AddCertificatesClaimed(controller, tooltipPanel) 23 AddAttributes(controller, tooltipPanel) 24 25 26 def AddAttributes(controller, tooltipPanel): 27 attributeID1, attributeID2 = ATTRIBUTES_BY_GROUPID[controller.groupID] 28 tooltipPanel.AddCell(AttributeCont(attrID=attributeID1), cellClass=CellBG) 29 tooltipPanel.AddCell(AttributeCont(attrID=attributeID2), cellClass=CellBG) 30 31 32 def AddCertificatesClaimed(controller, tooltipPanel): 33 certsTotal = controller.GetAccumulatedCertificateLevelsTotal() 34 if certsTotal: 35 certsTrained = controller.GetAccumulatedCertificateLevelsTrained() 36 skillPointsText = GetByLabel('UI/CharacterSheet/CharacterSheetWindow/SkillTabs/CertificatesClaimedPerGroup', certsTrained=certsTrained, certsTotal=certsTotal) 37 tooltipPanel.AddLabelMedium(text=skillPointsText, colSpan=2) 38 39 40 def AddSpPerMin(controller, tooltipPanel): 41 attributeID1, attributeID2 = ATTRIBUTES_BY_GROUPID[controller.groupID] 42 spPerMin = controller.GetSpPerMinute(attributeID1, attributeID2) 43 skillPointsText = GetByLabel('UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SpPerMinute', spPerMin=spPerMin) 44 tooltipPanel.AddLabelMedium(text=skillPointsText, colSpan=2) 45 46 47 def AddLevelsTrained(controller, tooltipPanel): 48 levelsTrained = controller.GetAccumulatedLevelsTrainedAndEnabled() 49 levelsTotal = controller.GetAccumulatedLevelsTotal() 50 levelsDisabled = controller.GetAccumulatedLevelsTrainedAndDisabled() 51 if levelsDisabled: 52 color = Color.RGBtoHex(*COLOR_OMEGA_GOLD) 53 skillPointsText = GetByLabel('UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillLevelsPerGroupDisabled', levelsTrained=levelsTrained, levelsTotal=levelsTotal, levelsDisabled=levelsDisabled, color=color) 54 else: 55 skillPointsText = GetByLabel('UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillLevelsPerGroup', levelsTrained=levelsTrained, levelsTotal=levelsTotal) 56 tooltipPanel.AddLabelMedium(text=skillPointsText, colSpan=2) 57 58 59 def AddPointsTrained(controller, tooltipPanel): 60 pointsTrained = controller.GetAccumulatedSkillPointsTrained() 61 pointsTotal = controller.GetAccumulatedSkillPointsTotal() 62 skillPointsText = GetByLabel('UI/CharacterSheet/CharacterSheetWindow/SkillTabs/SkillPointsPerGroup', pointsTrained=pointsTrained, pointsTotal=pointsTotal) 63 tooltipPanel.AddLabelMedium(text=skillPointsText, colSpan=2) 64 65 66 class AttributeCont(ContainerAutoSize): 67 default_align = uiconst.CENTER 68 default_padTop = -3 69 default_padBottom = -3 70 71 def ApplyAttributes(self, attributes): 72 ContainerAutoSize.ApplyAttributes(self, attributes) 73 attrID = attributes.attrID 74 iconID = dogma_data.get_attribute_icon_id(attrID) 75 attributeDisplayName = dogma_data.get_attribute_display_name(attrID) 76 texturePath = GetIconFile(iconID) 77 Sprite(parent=self, align=uiconst.CENTERLEFT, pos=(-12, 0, 32, 32), texturePath=texturePath) 78 Label(parent=self, align=uiconst.CENTERLEFT, left=24, text=attributeDisplayName) 79 80 81 class CellBG(LayoutGridCell): 82 83 def ApplyAttributes(self, attributes): 84 LayoutGridCell.ApplyAttributes(self, attributes) 85 Fill(parent=self, padRight=2, color=(1, 1, 1, 0.1))