Exemplo n.º 1
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.jobData = attributes.jobData
     self.videoThread = None
     self.iconCont = Container(name='iconCont', parent=self, align=CENTER, state=uiconst.UI_NORMAL, width=64, height=64)
     self.errorFrame = ErrorFrame(parent=self, align=uiconst.CENTER, pos=(0, 0, 64, 64), state=uiconst.UI_HIDDEN)
     self.qtyLabel = EveLabelLargeBold(parent=self, align=CENTER, top=42)
     FrameThemeColored(name='bgVignette', parent=self, texturePath='res:/UI/Texture/Classes/Industry/Output/bgVignette.png', cornerSize=30)
     self.videoCont = Container(name='videoCont', parent=self, align=uiconst.CENTER, width=324, height=199)
     self.previewContFill = FillThemeColored(parent=self)
     self.previewCont = PreviewContainer(parent=self, align=uiconst.TOALL, state=uiconst.UI_HIDDEN)
     self.leftProbabilityGradient = GradientSprite(name='leftProbabilityGradient', parent=self, align=uiconst.CENTERLEFT, state=uiconst.UI_HIDDEN, pos=(0, 0, 160, 64), rgbData=((0, (1.0, 1.0, 1.0)),), alphaData=((0.0, 0.5), (1.0, 0.0)))
     self.rightProbabilityGradient = GradientSprite(name='rightProbabilityGradient', parent=self, align=uiconst.CENTERRIGHT, state=uiconst.UI_HIDDEN, pos=(0, 0, 160, 64), rgbData=((0, (1.0, 1.0, 1.0)),), alphaData=((0.0, 0.0), (1.0, 0.5)))
     self.previewCont.navigation.LoadTooltipPanel = self.LoadIconContTooltipPanel
     self.previewCont.navigation.GetTooltipDelay = self.GetIconContTooltipDelay
     self.previewCont.navigation.GetMenu = self.GetMenu
     self.iconCont.LoadTooltipPanel = self.LoadIconContTooltipPanel
     self.iconCont.GetTooltipDelay = self.GetIconContTooltipDelay
     self.iconCont.OnMouseEnter = self.OnIconContMouseEnter
     self.iconCont.OnMouseExit = self.OnIconContMouseExit
     self.iconCont.OnClick = self.OnIconContClick
     self.iconCont.GetMenu = self.GetMenu
     self.iconCont.GetDragData = self.GetIconContDragData
     self.iconCont.isDragObject = True
     self.techIcon = Sprite(name='techIcon', parent=self.iconCont, width=16, height=16)
     self.icon = Icon(parent=self.iconCont, align=CENTER, state=uiconst.UI_DISABLED)
     self.bgCont = Container(name='bgCont', parent=self, align=uiconst.CENTER, width=201, height=192)
     self.bg = Sprite(bgParent=self.bgCont, texturePath='res:/UI/Texture/Classes/Industry/Output/itemBg.png')
     self.itemPattern = Sprite(bgParent=self.bgCont, texturePath='res:/UI/Texture/Classes/Industry/Output/itemBgColor.png')
     self.UpdateState()
     self.AnimEntry()
Exemplo n.º 2
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.isSelected = False
     self.typeID = attributes.typeID
     self.invType = cfg.invtypes.Get(self.typeID)
     typeName = self.invType.name
     self.quantity = attributes.quantity
     self.stacksize = attributes.get('stacksize', None)
     self.itemState = attributes.get('itemState', None)
     singleton = attributes.get('singleton', 0)
     isBlueprint = cfg.invtypes.Get(self.typeID).categoryID == const.categoryBlueprint
     isCopy = isBlueprint and singleton == const.singletonBlueprintCopy
     self.stateIcon = None
     self.spriteCont = self.spriteCont = Container(name='spriteCont', parent=self, align=CENTER, width=ICON_SIZE, height=ICON_SIZE, state=uiconst.UI_PICKCHILDREN)
     self.icon = Icon(name=typeName, parent=self.spriteCont, width=ICON_SIZE, height=ICON_SIZE, align=CENTER, state=uiconst.UI_DISABLED, saturation=1.0, effectOpacity=0.0, spriteEffect=trinity.TR2_SFX_SOFTLIGHT)
     self.icon.LoadIconByTypeID(typeID=self.typeID, ignoreSize=True, isCopy=isCopy)
     self.hint = typeName
     self.techIcon = Sprite(name='techIcon', parent=self.spriteCont, width=16, height=16, idx=0, saturation=1.0, effectOpacity=0.0, spriteEffect=trinity.TR2_SFX_SOFTLIGHT)
     uix.GetTechLevelIcon(self.techIcon, 0, self.typeID)
     if self.itemState:
         resPath, stateColor = self.GetStateResPathAndColor(self.itemState)
         self.stateIcon = Sprite(name='stateIcon', parent=self.spriteCont, width=32, height=32, idx=0, left=-4, top=-4, align=uiconst.TOPRIGHT, texturePath=resPath, color=stateColor, state=uiconst.UI_DISABLED)
     self.entryHilite = Sprite(name='hilite', align=uiconst.TOALL, parent=self.spriteCont, texturePath='res:/UI/Texture/classes/InvItem/bgHover.png', blendMode=trinity.TR2_SBM_ADD, opacity=0.0, idx=0, state=uiconst.UI_DISABLED)
     self.entryHilite.hint = typeName
     self.quantityParent = Container(parent=self, idx=0, name='qtyCont', pos=(3, 38, 32, 11), align=uiconst.TOPRIGHT, bgColor=(0, 0, 0, 0.95), state=uiconst.UI_HIDDEN)
     self.qtyLabel = Label(parent=self.quantityParent, left=2, maxLines=1, fontsize=9)
     self._SetQtyText()
Exemplo n.º 3
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.Get('typeID', None)
     iskAmount = attributes.Get('iskAmount', 0)
     amount = attributes.Get('amount', 0)
     typeName = evetypes.GetName(typeID)
     mainCont = Container(name='mainCont', parent=self)
     iconCont = Container(name='iconCont',
                          parent=mainCont,
                          align=uiconst.TOLEFT,
                          width=18)
     textCont = Container(name='textCont',
                          parent=mainCont,
                          align=uiconst.TOALL,
                          padding=const.defaultPadding)
     icon = Icon(parent=iconCont,
                 align=uiconst.TOALL,
                 size=18,
                 typeID=typeID,
                 ignoreSize=True)
     icon.OnClick = (self.ShowInfo, None, typeID)
     icon.hint = typeName
     iskLabel = EveLabelSmall(text=FmtISK(iskAmount, 0),
                              parent=textCont,
                              align=uiconst.TORIGHT,
                              maxLines=1)
     amountLabel = EveLabelSmall(text='%ix' % amount,
                                 parent=textCont,
                                 align=uiconst.TOLEFT,
                                 maxLines=1)
     if amount == 0:
         mainCont.opacity = 0.5
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 def BuildTopParentUI(self):
     self.sr.topParent.padding = (2 * const.defaultPadding, 0,
                                  2 * const.defaultPadding, 0)
     self.shipIcon = Icon(name='shipIcon',
                          parent=self.sr.topParent,
                          state=uiconst.UI_NORMAL,
                          size=64,
                          ignoreSize=True)
     self.shipIcon.GetDragData = self.GetFittingDragData
     self.shipIcon.OnClick = self.OpenFitting
     self.shipIcon.hint = GetByLabel('UI/Fitting/ShowFitting')
     self.techSprite = Sprite(name='techIcon',
                              parent=self.sr.topParent,
                              align=uiconst.RELATIVE,
                              width=16,
                              height=16,
                              idx=0)
     self.fitNameEdit = SinglelineEdit(
         name='fitNameEdit',
         parent=self.sr.topParent,
         left=72,
         width=150,
         maxLength=20,
         hint=GetByLabel('UI/Common/ShipName'))
     top = self.fitNameEdit.top + self.fitNameEdit.height + 5
     self.shipNameLabel = EveLabelMedium(name='shipNameLabel',
                                         parent=self.sr.topParent,
                                         left=77,
                                         top=top,
                                         state=uiconst.UI_NORMAL)
Exemplo n.º 7
0
 def CreateCurrentShipCont(self):
     self.shipCont.Flush()
     Frame(parent=self.shipCont, color=(1, 1, 1, 0.1))
     activeShip = GetActiveShip()
     clientDogmaLocation = sm.GetService('clientDogmaIM').GetDogmaLocation()
     shipDogmaItem = clientDogmaLocation.GetShip()
     shipTypeID = shipDogmaItem.typeID
     icon = Icon(parent=self.shipCont,
                 pos=(0, 0, 40, 40),
                 ignoreSize=True,
                 state=uiconst.UI_DISABLED)
     if self.fittingSvc.IsShipSimulated():
         self.shipCont.OnClick = self.ExitSimulation
         icon.LoadIconByTypeID(shipTypeID)
     else:
         self.shipCont.OnClick = self.LoadCurrentShip
         hologramTexture = inventorycommon.typeHelpers.GetHoloIconPath(
             shipTypeID)
         icon.LoadTexture(hologramTexture)
     shipName = cfg.evelocations.Get(activeShip).name
     text = '%s<br>%s' % (evetypes.GetName(shipTypeID), shipName)
     self.shipnametext = EveLabelMedium(text=text,
                                        parent=self.shipCont,
                                        align=uiconst.TOTOP,
                                        top=2,
                                        padLeft=48)
Exemplo n.º 8
0
 def ApplyAttributes(self, attributes):
     BaseFramedContainer.ApplyAttributes(self, attributes)
     self.labelCont = Container(parent=self.contentCont, align=uiconst.CENTERLEFT, left=8, width=237, height=38)
     IndustryCaptionLabel(parent=self.labelCont, align=uiconst.TOTOP, text=localization.GetByLabel('UI/Industry/Facility'))
     self.label = Label(parent=self.labelCont, align=uiconst.TOTOP, fontsize=10)
     self.icon = Icon(name='installationIcon', parent=self.contentCont, align=CENTERRIGHT, state=UI_DISABLED, pos=(1, 0, 43, 42))
     self.removeIcon = Sprite(parent=self.contentCont, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED, texturePath='res:/ui/texture/icons/73_16_45.png', pos=(46, 2, 12, 12), color=Color.RED, opacity=0.0)
Exemplo n.º 9
0
 def AddRow(self, idx):
     labelPath, what, iconNo, labelHintPath = rowsInfo[idx]
     rowName = 'row_%s' % what
     row = Container(name='row_%s' % rowName,
                     parent=self,
                     align=uiconst.TOTOP,
                     height=32)
     mainIcon = Icon(icon=iconNo,
                     parent=row,
                     pos=(0, 0, 32, 32),
                     ignoreSize=True)
     mainIcon.hint = GetByLabel(labelPath)
     statusLabel = Label(text='',
                         parent=row,
                         left=mainIcon.left + mainIcon.width,
                         state=uiconst.UI_NORMAL,
                         align=uiconst.CENTERLEFT,
                         width=62)
     statusLabel.hint = GetByLabel(labelHintPath)
     self.statsLabelsByIdentifier[what] = statusLabel
     dmgContainer = Container(parent=row,
                              name='dmgContainer',
                              left=self.col1Width)
     gaugeCont = DamageGaugeContainerFitting(parent=dmgContainer)
     self.statsContsByIdentifier[what] = gaugeCont
Exemplo n.º 10
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.shipFighterState = GetShipFighterState()
     self.typeID = None
     self.squadronSize = None
     self.squadronMaxSize = None
     self.noHealthyFighters = 0
     self.squadronState = attributes.get('state', None)
     self.tubeFlagID = attributes.get('tubeFlagID', None)
     dashColors = self.GetDashColors()
     self.classIcon = Sprite(name='classIcon',
                             parent=self,
                             align=uiconst.CENTERBOTTOM,
                             width=16,
                             height=16,
                             top=18)
     self.classIcon.OnMouseEnter = self.OnMouseEnter
     self.classIcon.OnMouseExit = self.OnMouseExit
     self.classIcon.GetDragData = self.GetDragData
     self.fightersGauge = FighterHealthGaugeLine(parent=self,
                                                 dashColors=dashColors,
                                                 align=uiconst.CENTER)
     Sprite(
         parent=self,
         align=uiconst.CENTER,
         width=86,
         height=86,
         texturePath=
         'res:/UI/Texture/classes/ShipUI/Fighters/fighterItemOverlay.png',
         state=uiconst.UI_DISABLED)
     self.fighterIcon = Icon(
         parent=self,
         align=uiconst.CENTER,
         width=52,
         height=52,
         state=uiconst.UI_DISABLED,
         blendMode=1,
         textureSecondaryPath=
         'res:/UI/Texture/classes/ShipUI/Fighters/fighterItemMask.png',
         spriteEffect=trinity.TR2_SFX_MODULATE)
     Sprite(
         parent=self,
         align=uiconst.CENTER,
         width=86,
         height=86,
         texturePath=
         'res:/UI/Texture/classes/ShipUI/Fighters/fighterItemUnderlay.png',
         state=uiconst.UI_DISABLED)
     self.hilite = Sprite(
         parent=self,
         name='hilite',
         width=86,
         height=86,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/ShipUI/Fighters/fighterItemUnderlayOver.png'
     )
     self.hilite.display = False
Exemplo n.º 11
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.activeCurve = None
     self.activationPendingCurve = None
     self.deactivationCurve = None
     self.ramp_active = False
     self.buttonDisabled = False
     self.shipFighterState = GetShipFighterState()
     self.crimewatchSvc = sm.GetService('crimewatchSvc')
     self.innerCont = Container(name='innerCont',
                                parent=self,
                                align=uiconst.TOBOTTOM,
                                height=self.height)
     self.stateLabel = EveLabelSmall(parent=self.innerCont,
                                     align=uiconst.CENTER)
     self.controller = attributes.controller
     self.slotID = self.controller.slotID
     self.fighterID = attributes.fighterID
     self.fighterTypeID = attributes.fighterTypeID
     ability = self.GetAbilityInfo()
     self.abilityNameID = ability.displayNameID
     iconID = ability.iconID
     self.abilityIcon = Icon(parent=self.innerCont,
                             align=uiconst.CENTER,
                             width=32,
                             height=32,
                             icon=iconID,
                             state=uiconst.UI_DISABLED)
     self.hilite = Sprite(
         parent=self.innerCont,
         name='hilite',
         width=44,
         height=44,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/ShipUI/slotHilite.png',
         blendMode=trinity.TR2_SBM_ADDX2)
     self.hilite.display = False
     bgSprite = Sprite(
         parent=self.innerCont,
         align=uiconst.CENTER,
         width=64,
         height=64,
         texturePath=
         'res:/UI/Texture/classes/ShipUI/Fighters/slotFighterAbility.png',
         state=uiconst.UI_DISABLED)
     self.abilityIcon.SetSize(32, 32)
     self.DrawQtyCont()
     self.DrawTimer()
     self.DrawCoolDownTimer()
     self.DrawSafetyGlow()
     self.targetMode = ability.targetMode
     abilityID = GetAbilityIDForSlot(self.fighterTypeID, self.slotID)
     effectID = GetDogmaEffectIDForAbilityID(abilityID)
     self.abilityEffect = cfg.dgmeffects.Get(effectID)
     self.OnAbilityStatusUpdated(self.fighterID, self.slotID)
     self.shipFighterState.signalOnAbilityActivationStatusUpdate.connect(
         self.OnAbilityStatusUpdated)
Exemplo n.º 12
0
 def AddIcon(self, parent, iconNum, tooltipCallback):
     angle = 306
     iconRad = int(310 * GetScaleFactor())
     left, top, cos, sin = self.GetPositionNumbers(angle, iconRad, offset=16)
     icon = Icon(name='%s_Icon' % self.attribute.attributeName, icon=iconNum, parent=parent, state=UI_NORMAL, hint=self.attribute.displayName, pos=(left,
      top,
      32,
      32), ignoreSize=True)
     icon.LoadTooltipPanel = tooltipCallback
Exemplo n.º 13
0
    def CheckButtonVisibility(self, gidx, sTypes, totalslot, myOrder):
        lastType = ''
        showEmptySlots = settings.user.ui.Get('showEmptySlots', 0)
        slotUIID = 0
        for sType in sTypes:
            if totalslot is None:
                totalslots = self.GetNumSlots(sType)
            ignoredSlots = 0
            for sidx in xrange(totalslots):
                if sidx == 8:
                    break
                flagTypes = ['Hi',
                 'Med',
                 'Lo',
                 'Stuct']
                if not self.controller.IsControllingTurret():
                    if gidx < len(flagTypes):
                        slotFlag = getattr(const, 'flag%sSlot%s' % (flagTypes[gidx], sidx), None)
                    slot = self.slotsByFlag.get(slotFlag, None)
                else:
                    slotFlag = myOrder[sidx]
                    slot = self.slotsByFlag.get(slotFlag, None)
                typeNames = ['High',
                 'Medium',
                 'Low',
                 'Stuct']
                slotUIID += 1
                if gidx < len(typeNames):
                    currType = typeNames[gidx]
                    if currType != lastType:
                        slotUIID = 1
                    lastType = currType
                    if slot:
                        slot.name = 'inFlight%sSlot%s' % (typeNames[gidx], slotUIID)
                if showEmptySlots and not self.controller.IsControllingTurret():
                    if slot and slot.sr.module is None and slotFlag not in self.passiveFiltered:
                        slot.showAsEmpty = 1
                        if gidx == 0:
                            if ignoredSlots < self.totalSlaves:
                                ignoredSlots += 1
                                slot.ignored = 1
                                continue
                        slot.hint = [GetByLabel('UI/Inflight/EmptyHighSlot'), GetByLabel('UI/Inflight/EmptyMediumSlot'), GetByLabel('UI/Inflight/EmptyLowSlot')][gidx]
                        slot.state = uiconst.UI_NORMAL
                        iconpath = ['ui_8_64_11',
                         'ui_8_64_10',
                         'ui_8_64_9',
                         'ui_44_64_14'][gidx]
                        icon = Icon(icon=iconpath, parent=slot, pos=(13, 13, 24, 24), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, idx=0, ignoreSize=True)
                        icon.left = (slot.width - icon.width) / 2
                        icon.color.a = 0.25

            gidx += 1
Exemplo n.º 14
0
 def ApplyAttributes(self, attributes):
     FittingSlotBase.ApplyAttributes(self, attributes)
     self.sr.underlay = Sprite(bgParent=self,
                               name='underlay',
                               state=uiconst.UI_DISABLED,
                               padding=(0, 0, 0, 0),
                               texturePath=self.underlayTexturePath)
     self.flagIcon = Icon(parent=self,
                          name='flagIcon',
                          align=uiconst.CENTER,
                          state=uiconst.UI_DISABLED,
                          width=self.width,
                          height=self.height)
     self.UpdateFitting()
Exemplo n.º 15
0
 def AddAttributeCont(self, attribute, parentGrid, attributeID=None):
     if attributeID is None:
         attributeID = attribute.attributeID
     iconSize = 32
     attributeCont = self.GetValueCont(iconSize)
     parentGrid.AddCell(cellObject=attributeCont)
     icon = Icon(graphicID=attribute.iconID,
                 pos=(3, 0, iconSize, iconSize),
                 hint=attribute.displayName,
                 name=attribute.displayName,
                 ignoreSize=True,
                 state=uiconst.UI_DISABLED)
     attributeCont.AddCell(cellObject=icon)
     label = EveLabelMedium(text='',
                            left=0,
                            state=uiconst.UI_DISABLED,
                            align=uiconst.CENTERLEFT)
     attributeCont.AddCell(cellObject=label)
     attributeCont.hint = attribute.displayName
     tooltipTitleID = attribute.tooltipTitleID
     if tooltipTitleID:
         tooltipTitle = GetByMessageID(tooltipTitleID)
         tooltipDescr = GetByMessageID(attribute.tooltipDescriptionID)
         SetTooltipHeaderAndDescription(targetObject=attributeCont,
                                        headerText=tooltipTitle,
                                        descriptionText=tooltipDescr)
     self.statsLabelsByIdentifier[attributeID] = label
     self.statsIconsByIdentifier[attributeID] = icon
     self.statsContsByIdentifier[attributeID] = attributeCont
     return (icon, label, attributeCont)
Exemplo n.º 16
0
 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')
Exemplo n.º 17
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.Get('typeID', None)
     iskAmount = attributes.Get('iskAmount', 0)
     amount = attributes.Get('amount', 0)
     typeName = evetypes.GetName(typeID)
     mainCont = Container(name='mainCont', parent=self)
     iconCont = Container(name='iconCont', parent=mainCont, align=uiconst.TOLEFT, width=18)
     textCont = Container(name='textCont', parent=mainCont, align=uiconst.TOALL, padding=const.defaultPadding)
     icon = Icon(parent=iconCont, align=uiconst.TOALL, size=18, typeID=typeID, ignoreSize=True)
     icon.OnClick = (self.ShowInfo, None, typeID)
     icon.hint = typeName
     iskLabel = EveLabelSmall(text=FmtISK(iskAmount, 0), parent=textCont, align=uiconst.TORIGHT, maxLines=1)
     amountLabel = EveLabelSmall(text='%ix' % amount, parent=textCont, align=uiconst.TOLEFT, maxLines=1)
     if amount == 0:
         mainCont.opacity = 0.5
Exemplo n.º 18
0
 def SetStatus(self, cont, iconPath=None):
     cont.Flush()
     if iconPath:
         Icon(icon=iconPath,
              parent=cont,
              align=uiconst.CENTER,
              pos=(0, 0, 16, 16))
Exemplo n.º 19
0
 def Startup(self, *args):
     self.icon = Icon(parent=self,
                      pos=(1, 0, 24, 24),
                      align=uiconst.CENTERLEFT)
     self.labelLeft = EveLabelMedium(parent=self,
                                     align=uiconst.CENTERLEFT,
                                     state=uiconst.UI_DISABLED,
                                     left=26)
     self.probeExpiry = EveLabelMediumBold(parent=self,
                                           align=uiconst.CENTERRIGHT,
                                           state=uiconst.UI_DISABLED,
                                           left=66)
     self.probeScanRange = EveLabelMediumBold(parent=self,
                                              align=uiconst.CENTERRIGHT,
                                              state=uiconst.UI_DISABLED,
                                              left=6)
Exemplo n.º 20
0
 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
Exemplo n.º 21
0
 def DrawDraggedItems(self, dragData):
     if getattr(dragData[0], '__guid__', None) != 'xtriui.InvItem':
         return
     self.hasDrawn = True
     uicore.animations.FadeOut(self.dropLabel, duration=0.15)
     noOfItems = len(dragData)
     noOfAvailable = math.floor((self.width - 16) / 28)
     for i, dragItem in enumerate(dragData):
         c = Container(parent=self.fakeItemsCont,
                       align=uiconst.TOLEFT,
                       padding=2,
                       width=24)
         if noOfItems > noOfAvailable and i == noOfAvailable - 1:
             icon = Sprite(
                 parent=c,
                 texturePath=
                 'res:/UI/Texture/classes/MultiSell/DotDotDot.png',
                 state=uiconst.UI_DISABLED,
                 width=24,
                 height=24,
                 align=uiconst.CENTER)
             icon.SetAlpha(0.6)
             return
         icon = Icon(parent=c,
                     typeID=dragItem.item.typeID,
                     state=uiconst.UI_DISABLED)
         icon.SetSize(24, 24)
Exemplo n.º 22
0
 def AddIconCell(self, texturePath = None, iconID = None, iconSize = 24):
     icon = Icon(pos=(0,
      0,
      iconSize,
      iconSize), align=uiconst.CENTER, ignoreSize=True, state=uiconst.UI_DISABLED, icon=texturePath or iconID)
     self.AddCell(icon)
     return icon
Exemplo n.º 23
0
 def AddGaugeAndIconToContainer(self, container, damageType, color):
     iconCont = Container(parent=container,
                          name='iconCont',
                          width=self.iconSize,
                          align=uiconst.TOLEFT,
                          state=uiconst.UI_DISABLED)
     icon = Icon(parent=iconCont,
                 pos=(0, 0, self.iconSize, self.iconSize),
                 align=uiconst.CENTERLEFT,
                 idx=0,
                 ignoreSize=True,
                 state=uiconst.UI_DISABLED)
     if not self.showIcon:
         iconCont.display = False
     gauge = Gauge(parent=container,
                   name='gauge_%s' % damageType,
                   value=0.0,
                   color=color,
                   gaugeHeight=self.gaugeHeight,
                   align=uiconst.TOALL,
                   pos=(0, self.gaugeTopOffset, 0, 0),
                   state=uiconst.UI_DISABLED,
                   gradientBrightnessFactor=1.5)
     container.gauge = gauge
     container.icon = icon
     setattr(self, 'gauge_%s' % damageType, gauge)
Exemplo n.º 24
0
 def SetHeaderIcon(self,
                   iconNo='ui_73_16_50',
                   shiftLabel=12,
                   hint=None,
                   size=16):
     par = self.sr.captionParent
     if self.sr.headerIcon:
         self.sr.headerIcon.Close()
         self.sr.headerIcon = None
     if iconNo is None:
         if self.sr.caption:
             self.sr.caption.left = 8
     else:
         self.sr.headerIcon = Icon(icon=iconNo,
                                   parent=par,
                                   pos=(4, 0, size, size),
                                   align=uiconst.RELATIVE,
                                   ignoreSize=True)
         self.sr.headerIcon.SetAlpha(0.8)
         self.sr.headerIcon.OnMouseEnter = self.HeaderIconMouseEnter
         self.sr.headerIcon.OnMouseExit = self.HeaderIconMouseExit
         self.sr.headerIcon.expandOnLeft = 1
         if self.sr.caption:
             self.sr.caption.left = 8 + shiftLabel
     self.headerIconNo = iconNo
     self.headerIconHint = hint
     if self.sr.tab:
         self.sr.tab.SetIcon(iconNo, 14, hint)
Exemplo n.º 25
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     typeID = attributes.typeID
     qty = attributes.qty
     iconPadding = 1 * const.defaultPadding
     typeIcon = Icon(name='typeIcon',
                     parent=self,
                     state=uiconst.UI_NORMAL,
                     size=32,
                     left=iconPadding,
                     ignoreSize=True,
                     typeID=typeID)
     techIcon = uix.GetTechLevelIcon(typeID=typeID)
     if techIcon:
         techIcon.left = iconPadding
         techIcon.SetParent(self, idx=0)
     typeName = evetypes.GetName(typeID)
     link = '<url="showinfo:%s">%s</url>' % (typeID, typeName)
     text = '%sx %s' % (qty, link)
     left = iconPadding * 2 + typeIcon.width + 10
     label = EveLabelMedium(parent=self,
                            left=left,
                            text=text,
                            state=uiconst.UI_NORMAL,
                            align=uiconst.CENTERLEFT)
     self.width = label.left + label.textwidth + 10
Exemplo n.º 26
0
 def AddColumnBlueprintLabel(self):
     col = self.AddColumnContainer()
     texturePath, hint = uix.GetTechLevelIconPathAndHint(
         self.jobData.blueprint.blueprintTypeID)
     if texturePath:
         techIconSize = 16 if self.viewMode == VIEWMODE_ICONLIST else 12
         Sprite(name='techIcon',
                parent=col,
                texturePath=texturePath,
                hint=hint,
                width=techIconSize,
                height=techIconSize)
     if self.viewMode == VIEWMODE_ICONLIST:
         iconSize = 32
         Icon(parent=col,
              typeID=self.jobData.blueprint.blueprintTypeID,
              isCopy=not self.jobData.blueprint.original,
              ignoreSize=True,
              align=uiconst.CENTERLEFT,
              state=uiconst.UI_DISABLED,
              width=iconSize,
              height=iconSize,
              left=2)
     else:
         iconSize = 0
     Label(parent=col,
           text=self.jobData.blueprint.GetLabel(),
           align=uiconst.CENTERLEFT,
           left=iconSize + 4,
           idx=0)
Exemplo n.º 27
0
    def LoadTooltipPanel(self, tooltipPanel, *args):
        typeID, reprocessingYield, stationTaxHint, itemYieldHint, stationEfficiency = self.hintInfo
        tooltipPanel.LoadGeneric1ColumnTemplate()
        rowSpan = 1
        if self.itemState:
            rowSpan = 2
        subGrid1 = LayoutGrid()
        icon = Icon(width=64, height=64, align=CENTER)
        icon.LoadIconByTypeID(typeID=self.typeID, ignoreSize=True)
        subGrid1.AddCell(icon, rowSpan=rowSpan)
        yieldText = '<color=%s>%s%%</color>' % (Color.RGBtoHex(*COL_LIGHTBLUE), FmtAmt(reprocessingYield * 100.0, showFraction=1))
        topLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/ItemYieldHint', itemName=cfg.invtypes.Get(self.typeID).name, itemYield=yieldText), width=170, autoFitToText=True, left=6, top=4, bold=True)
        subGrid1.AddCell(topLabel)
        if self.itemState:
            hintText = ''
            hintColor = None
            if self.itemState == STATE_REPROCESS:
                hintText = GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessedFurtherHint')
                hintColor = COL_GREEN
            elif self.itemState == STATE_RESTRICTED:
                portionSize = GetPortionSize(typeID)
                if portionSize > self.quantity:
                    noOfItems = FmtAmt(portionSize, showFraction=0)
                    hintText = GetByLabel('UI/Reprocessing/ReprocessingWindow/CannotReprocessHint', noOfItems=noOfItems)
                else:
                    hintText = GetByLabel('UI/Reprocessing/ReprocessingWindow/CannotReprocessNoValueHint')
                hintColor = COL_RED
            elif self.itemState == STATE_SUSPICIOUS:
                hintText = GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessingWarningHint')
                hintColor = COL_YELLOW
            stateHint = EveLabelMedium(text=hintText, width=170, autoFitToText=True, left=6, top=4, color=hintColor)
            subGrid1.AddCell(stateHint)
        tooltipPanel.AddCell(subGrid1)
        subGrid = LayoutGrid()
        subGrid.AddCell(cellPadding=6, colSpan=2)
        subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/DetailedYieldHint'), color=COL_BLUE, bold=True), colSpan=2)
        for label in GetReprocessingModifiersAsLabels(typeID, stationEfficiency, stationTaxHint, self.getTypeAttribute, self.getSkillLevel):
            subGrid.AddCell(label)

        if itemYieldHint:
            subGrid.AddCell(cellPadding=6, colSpan=2)
            subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/YouWillReceiveHint'), color=COL_BLUE, bold=True), colSpan=2)
            for typeID, qty in itemYieldHint:
                subGrid.AddCell(EveLabelMedium(text=FmtAmt(qty, showFraction=False), colSpan=1, align=uiconst.TORIGHT, padRight=3, color=COL_LIGHTBLUE, bold=True))
                subGrid.AddCell(EveLabelMedium(text='%s' % GetTypeName(typeID), colSpan=1, padLeft=3))

        tooltipPanel.AddCell(subGrid)
Exemplo n.º 28
0
def get_agent_icon(name, parent, align, size, agent_id):
    agent_icon = Icon(name=name,
                      parent=parent,
                      align=align,
                      size=size,
                      ignoreSize=True)
    sm.GetService('photo').GetPortrait(agent_id, size, agent_icon)
    return agent_icon
Exemplo n.º 29
0
 def AddIcon(iconNum, left=-1):
     Icon(icon=iconNum,
          parent=self,
          pos=(left, -2, 16, 16),
          align=uiconst.TOPRIGHT,
          idx=0,
          state=uiconst.UI_DISABLED)
     self.width += 14
Exemplo n.º 30
0
 def SetFactionIcon(self, factionID):
     iconID = LogoIcon.GetFactionIconID(factionID, isSmall=True)
     if iconID is not None:
         resPath = Icon.ConvertIconNoToResPath(iconID)
         if resPath is not None:
             self.CreateIconSpite()
             self.ownerIcon.SetTexturePath(resPath[0])
             self.iconCont.state = uiconst.UI_NORMAL
             self.iconCont.OnClick = lambda : sm.GetService('info').ShowInfo(itemID=factionID, typeID=typeFaction)
Exemplo n.º 31
0
 def ApplyAttributes(self, attributes):
     UtilMenuCheckBox.ApplyAttributes(self, attributes)
     self.subIcon = Icon(parent=self, icon=attributes.subIcon, state=uiconst.UI_DISABLED, left=3, width=16, height=16, align=uiconst.CENTERRIGHT, ignoreSize=True)
     if attributes.subIconCallback:
         self.subIcon.hint = attributes.subIconHint
         self.subIcon.state = uiconst.UI_NORMAL
         self.subIcon.OnClick = self.OnSubIconClick
         self.subIcon.OnMouseEnter = self.OnMouseEnter
         self.subIconCallback = attributes.subIconCallback
Exemplo n.º 32
0
 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)