def MakeTypeIcon(icon, dad, typeID, iconSize, isCopy = False): techIcon = GetTechLevelIcon(None, typeID=typeID) if techIcon: techIcon.left = icon.left techIcon.top = icon.top dad.children.append(techIcon) icon.LoadIconByTypeID(typeID=typeID, size=iconSize, isCopy=isCopy)
def MakeTypeIcon(icon, dad, typeID, iconSize, isCopy=False): techIcon = GetTechLevelIcon(None, typeID=typeID) if techIcon: techIcon.left = icon.left techIcon.top = icon.top dad.children.append(techIcon) icon.LoadIconByTypeID(typeID=typeID, size=iconSize, isCopy=isCopy)
def _PrepareProductIcon(self): icon = Container(name='productIcon', align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, width=self.iconSize, height=self.iconSize) techIcon = GetTechLevelIcon(typeID=self.typeID) if techIcon: techIcon.SetParent(icon) Icon(parent=icon, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, size=self.iconSize, typeID=self.typeID, isCopy=True) return icon
def DrawItem(self): iconCont = Container(parent=self.textCont, align=uiconst.TOLEFT, width=32, padding=4) self.iconInnerCont = Container(name='iconInnerCont', parent=iconCont, align=uiconst.CENTERLEFT, pos=(0, 0, 32, 32)) self.wheel = LoadingWheel(parent=self.iconInnerCont, pos=(0, 0, 48, 48), align=uiconst.CENTER, idx=0) self.wheel.display = False self.techIcon = Sprite(parent=self.iconInnerCont, pos=(0, 0, 16, 16), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) self.icon = Icon(parent=self.iconInnerCont, typeID=self.typeID, state=uiconst.UI_DISABLED, ignoreSize=True, pos=(0, 0, 32, 32)) GetTechLevelIcon(self.techIcon, 1, self.typeID) itemName = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=self.itemName, info=('showinfo', self.typeID, self.item.itemID)) self.itemNameLabel = Label(text=itemName, parent=self.textCont, left=40, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL, autoFadeSides=35, fontsize=12)
def DrawItem(self): iconCont = Container(name='iconCont', parent=self.textCont, align=uiconst.TOLEFT, width=32, padding=4) iconInnerCont = Container(name='iconInnerCont', parent=iconCont, align=uiconst.CENTER, pos=(0, 0, 32, 32)) self.wheel = LoadingWheel(parent=iconCont, pos=(0, 0, 48, 48), align=uiconst.CENTER, idx=0) self.wheel.display = False self.techIcon = Sprite(parent=iconInnerCont, pos=(0, 0, 16, 16), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) GetTechLevelIcon(self.techIcon, 1, self.typeID) self.icon = Icon(parent=iconInnerCont, typeID=self.typeID, state=uiconst.UI_DISABLED, align=uiconst.CENTER) self.icon.SetSize(32, 32) itemName = GetShowInfoLink(typeID=self.typeID, text=evetypes.GetName(self.typeID)) self.itemNameLabel = Label(text=itemName, parent=self.textCont, left=40, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL, autoFadeSides=35, fontsize=12)
def AddTypeAndIcon(self, label, typeID, moduleShortcut=None, moduleDamageAmount=0, iconSize=26, minRowSize=30): self.FillRow() self.AddSpacer(height=minRowSize, width=0) iconCont = Container(pos=(0, 0, iconSize, iconSize), align=uiconst.CENTER) iconObj = Icon(parent=iconCont, pos=(0, 0, iconSize, iconSize), align=uiconst.TOPLEFT, ignoreSize=True) iconObj.LoadIconByTypeID(typeID, size=iconSize, ignoreSize=True) techIcon = Icon(parent=iconCont, width=16, height=16, align=uiconst.TOPLEFT, idx=0, top=0) GetTechLevelIcon(techIcon, typeID=typeID) self.AddCell(iconCont, cellPadding=2) if moduleShortcut: nameColSpan = self.columns - 3 else: nameColSpan = self.columns - 2 if moduleDamageAmount > 0: damagedText = localization.GetByLabel( 'UI/Inflight/ModuleRacks/ModuleDamaged', color='<color=red>', percentageNum=moduleDamageAmount) label += '<br>' + damagedText labelObj = self.AddLabelMedium(text=label, align=uiconst.CENTERLEFT, cellPadding=self.labelPadding, colSpan=nameColSpan) if moduleShortcut: shortcutObj = ShortcutHint(text=moduleShortcut) shortcutObj.width += 10 shortcutObj.padLeft = 10 self.AddCell(shortcutObj) return (iconObj, labelObj)