Пример #1
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     leftCont = uicls.Container(name='leftCont', parent=self, align=uiconst.TOLEFT_PROP, width=SIDE_WIDTH)
     self.friendIcon = uicls.LogoIcon(name='friendIcon', parent=leftCont, align=uiconst.CENTER, width=32, height=32, top=-20, ignoreSize=True)
     rightCont = uicls.Container(name='leftCont', parent=self, align=uiconst.TORIGHT_PROP, width=SIDE_WIDTH)
     self.foeIcon = uicls.LogoIcon(name='foeIcon', parent=rightCont, align=uiconst.CENTER, width=32, height=32, top=20, ignoreSize=True)
     self.topCont = uicls.Container(name='topCont', parent=self, align=uiconst.TOTOP_PROP, height=0.4)
     self.bottomCont = uicls.Container(name='bottomCont', parent=self, align=uiconst.TOBOTTOM_PROP, height=0.4)
     self.centerCont = uicls.Container(name='centerCont', parent=self, bgColor=facwarCommon.COLOR_CENTER_BG, padding=2)
     w, h = self.centerCont.GetAbsoluteSize()
     spWidth = 134 / 16.0 * h
     self.friendBar = uicls.Container(parent=self.centerCont, align=uiconst.TOLEFT_PROP, state=uiconst.UI_NORMAL, bgColor=facwarCommon.COLOR_FRIEND_BAR, clipChildren=True)
     self.friendBarSprite = uicls.Sprite(parent=self.friendBar, state=uiconst.UI_HIDDEN, texturePath='res:/ui/texture/classes/InfluenceBar/influenceBarPositive.png', color=facwarCommon.COLOR_FRIEND_LIGHT, align=uiconst.TOLEFT, width=spWidth)
     self.friendPointer = uicls.Container(name='friendPointer', align=uiconst.TOPLEFT_PROP, parent=self, pos=(0.0, 0.5, 2, 0.2), idx=0)
     uicls.Line(parent=self.friendPointer, align=uiconst.TOLEFT, weight=2, padBottom=2, color=facwarCommon.COLOR_FRIEND_LIGHT)
     self.friendPointerTxt = uicls.EveHeaderLarge(name='friendPointerTxt', parent=self.friendPointer, align=uiconst.CENTERTOP, top=-28)
     uicls.Sprite(name='friendTriangle', parent=self.friendPointer, texturePath='res:/ui/texture/icons/105_32_15.png', color=facwarCommon.COLOR_FRIEND_LIGHT, align=uiconst.CENTERTOP, rotation=pi / 2, width=32, height=32, top=-19)
     self.foeBar = uicls.Container(parent=self.centerCont, align=uiconst.TORIGHT_PROP, state=uiconst.UI_NORMAL, bgColor=facwarCommon.COLOR_FOE_BAR, clipChildren=True)
     self.foeBarSprite = uicls.Sprite(parent=self.foeBar, state=uiconst.UI_HIDDEN, texturePath='res:/ui/texture/classes/InfluenceBar/influenceBarPositive.png', color=facwarCommon.COLOR_FOE_LIGHT, align=uiconst.TORIGHT, width=spWidth)
     self.foePointer = uicls.Container(name='foePointer', align=uiconst.TOPLEFT_PROP, parent=self, pos=(0.0, 0.5, 2, 0.2), idx=0)
     uicls.Line(parent=self.foePointer, align=uiconst.TORIGHT, weight=2, padTop=2, color=facwarCommon.COLOR_FOE_LIGHT)
     self.foePointerTxt = uicls.EveHeaderLarge(name='foePointerTxt', parent=self.foePointer, align=uiconst.CENTERBOTTOM, top=-28)
     uicls.Sprite(name='foeTriangle', parent=self.foePointer, texturePath='res:/ui/texture/icons/105_32_15.png', color=facwarCommon.COLOR_FOE_LIGHT, align=uiconst.CENTERBOTTOM, rotation=-pi / 2, width=32, height=32, top=-19)
     uthread.new(self.FetchValues)
     uthread.new(self.AnimateBars)
    def ConstructNormal(self):
        """ Construct Normal mode UI """
        factionID = sm.GetService('facwar').GetSystemOccupier(
            session.solarsystemid2)
        self.subTitle.text = ('<url=showinfo:%s//%s>%s</url>' %
                              (const.typeFaction, factionID,
                               cfg.eveowners.Get(factionID).name), )
        self.upgradeLevel = sm.GetService('facwar').GetSolarSystemUpgradeLevel(
            session.solarsystemid2)
        self.bottomContainer.Flush()
        self.iconCont = uiprimitives.Container(name='iconCont',
                                               align=uiconst.TOTOP,
                                               parent=self.bottomContainer,
                                               padTop=6,
                                               height=36)
        self.factionIcon = uicls.LogoIcon(name='factionIcon',
                                          itemID=factionID,
                                          parent=uiprimitives.Container(
                                              parent=self.iconCont,
                                              align=uiconst.TOLEFT,
                                              width=36,
                                              padRight=5),
                                          align=uiconst.CENTER,
                                          size=32,
                                          ignoreSize=True,
                                          isSmall=True,
                                          opacity=0.0)
        if self.upgradeLevel:
            benefits = sm.GetService('facwar').GetSystemUpgradeLevelBenefits(
                self.upgradeLevel)[:]
            benefits = list(benefits)
            benefits.reverse()
            self.benefitIcons = []
            for benefitType, benefitValue in benefits:
                benefitIcon = uicls.FWSystemBenefitIcon(
                    parent=self.iconCont,
                    align=uiconst.TOLEFT,
                    padRight=12,
                    benefitType=benefitType,
                    benefitValue=benefitValue,
                    opacity=0.0)
                self.benefitIcons.append(benefitIcon)

        benefitValue = sm.GetService(
            'facwar').GetCurrentSystemEffectOfHeldDistricts()
        self.planetDistrictIcon = uicls.FWSystemBenefitIcon(
            align=uiconst.TORIGHT,
            parent=self.iconCont,
            height=self.ICONSIZE,
            padLeft=12,
            benefitType=facwarCommon.BENEFIT_PLANETDISTRICTS,
            benefitValue=benefitValue,
            opacity=0.0)
        self.benefitIcons.append(self.planetDistrictIcon)
        self.iconCont.display = bool(self.iconCont.children)
        self.UpdateGauge()
Пример #3
0
 def ConstructExistingFWPlayerHeader(self):
     self.topCont.Flush()
     iconSize = 50
     rightCont = uiprimitives.Container(name='rightCont', parent=self.topCont, align=uiconst.TORIGHT, width=200, padLeft=2)
     leftCont = uiprimitives.Container(name='leftCont', parent=self.topCont, clipChildren=True)
     firstLine = uiprimitives.Container(parent=leftCont, align=uiconst.TOTOP_PROP, height=0.4, padLeft=20)
     uiprimitives.Sprite(parent=firstLine, align=uiconst.CENTERLEFT, pos=(0,
      0,
      iconSize,
      iconSize), texturePath='res:/UI/Texture/Icons/FactionalWarfare_64.png')
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     enemyAllyID = facwarCommon.GetFactionSecondaryEnemy(self.factionID)
     text = localization.GetByLabel('UI/FactionWarfare/FWPlayerHeader1', typeID=const.typeFaction, factionID=self.factionID, factionName=self.factionName, enemyID=enemyID, enemyName=cfg.eveowners.Get(enemyID).name, enemyAllyID=enemyAllyID, enemyAllyName=cfg.eveowners.Get(enemyAllyID).name)
     uicontrols.EveLabelLarge(parent=firstLine, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL, left=iconSize + 20, text=text)
     secondLine = uiprimitives.Container(parent=leftCont, align=uiconst.TOTOP_PROP, height=0.6, padLeft=20)
     logo = uicls.LogoIcon(itemID=self.factionID, parent=secondLine, align=uiconst.CENTERLEFT, size=iconSize, ignoreSize=True)
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     labelCont = uicontrols.ContainerAutoSize(parent=secondLine, align=uiconst.CENTERLEFT, left=iconSize + 20)
     rank, rankDesc = self.GetCurrentRank()
     timeServed = self.GetTimeServed()
     text = localization.GetByLabel('UI/FactionWarfare/FWPlayerHeader2', rank=rank, corp=cfg.eveowners.Get(session.corpid).name, faction=self.factionName, time=timeServed)
     uicontrols.EveLabelMedium(parent=labelCont, text=text, tabs=[100])
     firstLine = uiprimitives.Container(name='firstLine', parent=rightCont, align=uiconst.TOTOP, height=80)
     secondLine = uiprimitives.Container(name='secondLine', parent=rightCont, align=uiconst.TOTOP, height=40, top=3)
     totalPointsCont = uiprimitives.Container(parent=firstLine, pos=(0, 30, 55, 30), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL, hint=localization.GetByLabel('UI/FactionWarfare/WarzoneProgress', points=self.warZoneInfo.factionPoints, pointsTotal=int(self.warZoneInfo.maxWarZonePoints)))
     uicontrols.EveLabelSmall(parent=totalPointsCont, text=localization.GetByLabel('UI/FactionWarfare/Points'), align=uiconst.CENTERTOP, top=-15)
     uicontrols.Frame(bgParent=totalPointsCont, color=(0.392, 0.635, 0.212, 0.2))
     uicontrols.GradientSprite(bgParent=totalPointsCont, rotation=-pi / 2, rgbData=[(0, (0.239, 0.42, 0.235)), (1, (0.075, 0.157, 0.086))], alphaData=[(0, 1.0), (1, 0.9)])
     self.totalPointsLabel = uicontrols.EveCaptionMedium(parent=totalPointsCont, align=uiconst.CENTER, text=self.warZoneInfo.factionPoints)
     systemsCont = uiprimitives.Container(parent=firstLine, align=uiconst.TOPLEFT, pos=(65, 5, 50, 100), state=uiconst.UI_NORMAL, hint=localization.GetByLabel('UI/FactionWarfare/NumConqueredSystems'))
     uiprimitives.Sprite(parent=systemsCont, align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, pos=(0, 0, 32, 32), texturePath='res:/UI/Texture/WindowIcons/systems.png')
     numSystems = len(sm.GetService('facwar').GetSolarSystemsOccupiedByFactions([self.factionID]))
     self.numSystemsLabel = uicontrols.EveHeaderLarge(parent=systemsCont, align=uiconst.CENTERTOP, top=30, text=numSystems)
     numUpgrades = self.GetSystemUpgradeNumbers()
     for i, num in enumerate(numUpgrades):
         if num:
             bgColor = util.Color.GetGrayRGBA(0.5, 0.5)
         else:
             bgColor = util.Color.GetGrayRGBA(0.2, 0.5)
         cont = uiprimitives.Container(parent=secondLine, bgColor=bgColor, align=uiconst.TOLEFT, state=uiconst.UI_NORMAL, width=35, padTop=15, padRight=4, hint=localization.GetByLabel('UI/FactionWarfare/UpgradeLevelHint', level=util.IntToRoman(i + 1)))
         uicontrols.EveLabelMedium(parent=cont, align=uiconst.CENTERTOP, text=util.IntToRoman(i + 1), top=-20)
         uicontrols.EveHeaderLarge(parent=cont, align=uiconst.CENTER, text=num)