def ApplyAttributes(self, attributes): InfoBubble.ApplyAttributes(self, attributes) self.typeID = attributes.typeID self.caption.text = cfg.invtypes.Get(self.typeID).name self.icon = Icon(name='icon', parent=self.iconCont, pos=(0, 0, 80, 80), typeID=self.typeID, ignoreSize=True, cursor=uiconst.UICURSOR_MAGNIFIER) self.icon.OnClick = self.OnIconClicked fsdType = cfg.fsdTypeOverrides.Get(self.typeID) if hasattr(fsdType, 'infoBubbleTypeElement'): self.ConstructElements(fsdType.infoBubbleTypeElement) isTrialRestricted = sm.GetService('skills').IsTrialRestricted( self.typeID) if isTrialRestricted: TrialRestrictionButton(parent=self.mainContent, align=uiconst.TOTOP, padding=(0, 8, 0, 8), callback=self.OpenSubscriptionPage, message='UI/ShipTree/ShipTrialRestricted') TraitsContainer(parent=self.mainContent, typeID=self.typeID) price = cfg.invtypes.Get(self.typeID).averagePrice or 0 text = GetByLabel('UI/Inventory/EstIskPrice', iskString=FmtISKAndRound(price, False)) Label(parent=self.topRightCont, text=text, align=uiconst.TOTOP, padTop=7) uicore.animations.FadeTo(self.icon, 1.5, 1.0, duration=0.6) self.AnimShow() sm.GetService('shipTree').LogIGS('HoverType')
def GetHint(self): data = self.sr.node hintTextList = [data.hint] marketPrice = GetAveragePrice(data) if marketPrice: marketPriceStr = FmtISKAndRound(marketPrice) estimatedPrice = localization.GetByLabel('UI/Inventory/ItemEstimatedPrice', estPrice=marketPriceStr) hintTextList.append(estimatedPrice) hint = '<br>'.join(filter(None, hintTextList)) return hint
def _UpdateEstimatedInjectorPrice(self): price = inventorycommon.typeHelpers.GetAveragePrice( invconst.typeSkillInjector) if price is None or price <= 0: price = localization.GetByLabel('UI/Common/Unknown') else: price = FmtISKAndRound(price, False) text = localization.GetByLabel('UI/SkillTrading/EstimatedPrice', price=price) self.priceLabel.SetText(text)
def UpdateItemInfo(self, outputPrice, numberOfItems, volume=None): self.container.totalPriceLabel.text = GetByLabel( 'UI/Inventory/EstIskPrice', iskString=FmtISKAndRound(outputPrice, False)) self.container.numItemsLabel.text = GetByLabel('UI/Inventory/NumItems', numItems=numberOfItems, numFilteredTxt='') if volume is not None: self.container.volumeLabel.text = GetByLabel( 'UI/Reprocessing/ReprocessingWindow/TotalVolume', volume=FmtAmt(volume, showFraction=2))