rewardTooltip.py (2193B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\loginRewards\rewardTooltip.py 2 import evetypes 3 from carbonui.util.bunch import Bunch 4 from carbonui.util.color import Color 5 from eve.client.script.ui.shared.tooltip.blueprints import AddBlueprintInfo 6 from eve.common.script.util import industryCommon 7 from inventorycommon.const import categoryBlueprint 8 from localization import GetByLabel 9 from loginrewards.common.rewardUtils import GetTierColor, GetTierName, ShouldShowQty 10 11 def LoadTooltipPanelForReward(tooltipPanel, rewardInfo): 12 tooltipPanel.LoadGeneric1ColumnTemplate() 13 tooltipLabelWidth = 280 14 rewardName = rewardInfo.GetRewardName() 15 if ShouldShowQty(rewardInfo): 16 typeNameText = '<b>%s</b>' % GetByLabel('UI/LoginRewards/NumType', qty=rewardInfo.qty, typeName=rewardName) 17 else: 18 typeNameText = '<b>%s</b>' % rewardName 19 tooltipPanel.AddLabelMedium(text=typeNameText, wrapWidth=tooltipLabelWidth) 20 tier = rewardInfo.tier 21 if tier: 22 color = GetTierColor(tier) or (1, 1, 1, 1) 23 tierHintPath = GetTierName(tier) 24 if tierHintPath: 25 hexColor = Color.RGBtoHex(*color) 26 tierHintText = '<color=%s><b>%s</b></color>' % (hexColor, GetByLabel(tierHintPath)) 27 tooltipPanel.AddLabelMedium(text=tierHintText, wrapWidth=tooltipLabelWidth) 28 if evetypes.GetCategoryID(rewardInfo.typeID) == categoryBlueprint: 29 if rewardInfo.blueprintProductivityLevel or rewardInfo.blueprintMaterialLevel: 30 bpData = industryCommon.BlueprintInstance(Bunch(typeID=rewardInfo.typeID, timeEfficiency=rewardInfo.blueprintProductivityLevel or 0, materialEfficiency=rewardInfo.blueprintMaterialLevel or 0, runs=rewardInfo.qty, quantity=-2)) 31 AddBlueprintInfo(tooltipPanel, bpData=bpData) 32 else: 33 text = GetByLabel('UI/Industry/CopyRunsRemaining', runsRemaining=rewardInfo.qty) 34 tooltipPanel.AddLabelMedium(text=text, wrapWidth=tooltipLabelWidth) 35 if rewardInfo.messageID: 36 tooltipPanel.AddSpacer(height=10) 37 tooltipPanel.AddLabelMedium(text=GetByLabel(rewardInfo.messageID), wrapWidth=tooltipLabelWidth)