Example #1
0
 def LoadTooltipWithOwner(self, tooltipPanel, *args):
     tooltipPanel.state = uiconst.UI_NORMAL
     tooltipPanel.columns = 2
     tooltipPanel.margin = 2
     tooltipPanel.cellPadding = 1
     structureOwnerID = self.structureInfo.get('allianceID', None)
     ownerIcon = GetLogoIcon(itemID=structureOwnerID, parent=tooltipPanel, width=48, height=48, ignoreSize=True, state=uiconst.UI_NORMAL, align=uiconst.CENTER)
     ownerIcon.GetDragData = self.GetAllianceDragData
     infoLabel = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=cfg.eveowners.Get(structureOwnerID).name, info=('showinfo', const.typeAlliance, structureOwnerID))
     tooltipPanel.AddLabelLarge(text=infoLabel, width=160, align=uiconst.CENTERLEFT, bold=True, state=uiconst.UI_NORMAL)
     statusContainer = SovStructureStatusHorizontal(structureInfo=self.structureInfo, align=uiconst.CENTER, width=214, centerLabel=True, barBgColor=(0.2, 0.2, 0.2, 0.3), autoHeight=True)
     tooltipPanel.AddCell(cellObject=statusContainer, colSpan=2)
     timeLabel = SovStatusTimeLabel(align=uiconst.CENTER, state=uiconst.UI_NORMAL, structureInfo=self.structureInfo, width=190)
     tooltipPanel.AddCell(cellObject=timeLabel, colSpan=2)
 def LoadTooltipWithOwner(self, tooltipPanel, *args):
     tooltipPanel.state = uiconst.UI_NORMAL
     tooltipPanel.columns = 2
     tooltipPanel.margin = 2
     tooltipPanel.cellPadding = 1
     structureOwnerID = self.structureInfo.get('allianceID', None)
     ownerIcon = GetLogoIcon(itemID=structureOwnerID, parent=tooltipPanel, width=48, height=48, ignoreSize=True, state=uiconst.UI_NORMAL, align=uiconst.CENTER)
     ownerIcon.GetDragData = self.GetAllianceDragData
     infoLabel = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=cfg.eveowners.Get(structureOwnerID).name, info=('showinfo', const.typeAlliance, structureOwnerID))
     tooltipPanel.AddLabelLarge(text=infoLabel, width=160, align=uiconst.CENTERLEFT, bold=True, state=uiconst.UI_NORMAL)
     statusContainer = SovStructureStatusHorizontal(structureInfo=self.structureInfo, align=uiconst.CENTER, width=214, centerLabel=True, barBgColor=(0.2, 0.2, 0.2, 0.3), autoHeight=True)
     tooltipPanel.AddCell(cellObject=statusContainer, colSpan=2)
     timeLabel = SovStatusTimeLabel(align=uiconst.CENTER, state=uiconst.UI_NORMAL, structureInfo=self.structureInfo, width=190)
     tooltipPanel.AddCell(cellObject=timeLabel, colSpan=2)
Example #3
0
 def GetLogo(self, corpID):
     logo = GetLogoIcon(itemID=corpID,
                        state=uiconst.UI_NORMAL,
                        align=uiconst.TOPLEFT,
                        pos=(0, 0, 64, 64),
                        ignoreSize=True)
     return logo
Example #4
0
 def AddAllianceIcon(self):
     allianceID = self.node.structureInfo['allianceID']
     if not allianceID:
         self.allianceIcon = None
         return
     allianceName = cfg.eveowners.Get(allianceID).name
     self.allianceIcon = GetLogoIcon(itemID=allianceID, parent=self, acceptNone=False, align=uiconst.CENTERRIGHT, pos=(RIGHT_PADDING,
      0,
      32,
      32), state=uiconst.UI_NORMAL, hint=allianceName)
     self.allianceIcon.OnClick = lambda *args: sm.GetService('info').ShowInfo(typeID=invConst.typeAlliance, itemID=allianceID)
Example #5
0
 def LoadOwnerInfo(self):
     parent = self.corpLogoParent
     parent.Flush()
     corpID = eve.stationItem.ownerID
     size = 128 if CheckCorpID(corpID) else 64
     logo = GetLogoIcon(itemID=corpID, parent=parent, acceptNone=False, state=uiconst.UI_DISABLED, pos=(0,
      8,
      size,
      size), align=uiconst.CENTERTOP)
     InfoIcon(typeID=const.typeCorporation, itemID=corpID, left=const.defaultPadding, top=20, align=uiconst.TOPRIGHT, parent=parent, idx=0)
     self.corpLogoParent.height = logo.top + logo.height
     if not CheckCorpID(corpID):
         self.corpName.text = '<center>' + cfg.eveowners.Get(corpID).name
         self.corpName.display = True
     else:
         self.corpName.display = False
Example #6
0
 def AddAlliance(self):
     sovHolderID = self.node.sovHolderID
     self.allianceIcon = GetLogoIcon(itemID=sovHolderID, parent=self, acceptNone=False, align=uiconst.CENTERRIGHT, state=uiconst.UI_NORMAL, pos=(RIGHT_PADDING,
      0,
      32,
      32))
     self.allianceIcon.OnClick = lambda *args: sm.GetService('info').ShowInfo(typeID=invConst.typeAlliance, itemID=sovHolderID)
     self.allianceIcon.display = False
     if sovHolderID:
         sovText = cfg.eveowners.Get(sovHolderID).name
         textLeft = self.allianceIcon.width + self.allianceIcon.left + 6
         self.allianceIcon.hint = sovText
         self.allianceIcon.display = True
     else:
         sovText = GetByLabel('UI/Neocom/Unclaimed')
         textLeft = RIGHT_PADDING
     cont = ContainerAutoSize(parent=self, align=uiconst.TORIGHT, left=textLeft)
     EveLabelMedium(parent=cont, text=sovText, align=uiconst.CENTER, state=uiconst.UI_NORMAL)
Example #7
0
 def LogoThread():
     if not self.destroyed:
         GetLogoIcon(itemID=data.corpID,
                     parent=self.icon,
                     acceptNone=False,
                     align=uiconst.TOALL)
Example #8
0
 def LoadContent(self):
     if self.contentLoaded:
         return
     self.contentLoaded = True
     self._CreateMainBackground()
     self._CreatePanels()
     self._CreateNotificationText()
     self._CreateNotificationImage()
     if self.created:
         timeinterval = max(blue.os.GetWallclockTime() - self.created, 0)
         createdText = localization.GetByLabel(TIME_AGO_LABEL,
                                               time=timeinterval)
         self.timeLabel = EveLabelSmall(name='timeLabel',
                                        parent=self.rightContainer,
                                        align=uiconst.TOTOP,
                                        color=TIMETEXT_COLOR,
                                        padding=TIMETEXT_PADDING)
         self.timeLabel.text = createdText
     notification = self.notification
     if notification.typeID in [
             notificationConst.notificationTypeKillReportFinalBlow,
             notificationConst.notificationTypeKillReportVictim
     ]:
         shipTypeID = KillMailFinalBlowFormatter.GetVictimShipTypeID(
             notification.data)
         if shipTypeID is not None:
             parentContainer = self.leftContainer
             Icon(name='shipTypeIcon',
                  parent=parentContainer,
                  align=uiconst.TOPRIGHT,
                  size=SHIP_TYPE_ICON_SIZE,
                  typeID=shipTypeID)
             shipTechIcon = Sprite(name='shipTechIcon',
                                   parent=parentContainer,
                                   width=SHIP_TECH_ICON_SIZE,
                                   height=SHIP_TECH_ICON_SIZE,
                                   idx=0)
             uiUtils.GetTechLevelIcon(shipTechIcon, 0, shipTypeID)
             self.imageSprite.GetDragData = lambda *args: self.MakeKillDragObject(
                 notification)
     if self.ShouldDisplayPortrait(notification):
         item = cfg.eveowners.Get(notification.senderID)
         if item.IsCharacter():
             sm.GetService('photo').GetPortrait(notification.senderID,
                                                CHAR_PORTRAIT_SIZE,
                                                self.characterSprite)
             if notification.typeID in notificationConst.notificationShowStanding:
                 charinfo = item
                 self.imageSprite.GetMenu = lambda: sm.GetService(
                     'menu').GetMenuFormItemIDTypeID(
                         notification.senderID, charinfo.typeID)
                 self.imageSprite.GetDragData = lambda *args: self.MakeCharacterDragObject(
                     notification.senderID)
                 charData = KeyVal()
                 charData.charID = notification.senderID
                 charData.charinfo = charinfo
                 AddAndSetFlagIconFromData(charData,
                                           parentCont=self.leftContainer,
                                           top=self.characterSprite.height -
                                           FLAG_ICON_PADDING)
         else:
             self.corpLogo = GetLogoIcon(itemID=notification.senderID,
                                         parent=self.leftContainer,
                                         align=uiconst.TOPLEFT,
                                         size=CORP_LOGO_SIZE,
                                         state=uiconst.UI_DISABLED,
                                         ignoreSize=True)
         self.characterSprite.state = uiconst.UI_NORMAL