Exemplo n.º 1
0
 def InsertBrowseControls(self, *args):
     self.sr.backBtn = Container(name='backBtn', parent=self.sr.monthTextCont, align=uiconst.TOPLEFT, pos=(0, 0, 16, 16))
     icon = Sprite(parent=self.sr.backBtn, texturePath='res:/UI/Texture/Icons/1_16_13.png', pos=(0, 0, 16, 16), hint=localization.GetByLabel('/Carbon/UI/Common/Previous'))
     icon.OnClick = (self.ChangeMonth, -1)
     self.sr.fwdBtn = Container(name='fwdBtn', parent=self.sr.monthTextCont, align=uiconst.TOPRIGHT, pos=(0, 0, 16, 16))
     icon = Sprite(parent=self.sr.fwdBtn, texturePath='res:/UI/Texture/Icons/1_16_14.png', pos=(0, 0, 16, 16), hint=localization.GetByLabel('/Carbon/UI/Common/Next'))
     icon.OnClick = (self.ChangeMonth, 1)
Exemplo n.º 2
0
 def LoadAttrs(self, attrs):
     src = attrs.src
     if attrs.texture:
         sprite = Sprite(parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
         sprite.rectWidth = attrs.width
         sprite.rectHeight = attrs.height
         sprite.texture = attrs.texture
     elif src.startswith('icon:'):
         uthread.new(self.LoadIcon)
 def ApplyAttributes(self, attributes):
     ProbeTooltipButtonBase.ApplyAttributes(self, attributes)
     self.formation = attributes.formation
     self.OnChangeCallback = attributes.OnChangeCallback
     self.AddCell()
     self.label = EveLabelSmall(parent=self, text=attributes.text, bold=True, align=uiconst.CENTERLEFT)
     deleteButton = Sprite(texturePath='res:/UI/Texture/Icons/38_16_111.png', pos=(0, 0, 16, 16), align=uiconst.CENTERRIGHT, hint=localization.GetByLabel('UI/Inflight/Scanner/DeleteFormation'))
     self.AddCell(deleteButton, cellPadding=(5, 3, 4, 3))
     deleteButton.OnClick = self.DeleteFormation
    def CreateSpriteObject(self, *args, **kwds):
        kwds['state'] = uiconst.UI_DISABLED
        sprite = Sprite(*args, **kwds)
        while not sprite.texture.atlasTexture or sprite.texture.atlasTexture.isLoading:
            blue.pyos.synchro.Sleep(1)

        sprite.width = sprite.texture.atlasTexture.width
        sprite.height = sprite.texture.atlasTexture.height
        return sprite
Exemplo n.º 5
0
    def LoadTypeRequirements(self, typeID):
        if self.typeID is not None:
            self.Flush()
        self.typeID = typeID
        if typeID is None:
            return
        categoryID = evetypes.GetCategoryID(typeID)
        isSkill = categoryID == invconst.categorySkill
        haveSkill = sm.GetService('skills').GetSkill(typeID) is not None
        requiredSkills = sm.GetService('clientDogmaStaticSvc').GetRequiredSkills(typeID)
        if isSkill and haveSkill:
            SkillLevels(parent=self, align=uiconst.NOALIGN, typeID=typeID, groupID=evetypes.GetGroupID(typeID))
        elif requiredSkills:
            texturePath, hint = sm.GetService('skills').GetRequiredSkillsLevelTexturePathAndHint(requiredSkills.items(), typeID=typeID)
            skillIcon = Sprite(name='skillIcon', parent=self, align=uiconst.NOALIGN, width=ICON_SIZE, height=ICON_SIZE, texturePath=texturePath, hint=hint, useSizeFromTexture=False)
            skillSvc = sm.GetService('skills')
            if any((skillSvc.IsTrialRestricted(typeID) for typeID in requiredSkills.keys())):

                def OpenSubscriptionPage():
                    reasonCategory = {invconst.categoryShip: 'ship',
                     invconst.categorySkill: 'skill'}.get(evetypes.GetCategoryID(typeID), 'item')
                    reason = ':'.join([reasonCategory, str(typeID)])
                    uicore.cmd.OpenSubscriptionPage(origin=ORIGIN_MARKET, reason=reason)

                skillIcon.OnClick = OpenSubscriptionPage
            else:

                def OpenRequirementsInfoTab():
                    info = sm.GetService('info')
                    info.ShowInfo(typeID, selectTabType=infoConst.TAB_REQUIREMENTS)

                skillIcon.OnClick = OpenRequirementsInfoTab
        isModule = categoryID == invconst.categoryModule
        if isModule:
            godma = sm.GetService('godma')
            dogmaLocation = sm.GetService('clientDogmaIM').GetDogmaLocation()
            shipID = GetActiveShip()
            powerContainer = ContainerAutoSize(parent=self, align=uiconst.NOALIGN)
            modulePowerLoad = godma.GetTypeAttribute(typeID, dconst.attributePower, 0)
            powerOutput = dogmaLocation.GetAttributeValue(shipID, dconst.attributePowerOutput) - dogmaLocation.GetAttributeValue(shipID, dconst.attributePowerLoad)
            havePower = shipID is not None and powerOutput >= modulePowerLoad
            icon = ['res:/UI/Texture/classes/Market/powerRequirementNotMet.png', 'res:/UI/Texture/classes/Market/powerRequirementMet.png'][havePower]
            hint = ['UI/Market/Marketbase/PowerRequirementNotMet', 'UI/Market/Marketbase/PowerRequirementMet'][havePower]
            powerIcon = Sprite(parent=powerContainer, align=uiconst.CENTERTOP, texturePath=icon, width=ICON_SIZE, height=ICON_SIZE, ignoreSize=True, hint=localization.GetByLabel(hint))
            powerLabel = EveLabelSmallBold(parent=powerContainer, align=uiconst.CENTERTOP, top=ICON_SIZE + 2, text=int(modulePowerLoad))
            cpuContainer = ContainerAutoSize(parent=self, align=uiconst.NOALIGN)
            moduleCpuLoad = godma.GetTypeAttribute(typeID, dconst.attributeCpu, 0)
            cpuOutput = dogmaLocation.GetAttributeValue(shipID, dconst.attributeCpuOutput) - dogmaLocation.GetAttributeValue(shipID, dconst.attributeCpuLoad)
            haveCpu = shipID is not None and cpuOutput >= moduleCpuLoad
            icon = ['res:/UI/Texture/classes/Market/cpuRequirementNotMet.png', 'res:/UI/Texture/classes/Market/cpuRequirementMet.png'][haveCpu]
            hint = ['UI/Market/Marketbase/CpuRequirementNotMet', 'UI/Market/Marketbase/CpuRequirementMet'][haveCpu]
            cpuIcon = Sprite(parent=cpuContainer, align=uiconst.CENTERTOP, texturePath=icon, ignoreSize=True, width=ICON_SIZE, height=ICON_SIZE, hint=localization.GetByLabel(hint))
            cpuLabel = EveLabelSmallBold(parent=cpuContainer, align=uiconst.CENTERTOP, top=ICON_SIZE + 2, text=int(moduleCpuLoad))
Exemplo n.º 6
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.level = attributes.get('level', 0)
     self.data = attributes.get('data')
     self.eventListener = attributes.get('eventListener', None)
     self.parentEntry = attributes.get('parentEntry', None)
     self.settingsID = attributes.get('settingsID', self.default_settingsID)
     self.defaultExpanded = attributes.get('defaultExpanded', self.level < 1)
     self.childrenInitialized = False
     self.isToggling = False
     self.canAccess = True
     self.isSelected = False
     self.childSelectedBG = False
     self.icon = None
     self.childCont = None
     self.topRightCont = Container(name='topCont', parent=self, align=uiconst.TOTOP, height=self.default_height)
     self.topRightCont.GetDragData = self.GetDragData
     left = self.GetSpacerContWidth()
     if self.data.IsRemovable():
         removeBtn = Sprite(texturePath='res:/UI/Texture/icons/73_16_210.png', parent=self.topRightCont, align=uiconst.CENTERLEFT, width=16, height=16, left=left, hint=localization.GetByLabel('UI/Common/Buttons/Close'))
         left += 20
         removeBtn.OnClick = self.Remove
     icon = self.data.GetIcon()
     if icon:
         iconSize = self.height - 2
         self.icon = Icon(icon=icon, parent=self.topRightCont, pos=(left,
          0,
          iconSize,
          iconSize), align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED, ignoreSize=True)
         left += iconSize
     self.label = Label(parent=self.topRightCont, align=uiconst.CENTERLEFT, text=self.data.GetLabel(), left=left + 4)
     self.UpdateLabel()
     self.hoverBG = None
     self.selectedBG = None
     self.blinkBG = None
     if self.data.HasChildren():
         self.spacerCont = Container(name='spacerCont', parent=self.topRightCont, align=uiconst.TOLEFT, width=self.GetSpacerContWidth())
         self.toggleBtn = Container(name='toggleBtn', parent=self.spacerCont, align=uiconst.CENTERRIGHT, width=16, height=16, state=uiconst.UI_HIDDEN)
         self.toggleBtn.OnClick = self.OnToggleBtnClick
         self.toggleBtn.OnDblClick = lambda : None
         self.toggleBtnSprite = Sprite(bgParent=self.toggleBtn, texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png', rotation=pi / 2, padding=(4, 4, 5, 5))
         expandChildren = False
         if not self.data.IsForceCollapsed():
             toggleSettingsDict = settings.user.ui.Get('invTreeViewEntryToggle_%s' % self.settingsID, {})
             expandChildren = toggleSettingsDict.get(self.data.GetID(), self.defaultExpanded)
             self.ConstructChildren()
         else:
             self.toggleBtn.state = uiconst.UI_NORMAL
         self.ShowChildCont(expandChildren, animate=False)
     else:
         self.ShowChildCont(False, animate=False)
     if self.eventListener and hasattr(self.eventListener, 'RegisterID'):
         self.eventListener.RegisterID(self, self.data.GetID())
Exemplo n.º 7
0
 def ApplyAttributes(self, attributes):
     invCont._InvContBase.ApplyAttributes(self, attributes)
     ownerID = attributes.ownerID
     ownerName = cfg.eveowners.Get(ownerID).name
     self.topCont = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=65, idx=0)
     myImgCont = Sprite(parent=self.topCont, align=uiconst.TOLEFT, width=64, idx=0, texturePath='res:/UI/Texture/silhouette_64.png', left=2)
     sm.GetService('photo').GetPortrait(ownerID, 64, myImgCont)
     myImgCont.OnClick = (self.ShowCharInfo, ownerID)
     myImgCont.hint = ownerName
     ownerLink = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=ownerName, info=('showinfo', const.typeCharacterAmarr, ownerID))
     uicontrols.EveLabelMedium(text=ownerLink, parent=self.topCont, left=72, top=2, bold=True, state=uiconst.UI_NORMAL)
     self.acceptIcon = uicontrols.Icon(icon='ui_38_16_193', parent=self.topCont, left=67, top=14)
     uicls.InvContViewBtns(parent=self.topCont, align=uiconst.BOTTOMLEFT, left=72, controller=self)
     self.moneyLabel = uicontrols.EveLabelMedium(parent=self.topCont, left=6, top=-2, align=uiconst.BOTTOMRIGHT)
Exemplo n.º 8
0
 def LoadTooltipPanel(self, tooltipPanel, *args, **kwds):
     return
     if uicore.uilib.tooltipHandler.IsUnderTooltip(self):
         return
     achievementID = self.achievementTask.achievementID
     tooltipPanel.LoadGeneric2ColumnTemplate()
     if self.achievementTask.description:
         tooltipPanel.AddLabelMedium(text=self.achievementTask.description,
                                     colSpan=tooltipPanel.columns,
                                     wrapWidth=200)
     extraInfo = ACHIEVEMENT_TASK_EXTRAINFO.get(achievementID, None)
     if extraInfo:
         for taskInfoEntry in extraInfo:
             if isinstance(taskInfoEntry, TaskInfoEntry_Text):
                 tooltipPanel.AddLabelMedium(text=taskInfoEntry.text,
                                             color=taskInfoEntry.textColor,
                                             colSpan=tooltipPanel.columns,
                                             wrapWidth=200)
             elif isinstance(taskInfoEntry, TaskInfoEntry_ImageText):
                 texturePath = taskInfoEntry.GetTexturePath()
                 icon = Sprite(name='icon',
                               parent=tooltipPanel,
                               pos=(0, 0, taskInfoEntry.imageSize,
                                    taskInfoEntry.imageSize),
                               texturePath=texturePath,
                               state=uiconst.UI_DISABLED,
                               align=uiconst.CENTER,
                               color=taskInfoEntry.imageColor)
                 text = GetByLabel(taskInfoEntry.textPath)
                 label = EveLabelMedium(text=text,
                                        color=taskInfoEntry.textColor,
                                        width=180,
                                        align=uiconst.CENTERLEFT)
                 tooltipPanel.AddCell(label)
Exemplo n.º 9
0
 def LoadTooltipPanelNoStructure(self, tooltipPanel, *args):
     tooltipPanel.state = uiconst.UI_NORMAL
     tooltipPanel.columns = 2
     tooltipPanel.margin = 2
     tooltipPanel.cellPadding = 1
     texturePath = self.GetTexturePaths(self.structureInfo['typeID'], large=True)
     icon = Sprite(width=48, height=48, state=uiconst.UI_DISABLED, texturePath=texturePath, opacity=dashboardConst.NO_STRUCTURE_ALPHA)
     tooltipPanel.AddCell(icon)
     structureTypeID = self.structureInfo['typeID']
     if structureTypeID == const.typeTerritorialClaimUnit:
         headerText = GetByLabel('UI/Sovereignty/Unclaimed')
     else:
         headerText = GetByLabel('UI/Sovereignty/Uninstalled')
     if structureTypeID == const.typeOutpostConstructionPlatform:
         structureName = GetByLabel('UI/Common/LocationTypes/Station')
     else:
         structureName = evetypes.GetName(structureTypeID)
     tooltipPanel.AddLabelLarge(text=headerText, width=150, bold=True, align=uiconst.CENTERLEFT)
     l = LineThemeColored(width=200, height=1, align=uiconst.CENTER, opacity=0.3)
     tooltipPanel.AddCell(l, colSpan=2, cellPadding=(1, 1, 1, 3))
     deployText = GetByLabel('UI/Sovereignty/StructureMayBeDeployed', structureName=structureName)
     tooltipPanel.AddLabelMedium(text='<center>%s</center>' % deployText, align=uiconst.CENTER, width=190, colSpan=2)
     buttonGrid = LayoutGrid(columns=2, align=uiconst.CENTER, cellPadding=2)
     showInfoBtn = ShowInfoButton(parent=buttonGrid, typeID=structureTypeID)
     showMarketDetailsBtn = ShowMarketDetailsButton(parent=buttonGrid, typeID=structureTypeID)
     tooltipPanel.AddCell(cellObject=buttonGrid, colSpan=2, cellPadding=3)
Exemplo n.º 10
0
 def AddColumnJumps(self):
     jumps = self.node.jumps
     if jumps != sys.maxint:
         self.AddColumnText(jumps)
     else:
         col = self.AddColumnContainer()
         Sprite(name='infinityIcon', parent=col, align=uiconst.CENTERLEFT, pos=(6, 0, 11, 6), texturePath='res:/UI/Texture/Classes/Industry/infinity.png', opacity=Label.default_color[3])
Exemplo n.º 11
0
 def UpdateActiveState(self):
     currentActive, currentDirection = self.GetActiveColumnAndDirection()
     for each in self.headers:
         if each.columnID == currentActive:
             if not each.sortTriangle:
                 each.sortTriangle = Sprite(align=uiconst.CENTERRIGHT,
                                            pos=(3, -1, 16, 16),
                                            parent=each,
                                            name='directionIcon',
                                            idx=0)
             if currentDirection:
                 each.sortTriangle.texturePath = 'res:/UI/Texture/Icons/1_16_16.png'
             else:
                 each.sortTriangle.texturePath = 'res:/UI/Texture/Icons/1_16_15.png'
             each.sortTriangle.state = uiconst.UI_DISABLED
             rightMargin = 20
         else:
             if each.sortTriangle:
                 each.sortTriangle.Hide()
             rightMargin = 6
         each.label.width = each.width - each.label.left - 4
         if each.sortTriangle and each.sortTriangle.display:
             each.label.SetRightAlphaFade(
                 each.width - rightMargin - each.label.left,
                 uiconst.SCROLL_COLUMN_FADEWIDTH)
         else:
             each.label.SetRightAlphaFade()
         if each.width <= 32 or each.width - each.label.left - rightMargin - 6 < each.label.textwidth:
             each.hint = each.label.text
         else:
             each.hint = None
Exemplo n.º 12
0
class SquadronNumber(Container):
    default_width = 14
    default_height = 14
    default_align = uiconst.TOPLEFT

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.squadNrText = EveLabelSmall(parent=self, left=4, top=2)
        self.squadNrSprite = Sprite(
            parent=self,
            align=uiconst.TOPLEFT,
            texturePath=
            'res:/UI/Texture/classes/ShipUI/Fighters/squadNumberFlag.png',
            pos=(1, 1, 14, 14))

    def SetText(self, tubeFlagID):
        squadronNumber = SLOTNUMBER_BY_TUBEFLAG[tubeFlagID]
        self.squadNrText.text = squadronNumber

    def SetColor(self, isEmpty=False):
        if isEmpty or session.stationid2:
            self.squadNrSprite.color = (0.5, 0.5, 0.5, 0.5)
        else:
            self.squadNrSprite.color = COLOR_INSPACE
            self.squadNrSprite.SetAlpha(0.7)
Exemplo n.º 13
0
 def GetSprite(self):
     if self.sr.sprite is None:
         self.sr.sprite = Sprite(parent=self, state=uiconst.UI_PICKCHILDREN, filter=False, name='textSprite', idx=0)
         self.sr.sprite.OnCreate = self.OnCreate
         trinity.device.RegisterResource(self.sr.sprite)
         uicore.textObjects.add(self)
     return self.sr.sprite
Exemplo n.º 14
0
 def ConstructRecentUnlockBG(self):
     if not self.recentUnlockBG:
         if self.IsElite():
             color = COLOR_HOVER_MASTERED
         else:
             color = COLOR_HOVER_UNLOCKED
         self.recentUnlockBG = Sprite(name='recentUnlockBG', bgParent=self, texturePath='res:/UI/Texture/Classes/ShipTree/groups/bgVignette.png', color=color)
Exemplo n.º 15
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     size = self.width
     if self.width != self.height:
         log.LogTraceback(
             "ShipModuleReactivationTimer don't have width and height as the same value"
         )
     maskSize = round(size * 1.28)
     Sprite(parent=self,
            name='maskSprite',
            align=uiconst.CENTER,
            pos=(0, 0, maskSize, maskSize),
            texturePath=
            'res:/UI/Texture/classes/ShipUI/slotSolidBackground.png',
            color=(0, 0, 0, 1))
     gaugeRadius = self.height / 2 - 3
     self.gauge = DashedCircle(parent=self,
                               dashCount=18,
                               dashSizeFactor=4.0,
                               range=math.pi * 2,
                               lineWidth=6,
                               radius=gaugeRadius,
                               startAngle=math.pi / 2,
                               startColor=(1, 1, 1, 0.3),
                               endColor=(1, 1, 1, 0.3))
     self.endTime = None
Exemplo n.º 16
0
 def AnimFlash(self, color):
     width = 500
     flashCont = Container(parent=self,
                           idx=0,
                           align=uiconst.TOPLEFT,
                           width=width,
                           height=self.height)
     flashGradient = GradientSprite(bgParent=flashCont,
                                    rgbData=[(0, color[:3])],
                                    alphaData=[(0, 0.0), (0.9, 0.4),
                                               (1.0, 0.0)])
     arrows = Sprite(
         parent=flashCont,
         align=uiconst.CENTERLEFT,
         texturePath='res:/UI/Texture/Classes/Industry/CenterBar/arrows.png',
         pos=(0, 0, 375, self.height),
         color=color,
         opacity=0.15,
         tileX=True)
     duration = self.width / 600.0
     uicore.animations.MorphScalar(flashCont,
                                   'left',
                                   -width,
                                   self.width + width,
                                   duration=duration,
                                   curveType=uiconst.ANIM_LINEAR)
     uicore.animations.FadeTo(flashCont,
                              0.0,
                              1.0,
                              duration=duration,
                              callback=flashCont.Close,
                              curveType=uiconst.ANIM_WAVE)
Exemplo n.º 17
0
    def LoadPanel(self, initialLoad=False):
        self.Flush()
        self.ResetStatsDicts()
        self.display = True
        parentGrid = self.GetValueParentGrid()
        iconSize = 32
        for configName, texturePath in self.droneStats:
            valueCont = self.GetValueCont(iconSize)
            parentGrid.AddCell(cellObject=valueCont)
            icon = Sprite(texturePath=texturePath,
                          parent=valueCont,
                          align=uiconst.CENTERLEFT,
                          pos=(0, 0, iconSize, iconSize),
                          state=uiconst.UI_DISABLED)
            valueCont.hint = configName
            label = EveLabelMedium(text='',
                                   parent=valueCont,
                                   left=0,
                                   state=uiconst.UI_DISABLED,
                                   align=uiconst.CENTERLEFT)
            self.statsLabelsByIdentifier[configName] = label
            self.statsIconsByIdentifier[configName] = icon
            self.statsContsByIdentifier[configName] = valueCont

        BaseMenuPanel.FinalizePanelLoading(self, initialLoad)
Exemplo n.º 18
0
 def AddColumnBlueprintLabel(self):
     col = self.AddColumnContainer()
     texturePath, hint = uix.GetTechLevelIconPathAndHint(
         self.bpData.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.bpData.blueprintTypeID,
              isCopy=not self.bpData.original,
              ignoreSize=True,
              align=uiconst.CENTERLEFT,
              state=uiconst.UI_DISABLED,
              width=iconSize,
              height=iconSize,
              left=2)
     else:
         iconSize = 0
     Label(parent=col,
           text=self.bpData.GetLabel(),
           align=uiconst.CENTERLEFT,
           left=iconSize + 4,
           idx=0)
Exemplo n.º 19
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.jobData = attributes.jobData
     self.skills = []
     self.skillIcon = Sprite(name='skillIcon',
                             parent=self,
                             align=uiconst.CENTER,
                             state=uiconst.UI_DISABLED,
                             pos=(0, -1, 33, 33))
     self.patternSprite = Sprite(
         name='patternSprite',
         bgParent=self,
         texturePath=
         'res:/UI/Texture/classes/Industry/Center/skillFramePattern.png')
     FillThemeColored(bgParent=self, padding=3)
     self.UpdateState()
Exemplo n.º 20
0
 def ExpandMenu(self, *args):
     if self.destroyed:
         return
     if self.IsExpanded():
         self.CloseMenu()
         return
     background = self.AccessBackground()
     icon = self.AccessIcon()
     l, t, w, h = background.GetAbsolute()
     buttonCopy = Container(parent=uicore.layer.utilmenu, align=uiconst.TOPLEFT, pos=(l,
      t,
      self.GetFullWidth(),
      h), state=uiconst.UI_NORMAL, idx=0)
     buttonCopy.OnMouseDown = self.CloseMenu
     if self._label is not None:
         label = EveLabelMedium(parent=buttonCopy, text=self._label.text, align=self._label.align, bold=True, left=self._label.left)
     Sprite(parent=buttonCopy, texturePath=self.closeTexturePath, state=uiconst.UI_DISABLED, align=icon.align, width=icon.width, height=icon.height, left=icon.left)
     topOrBottomLine = LineThemeColored(parent=buttonCopy, align=uiconst.TOTOP, opacity=OPACITY_LINES)
     if self.menuAlign in (uiconst.BOTTOMLEFT, uiconst.BOTTOMRIGHT):
         topOrBottomLine.align = uiconst.TOBOTTOM
     LineThemeColored(parent=buttonCopy, align=uiconst.TOLEFT, opacity=OPACITY_LINES)
     LineThemeColored(parent=buttonCopy, align=uiconst.TORIGHT, opacity=OPACITY_LINES)
     FillThemeColored(bgParent=buttonCopy, opacity=OPACITY_BG)
     menuParent = ExpandedUtilMenu(parent=uicore.layer.utilmenu, controller=self, GetUtilMenu=self._getMenuFunction, minWidth=self.GetFullWidth() + 16, idx=1, menuAlign=self.menuAlign)
     self._menu = weakref.ref(menuParent)
     self._menuButton = weakref.ref(buttonCopy)
     uicore.animations.MorphScalar(buttonCopy, 'opacity', startVal=0.5, endVal=1.0, duration=0.2)
     uthread.new(uicore.registry.SetFocus, menuParent)
Exemplo n.º 21
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.target = attributes.target
     self.arrow = Sprite(parent=self,
                         align=uiconst.TOALL,
                         state=uiconst.UI_DISABLED,
                         texturePath='res:/UI/Texture/Icons/105_32_21.png')
Exemplo n.º 22
0
    def LoadPanel(self, initialLoad=False):
        self.Flush()
        self.ResetStatsDicts()
        self.display = True
        parentGrid = self.GetValueParentGrid(columns=len(self.damageStats))
        for dps, texturePath, hintPath, tooltipName in self.damageStats:
            hint = GetByLabel(hintPath)
            c = self.GetValueCont(self.iconSize)
            parentGrid.AddCell(cellObject=c)
            icon = Sprite(texturePath=texturePath,
                          parent=c,
                          align=uiconst.CENTERLEFT,
                          pos=(0, 0, self.iconSize, self.iconSize),
                          state=uiconst.UI_DISABLED)
            SetFittingTooltipInfo(targetObject=c, tooltipName=tooltipName)
            c.hint = hint
            label = EveLabelMedium(text='',
                                   parent=c,
                                   state=uiconst.UI_DISABLED,
                                   align=uiconst.CENTERLEFT)
            self.statsLabelsByIdentifier[dps] = label
            self.statsIconsByIdentifier[dps] = icon
            self.statsContsByIdentifier[dps] = c

        BaseMenuPanel.FinalizePanelLoading(self, initialLoad)
Exemplo n.º 23
0
 def Layout(self):
     self.frame = Frame(
         bgParent=self,
         texturePath=
         'res:/UI/Texture/Classes/Industry/CenterBar/buttonBg.png',
         cornerSize=5,
         color=Color.GRAY2)
     self.arrows = Sprite(
         bgParent=self,
         texturePath=
         'res:/UI/Texture/Classes/Industry/CenterBar/arrowMask.png',
         textureSecondaryPath=
         'res:/UI/Texture/Classes/Industry/CenterBar/arrows.png',
         translationSecondary=(-0.16, 0),
         spriteEffect=trinity.TR2_SFX_MODULATE,
         color=Color.GRAY2,
         opacity=0.2)
     animations.MorphVector2(self.arrows,
                             'translationSecondary',
                             startVal=(0.16, 0.0),
                             endVal=(-0.16, 0.0),
                             duration=2.0,
                             curveType=uiconst.ANIM_LINEAR,
                             loops=uiconst.ANIM_REPEAT)
     self.label = CaptionLabel(
         parent=self,
         align=uiconst.CENTER,
         text=localization.GetByLabel('UI/SkillTrading/Extract'))
     self.spinner = LoadingWheel(parent=self,
                                 align=uiconst.CENTER,
                                 state=uiconst.UI_DISABLED,
                                 width=30,
                                 height=30,
                                 opacity=0.0)
Exemplo n.º 24
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.radius = attributes.Get('radius', self.default_radius)
     self.lineWidth = attributes.Get('lineWidth', self.default_lineWidth)
     self.startAngle = attributes.Get('startAngle', self.default_startAngle)
     self.value = attributes.Get('value', self.default_value)
     self.colorStart = attributes.Get('colorStart', self.default_colorStart)
     self.colorEnd = attributes.Get('colorEnd', self.default_colorEnd)
     self.colorBg = attributes.Get('colorBg', self.default_colorBg)
     colorMarker = attributes.Get('colorMarker', self.default_colorMarker)
     self.callback = attributes.Get('callback', self.default_callback)
     self.isHoverMarkerEnabled = attributes.Get('hoverMarkerEnabled', self.default_hoverMarkerEnabled)
     if colorMarker is None:
         colorMarker = self.colorStart
     self.width = self.height = self.radius * 2 + self.lineWidth
     self.pickRadius = self.radius + self.lineWidth
     self._angle = 0.0
     hoverMarkerSize = self.lineWidth * 1.7
     self.hoverMarker = Sprite(name='hoverMarker', parent=self, color=colorMarker, width=hoverMarkerSize, height=hoverMarkerSize, state=uiconst.UI_DISABLED, opacity=0.0, texturePath='res:/UI/Texture/Classes/Gauge/circle.png')
     self.markerTransform = Transform(name='markerTransform', parent=self, align=uiconst.TOALL, rotationCenter=(0.5, 0.5), rotation=-self.startAngle - pi / 2)
     height = self.lineWidth + 5
     self.marker = Fill(name='marker', parent=self.markerTransform, color=colorMarker, align=uiconst.CENTERTOP, pos=(0,
      -(height - self.lineWidth),
      2,
      height))
     self.gauge = None
     self.bgGauge = None
     self.Reconstruct()
     uthread.new(self.UpdateThread)
Exemplo n.º 25
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     Sprite(
         parent=self,
         align=uiconst.TOLEFT,
         width=126,
         texturePath='res:/UI/Texture/classes/shipTree/frame/topLeft.png')
     cont = ContainerAutoSize(
         parent=self,
         align=uiconst.TOLEFT,
         alignMode=uiconst.TOPLEFT,
         bgTexturePath='res:/UI/Texture/classes/shipTree/frame/topMiddle.png'
     )
     Label(parent=cont,
           text=GetByLabel('UI/ShipTree/InterbusShipIdentificationSystem'),
           color=COLOR_BG,
           top=3,
           fontsize=12,
           uppercase=True,
           bold=True,
           padRight=4)
     StretchSpriteHorizontal(
         parent=Container(parent=self),
         align=uiconst.TOTOP,
         texturePath='res:/UI/Texture/classes/ShipTree/frame/topRight.png',
         leftEdgeSize=40,
         rightEdgeSize=5,
         height=26)
Exemplo n.º 26
0
class ExtraInfoEntry(Container):
    default_padLeft = 30
    default_padRight = 30
    default_padTop = 6

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        info = attributes.info
        self.icon = Sprite(name='arrow',
                           parent=self,
                           pos=(0, 0, info['size'], info['size']),
                           texturePath=info['path'],
                           state=uiconst.UI_DISABLED,
                           align=uiconst.TOPLEFT)
        self.text = EveLabelSmall(name='tipsHeader',
                                  text=info['text'],
                                  parent=self,
                                  left=info['size'] + 2,
                                  top=1,
                                  align=uiconst.TOPLEFT)
        iconColor = info.get('color', None)
        if iconColor:
            self.icon.SetRGB(*iconColor)

    def UpdateAlignment(self, *args, **kwds):
        retVal = Container.UpdateAlignment(self, *args, **kwds)
        if getattr(self, 'icon', None) and getattr(self, 'text', None):
            newHeight = max(self.icon.height + 2 * self.icon.top,
                            self.text.textheight + 2 * self.text.padTop)
            self.height = newHeight
        return retVal
Exemplo n.º 27
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     grid = LayoutGrid(parent=self, columns=2)
     self.auraSprite = Sprite(pos=(14, 0, 80, 80), texturePath='res:/UI/Texture/classes/achievements/auraAlpha.png')
     grid.AddCell(self.auraSprite, rowSpan=2)
     header = EveLabelLarge(parent=grid, text='Welcome!', top=16)
     message = EveLabelMedium(parent=grid, text='Welcome blurb', width=300)
Exemplo n.º 28
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)
 def ApplyAttributes(self, attributes):
     LayoutGridRow.ApplyAttributes(self, attributes)
     self.markerObject = attributes.markerObject
     self.icon = Sprite(pos=(0, 0, 16, 16),
                        texturePath=self.markerObject.texturePath,
                        state=uiconst.UI_DISABLED)
     self.AddCell(cellObject=self.icon, cellPadding=(3, 1, 4, 1))
     self.highLight = Fill(bgParent=self,
                           color=(1, 1, 1, 0.1),
                           state=uiconst.UI_HIDDEN)
     if self.markerObject.celestialData:
         labelText = cfg.evelocations.Get(
             self.markerObject.celestialData.itemID).name
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         infoIcon = InfoIcon(size=14,
                             align=uiconst.CENTERRIGHT,
                             itemID=self.markerObject.celestialData.itemID,
                             typeID=self.markerObject.celestialData.typeID)
         self.AddCell(cellObject=infoIcon, cellPadding=(0, 1, 1, 1))
     else:
         labelText = self.markerObject.hintString
         label = EveLabelSmall(text=labelText,
                               align=uiconst.CENTERLEFT,
                               width=150,
                               autoFitToText=True)
         self.AddCell(cellObject=label, cellPadding=(0, 1, 6, 1))
         self.FillRow()
Exemplo n.º 30
0
 def ApplyAttributes(self, attributes):
     FittingSlotBase.ApplyAttributes(self, attributes)
     self.flagIcon = uicontrols.Icon(parent=self,
                                     name='flagIcon',
                                     align=uiconst.CENTER,
                                     state=uiconst.UI_DISABLED,
                                     width=self.width,
                                     height=self.height)
     self.sr.underlay = Sprite(
         bgParent=self,
         name='underlay',
         state=uiconst.UI_DISABLED,
         padding=(-10, -5, -10, -5),
         texturePath='res:/UI/Texture/Icons/81_64_1.png')
     self.dontHaveLine = None
     self.moduleSlotFill = None
     self.skillSprite = None
     self.groupMark = None
     self.chargeIndicator = None
     sm.RegisterNotify(self)
     self.radCosSin = attributes.radCosSin
     self.invReady = 1
     self.UpdateFitting()
     self.controller.on_simulation_mode_changed.connect(
         self.UpdateSimulationMode)
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.MakeUnMinimizable()
     self.MakeUnpinable()
     self.MakeUnstackable()
     mainArea = self.GetMainArea()
     mainArea.clipChildren = True
     leftSide = Container(parent=mainArea,
                          align=uiconst.TOLEFT,
                          width=AURA_SIZE * 0.8)
     auraSprite = Sprite(
         parent=leftSide,
         texturePath='res:/UI/Texture/classes/achievements/auraAlpha.png',
         pos=(0, -4, AURA_SIZE, AURA_SIZE),
         align=uiconst.CENTERTOP)
     self.mainContent = ContainerAutoSize(parent=self.GetMainArea(),
                                          align=uiconst.TOTOP,
                                          alignMode=uiconst.TOTOP,
                                          padding=(0, 6, 10, 10))
     self.sizeTimer = AutoTimer(10, self.UpdateWindowSize)
     if not settings.char.ui.Get('opportunities_aura_introduced', False):
         settings.char.ui.Set('opportunities_aura_introduced', True)
         self.Step_Intro()
     elif attributes.loadAchievementTask:
         self.Step_TaskInfo_Manual(attributes.loadAchievementTask,
                                   attributes.loadAchievementGroup)
     else:
         self.UpdateOpportunityState()
Exemplo n.º 32
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.controller = attributes.controller
     self.wantedspeed = None
     self.speedTimer = None
     self.speedInited = 0
     self.speedCircularPickParent = Container(
         name='speedCircularPickParent',
         parent=self,
         align=uiconst.CENTERBOTTOM,
         pos=(0, 0, 144, 144),
         pickRadius=72)
     self.speedGaugeParent = Container(parent=self.speedCircularPickParent,
                                       name='speedGaugeParent',
                                       pos=(0, 0, 124, 36),
                                       align=uiconst.CENTERBOTTOM,
                                       state=uiconst.UI_DISABLED,
                                       clipChildren=True)
     self.speedLabel = EveLabelSmall(name='speedLabel',
                                     parent=self.speedGaugeParent,
                                     color=Color.BLACK,
                                     align=uiconst.CENTER)
     Sprite(parent=self.speedCircularPickParent,
            name='speedoUnderlay',
            pos=(0, 48, 104, 44),
            align=uiconst.CENTER,
            state=uiconst.UI_DISABLED,
            texturePath='res:/UI/Texture/classes/ShipUI/speedoUnderlay.png')
     self.speedNeedle = Transform(parent=self.speedGaugeParent,
                                  name='speedNeedle',
                                  pos=(-5, -38, 134, 12),
                                  align=uiconst.TOPLEFT,
                                  state=uiconst.UI_PICKCHILDREN,
                                  rotationCenter=(0.5, 0.5))
     Sprite(
         parent=self.speedNeedle,
         name='needle',
         pos=(0, 0, 24, 12),
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/ShipUI/heatGaugeNeedle.png')
     Sprite(parent=self.speedNeedle,
            name='speedGaugeSprite',
            texturePath='res:/UI/Texture/classes/ShipUI/speedoOverlay.png',
            pos=(-8, -73, 79, 79),
            state=uiconst.UI_DISABLED)
     self.speedTimer = uthread.new(self.UpdateSpeedThread)
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.bgSprite = Sprite(parent=self,
                            texturePath=self.backgroundGradient,
                            align=uiconst.TOALL)
     self.achievement = attributes.achievement
     self.checkbox = Sprite(parent=self,
                            texturePath=self.uncheckedTexturePath,
                            pos=(4, 4, 14, 14))
     self.achievementText = EveLabelMedium(name='achievementText',
                                           text=self.achievement.name,
                                           parent=self,
                                           padLeft=2 * self.checkbox.left +
                                           self.checkbox.width,
                                           align=uiconst.TOTOP,
                                           padTop=4)
     self.SetCompletedStates(self.achievement.completed)
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.isOpen = True
     headerText = attributes.headerText
     self.toggleFunc = attributes.toggleFunc
     self.arrowSprite = Sprite(
         name='arrow',
         parent=self,
         pos=(0, 0, 16, 16),
         texturePath='res:/UI/Texture/Icons/38_16_229.png',
         state=uiconst.UI_DISABLED,
         align=uiconst.CENTERLEFT)
     self.tipsHeader = EveLabelMediumBold(name='tipsHeader',
                                          text=headerText,
                                          parent=self,
                                          left=16,
                                          align=uiconst.CENTERLEFT)
Exemplo n.º 35
0
 def ApplyAttributes(self, attributes):
     Button.ApplyAttributes(self, attributes)
     self.isStopPending = False
     self.isArrowsAnimating = False
     self.sr.label.uppercase = True
     self.sr.label.fontsize = 13
     self.sr.label.bold = True
     self.pattern = Sprite(name='bgGradient', bgParent=self, texturePath='res:/UI/Texture/Classes/Industry/CenterBar/buttonPattern.png', color=Color.GRAY2, idx=0)
     self.bg = Sprite(name='bg', bgParent=self, opacity=0.0, texturePath='res:/UI/Texture/Classes/Industry/CenterBar/buttonBg.png', color=Color.GRAY2, idx=0, state=uiconst.UI_HIDDEN)
     self.arrows = Sprite(bgParent=self, texturePath='res:/UI/Texture/Classes/Industry/CenterBar/arrowMask.png', textureSecondaryPath='res:/UI/Texture/Classes/Industry/CenterBar/arrows.png', spriteEffect=trinity.TR2_SFX_MODULATE, color=Color.GRAY2, idx=0)
     self.arrows.translationSecondary = (-0.16, 0)
     self.errorFrame = ErrorFrame(bgParent=self)
     self.errorFrame.Hide()
     color = attributes.color
     if color is None:
         color = sm.GetService('uiColor').GetUIColor(uiconst.COLORTYPE_UIHILIGHT)
     self.SetColor(color)
 def ConstructBgBlinkFill(self):
     if self.node.IsLocked():
         color = COLOR_HOVER_LOCKED
     else:
         color = COLOR_HOVER_UNLOCKED
     if not self.bgBlinkFill:
         self.bgBlinkFill = Sprite(
             name='bgFillBlink',
             bgParent=self,
             texturePath=
             'res:/UI/Texture/Classes/ShipTree/groups/bgVignette.png',
             idx=0,
             color=color,
             opacity=0.0)
     else:
         self.bgBlinkFill.SetRGBA(color[0], color[1], color[2],
                                  self.bgBlinkFill.opacity)
Exemplo n.º 37
0
 def ConstructPriceAmountWarning(self):
     if self.priceAmountWarning:
         return None
     cont = Container(name='priceAmountWarning',
                      parent=self.itemCont,
                      align=uiconst.TORIGHT,
                      left=-4,
                      width=16,
                      idx=0)
     self.priceAmountWarning = Sprite(
         parent=cont,
         pos=(0, 0, 16, 16),
         align=uiconst.CENTER,
         texturePath='res:/ui/texture/icons/44_32_7.png')
     self.priceAmountWarning.SetRGB(1.0, 0.3, 0.3, 0.8)
     self.priceAmountWarning.info = (None, None)
     self.priceAmountWarning.GetHint = self.GetWarningHint
Exemplo n.º 38
0
 def Load(self, node):
     self.CheckDestroyed()
     if self.loaded:
         return
     self.loaded = True
     if isinstance(node.uiObject, (Base,)):
         self._label.text = node.uiObject.name or node.uiObject.__class__
         if node.objectLabel:
             self._label.text = '%s: %s' % (node.objectLabel, self._label.text)
     else:
         self._label.italic = True
         if node.objectLabel:
             self._label.text = node.objectLabel
         elif getattr(node.uiObject, 'name', None):
             self._label.text = '%s (%s)' % (node.uiObject.name, node.uiObject.__typename__)
         else:
             self._label.text = node.uiObject.__typename__
         self._label.color = (1.0, 1.0, 1.0, 0.5)
     self._label.left = INDENTSIZE * node.level + 20
     if hasattr(node.uiObject, 'Reload') or 'Reload' in getattr(node.uiObject, '__methods__', []):
         reloadIcon = Sprite(texturePath=RESROOT + 'tinyReload.png', pos=(3, 0, 16, 16), parent=self, align=uiconst.CENTERRIGHT, idx=0)
         reloadIcon.OnClick = self.ReloadUIObject
     if node.isExpandable:
         if node.isExpanded:
             self._expandIcon.texturePath = RESROOT + 'containerExpanded_down.png'
         else:
             self._expandIcon.texturePath = RESROOT + 'containerCollapsed.png'
     else:
         self._expandIcon.texturePath = RESROOT + 'nonContainer.png'
         self._expandIcon.state = uiconst.UI_DISABLED
     self._expandIcon.left = INDENTSIZE * node.level
     nextNode = node.scroll.GetNode(node.idx + 1)
     if node.connectLevels is not None:
         for i, connectLevel in enumerate(node.connectLevels):
             if connectLevel == node.level:
                 if not nextNode or connectLevel not in nextNode.connectLevels:
                     texturePath = RESROOT + 'connectionL.png'
                 else:
                     texturePath = RESROOT + 'connectionT.png'
             else:
                 texturePath = RESROOT + 'connectionI.png'
             Sprite(parent=self, texturePath=texturePath, align=uiconst.CENTERLEFT, pos=((connectLevel - 1) * INDENTSIZE,
              0,
              INDENTSIZE,
              INDENTSIZE))
Exemplo n.º 39
0
    def AddBackground(self, where, s):
        for i, side in enumerate(['top',
         'left',
         'right',
         'bottom']):
            if s['border-%s-width' % side]:
                align = [uiconst.TOTOP,
                 uiconst.TOLEFT,
                 uiconst.TORIGHT,
                 uiconst.TOBOTTOM][i]
                Line(parent=where, align=align, weight=s['border-%s-width' % side], color=s['border-%s-color' % side], idx=0)

        if s['background-image'] and where.sr.background:
            browser = GetBrowser(self)
            currentURL = None
            if browser:
                currentURL = browser.sr.currentURL
            texture, tWidth, tHeight = sm.GetService('browserImage').GetTextureFromURL(s['background-image'], currentURL, fromWhere='VirtualTable::AddBackground')
            pic = Sprite()
            pic.left = pic.top = 0
            pic.width = tWidth
            pic.height = tHeight
            pic.texture = texture
            row = Container(name='row', align=uiconst.TOTOP, pos=(0,
             0,
             0,
             tHeight), clipChildren=1)
            if s['background-repeat'] in ('repeat', 'repeat-x'):
                for x in xrange(max(where.width / tWidth, 2) + 1):
                    row.children.append(pic.CopyTo())
                    pic.left += pic.width

            else:
                row.children.append(pic.CopyTo())
            if s['background-repeat'] in ('repeat', 'repeat-y'):
                for y in xrange(max(where.height / tHeight, 2) + 1):
                    row.height = min(where.height - tHeight * y, row.height)
                    where.sr.background.children.append(row.CopyTo())

            else:
                where.sr.background.children.append(row.CopyTo())
        if s['background-color']:
            Fill(parent=where, color=s['background-color'])
Exemplo n.º 40
0
    def AddUndockButton(self, parent):
        scale = 1.0
        self.undockCont = Container(name='undockCont', align=uiconst.TORIGHT_PROP, width=0.5, parent=parent, state=uiconst.UI_PICKCHILDREN, padding=3)
        width = 63 * scale
        height = 34 * scale
        self.undockSpriteCont = Container(name='undock', align=uiconst.CENTERTOP, width=width, height=height, top=3, parent=self.undockCont, state=uiconst.UI_NORMAL)
        self.undockSprites = []
        spacing = 30 * scale
        for i in xrange(3):
            s = Sprite(parent=self.undockSpriteCont, texturePath='res:/UI/Texture/classes/Lobby/{0}.png'.format(i + 1), align=uiconst.CENTERTOP, width=width, height=height, left=0, state=uiconst.UI_DISABLED)
            s.color = COLOR_UNDOCK
            self.undockSprites.append(s)

        self.undockLabel = EveLabelMedium(parent=self.undockCont, align=uiconst.CENTERTOP, top=8 + height, width=100)
        self.UpdateUndockButton()
        self.undockCont.height = self.undockLabel.height + height + 6
        self.undockSpriteCont.OnClick = self.OnUndockClicked
        self.undockSpriteCont.OnMouseEnter = self.OnUndockMouseEnter
        self.undockSpriteCont.OnMouseExit = self.OnUndockMouseExit
        if self.undock_button_is_locked:
            self._DisableUndockButton()
Exemplo n.º 41
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.SetTopparentHeight(0)
     self.bountyEscrow = attributes.bountyEscrow
     self.bountyAmount = attributes.bountyAmount
     self.component = attributes.component
     factionResPath = FACTIONPATHBYESSTYPEID[attributes.ESSTypeID]
     navyID = CORPIDBYFACTIONID[attributes.ESSTypeID]
     self.SetCaption(GetByLabel(CAPTIONBYESSTYPEID[attributes.ESSTypeID]))
     self.myContribution = 0
     self.amountInTags = 0
     mainCont = Container(name='mainCont', parent=self.sr.main, padding=const.defaultPadding)
     iconCont = Container(name='iconCont', parent=mainCont, align=uiconst.TOTOP, height=64)
     headerCont = Container(name='headerCont', parent=mainCont, align=uiconst.TOTOP, height=54, padBottom=6)
     buttonsCont = Container(name='buttonsCont', parent=mainCont, align=uiconst.TOBOTTOM, height=80, padTop=4, padBottom=4)
     listCont = Container(name='listCont', parent=mainCont, align=uiconst.TOALL, padBottom=14)
     factionLogo = Sprite(parent=iconCont, align=uiconst.CENTERTOP, width=64, height=64, texturePath=factionResPath)
     factionLogo.hint = cfg.eveowners.Get(navyID).name
     factionLogo.OnClick = (self.OpenNavyInfo, navyID)
     EveLabelLarge(text=GetByLabel('UI/Inflight/Brackets/TotalBounty'), parent=headerCont, maxLines=1, align=uiconst.CENTERTOP)
     EveCaptionMedium(text=FmtISK(self.bountyAmount, 0), parent=headerCont, maxLines=1, align=uiconst.CENTERTOP, state=uiconst.UI_NORMAL, top=16)
     contributorsCont = Container(name='contributorsCont', parent=listCont, align=uiconst.TOLEFT_PROP, width=0.45)
     self.tagsCont = Container(name='tagsCont', parent=listCont, align=uiconst.TORIGHT_PROP, width=0.45)
     topSpaceCont = Container(name='topSpaceCont', parent=listCont, align=uiconst.TOALL)
     self.contributersList = ScrollContainer(name='contributersList', parent=contributorsCont, align=uiconst.TOALL)
     shareCont = Container(name='shareCont', parent=buttonsCont, align=uiconst.TOLEFT_PROP, width=0.45)
     takeCont = Container(name='takeCont', parent=buttonsCont, align=uiconst.TORIGHT_PROP, width=0.45)
     spaceCont = Container(name='spaceCont', parent=buttonsCont, align=uiconst.TOALL)
     youGetLabel = EveLabelMedium(text=GetByLabel('UI/Inflight/Brackets/YouGet'), parent=shareCont, align=uiconst.CENTERTOP, top=1)
     myContribLabel = EveLabelLargeBold(text='', parent=shareCont, align=uiconst.CENTERTOP, top=16)
     shareLabel = EveLabelSmall(text=GetByLabel('UI/Inflight/Brackets/EveryoneGetsTheirShare'), parent=shareCont, align=uiconst.CENTERBOTTOM)
     shareBtn = Button(parent=shareCont, label=GetByLabel('UI/Inflight/Brackets/Share'), align=uiconst.TOBOTTOM, top=20, func=self.ShareContribution)
     orLabel = EveLabelLargeBold(text=GetByLabel('UI/Inflight/Brackets/Or'), parent=spaceCont, align=uiconst.CENTER, top=10)
     amountInTagsLabel = EveLabelLarge(text=GetByLabel('UI/Inflight/Brackets/AmountInTags', amount=FmtISK(0, 0)), parent=takeCont, align=uiconst.CENTERTOP, top=16)
     takeLabel = EveLabelSmall(text=GetByLabel('UI/Inflight/Brackets/OthersGetNothing'), parent=takeCont, align=uiconst.CENTERBOTTOM)
     takeAllBtn = Button(parent=takeCont, label=GetByLabel('UI/Inflight/Brackets/TakeAll'), align=uiconst.TOBOTTOM, top=20, func=self.TakeAll)
     self.LoadContributions(attributes.contributions)
     myContribLabel.SetText(FmtISK(self.myContribution, 0))
     self.LoadTags()
     amountInTagsLabel.SetText(GetByLabel('UI/Inflight/Brackets/AmountInTags', amount=FmtISK(self.amountInTags, 0)))
    def ShowBackgroundGrid(self):
        if not self.width or not self.height:
            return
        self.gridBackground.Flush()
        hexRow = 0
        i = 0
        while True:
            hexColumn = 0
            while True:
                centerX, centerY = hex_slot_center_position(hexColumn, hexRow, BACKGROUND_SLOT_SIZE * self.localScale * 0.5)
                slotSize = BACKGROUND_SLOT_SIZE * self.localScale
                left = centerX - slotSize / 2
                top = centerY - slotSize / 2
                if left > self.width:
                    break
                hexSlot = Sprite(parent=self.gridBackground, left=left, top=top, width=slotSize, height=slotSize, texturePath='res:/UI/Texture/classes/Achievements/hexBack.png', opacity=0.04, state=uiconst.UI_DISABLED)
                hexSlot.hexGridPosition = (hexColumn, hexRow)
                hexColumn += 1

            hexRow += 1
            if top > self.height:
                break
Exemplo n.º 43
0
    def AddCQButton(self, parent):
        scale = 1.0
        self.cqCont = Container(name='cqCont', align=uiconst.TOLEFT_PROP, width=0.5, parent=parent, state=uiconst.UI_PICKCHILDREN, padding=3)
        width = 63 * scale
        height = 34 * scale
        self.cqSpriteCont = Container(name='cq', align=uiconst.CENTERTOP, width=width, height=height, top=3, parent=self.cqCont, state=uiconst.UI_NORMAL)
        self.cqSprites = []
        spacing = 30 * scale
        for i in xrange(3):
            s = Sprite(parent=self.cqSpriteCont, texturePath='res:/UI/Texture/classes/Lobby/{0}.png'.format(i + 1), align=uiconst.CENTERTOP, width=-width, height=height, left=0, state=uiconst.UI_DISABLED)
            s.color = COLOR_CQ
            self.cqSprites.insert(0, s)

        self.cqLabel = EveLabelMedium(parent=self.cqCont, align=uiconst.CENTERTOP, top=8 + height, width=100)
        self.UpdateCQButton()
        if gfxsettings.Get(gfxsettings.MISC_LOAD_STATION_ENV):
            self.cqSpriteCont.OnClick = self.OnCQClicked
            self.cqSpriteCont.OnMouseEnter = self.OnCQMouseEnter
            self.cqSpriteCont.OnMouseExit = self.OnCQMouseExit
        else:
            self.cqSpriteCont.hint = localization.GetByLabel('UI/Station/CannotEnterCaptainsQuarters')
            for s in self.cqSprites:
                s.opacity = 0.2
Exemplo n.º 44
0
 def LoadImage(self, *args):
     if not getattr(self, 'attrs', None):
         return
     browserImageSvc = sm.GetServiceIfRunning('browserImage')
     if not browserImageSvc:
         return
     texture, tWidth, tHeight = browserImageSvc.GetTextureFromURL(getattr(self.attrs, 'src', ''), getattr(self.attrs, 'currentURL', ''), fromWhere='Img::Load')
     if texture:
         sprite = Sprite(parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0))
         sprite.rectWidth = tWidth
         sprite.rectHeight = tHeight
         sprite.rectTop = 0
         sprite.rectLeft = 0
         sprite.texture = texture
         sprite.state = uiconst.UI_DISABLED
 def GetRoleSprite(self, name, texturePath, hintLabel):
     roleSprite = Sprite(name=name, texturePath=texturePath, width=16, height=16, align=uiconst.CENTER, opacity=0.6)
     roleSprite.hint = hintLabel
     return roleSprite