Пример #1
0
 def GetSystemLevelString(self, systemID):
     systemLevel = self.GetSystemLevel(systemID)
     if self.IsFriendSystem(systemID):
         if systemLevel:
             return util.IntToRoman(systemLevel)
         else:
             return ''
     else:
         return '-'
Пример #2
0
 def OnUpgradeBarValueChanged(self, oldValue, newValue):
     self.newLevel = newValue
     txt = localization.GetByLabel(
         'UI/PI/Common/UpgradeFromLevelXToY',
         currLevel=util.IntToRoman(self.currLevel + 1),
         newLevel=util.IntToRoman(self.newLevel + 1))
     skill = sm.GetService('skills').GetMySkillsFromTypeID(
         const.typeCommandCenterUpgrade)
     commandCenterSkillLevel = 0
     if skill is not None:
         commandCenterSkillLevel = skill.skillLevel
     if commandCenterSkillLevel < newValue:
         skillType = cfg.invtypes.Get(const.typeCommandCenterUpgrade)
         hint = localization.GetByLabel(
             'UI/PI/Common/NeedSkillToUpgrade',
             skillLevel=util.IntToRoman(newValue),
             skillName=skillType.typeName)
         txt = localization.GetByLabel(
             'UI/PI/Common/InsufficientSkillForUpgrade')
         self.upgradeButton.Disable()
     else:
         hint = ''
         self.upgradeButton.Enable()
     self.upgradeText.SetCaption(txt)
     self.upgradeText.hint = hint
     newPowerOutput = planetCommon.GetPowerOutput(self.newLevel)
     self.upgradePowerGauge.SetValue(gaugeNum=1,
                                     value=newPowerOutput /
                                     self.maxPowerOutput)
     self.upgradePowerGauge.hint = self._GetPowerGaugeHint(newPowerOutput)
     self._SetPowerGaugeSubText(newPowerOutput)
     newCPUOutput = planetCommon.GetCPUOutput(self.newLevel)
     self.upgradeCPUGauge.SetValue(gaugeNum=1,
                                   value=newCPUOutput / self.maxCPUOutput)
     self.upgradeCPUGauge.hint = self._GetCPUGaugeHint(newCPUOutput)
     self._SetCPUGaugeSubText(newCPUOutput)
     iskCost = util.FmtISK(planetCommon.GetUpgradeCost(
         self.currLevel, self.newLevel),
                           showFractionsAlways=0)
     self.costText.SetSubtext(iskCost)
Пример #3
0
    def Reload(self):
        self.DisableDistrict()
        self.districts = {}
        if session.solarsystemid is not None:
            self.districts = sm.RemoteSvc(
                'districtLocation').GetDistrictsBySolarSystem(
                    session.solarsystemid2)
            for district in self.districts.itervalues():
                district['name'] = localization.GetImportantByLabel(
                    'UI/Locations/LocationDistrictFormatter',
                    solarSystemID=district['solarSystemID'],
                    romanCelestialIndex=util.IntToRoman(
                        district['celestialIndex']),
                    districtIndex=district['index'])

            uthread.new(self._AddDistrictsToPlanets)
        self._CleanupBalls()
Пример #4
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)
Пример #5
0
 def ApplyAttributes(self, attributes):
     LayoutGridRow.ApplyAttributes(self, attributes)
     self.typeID = attributes.typeID
     self.level = attributes.level
     self.showLevel = attributes.Get('showLevel', self.default_showLevel)
     self.bgPattern = Sprite(
         bgParent=self,
         align=uiconst.TOALL,
         padBottom=1,
         texturePath=
         'res:/UI/Texture/Classes/Industry/Output/hatchPattern.png',
         tileX=True,
         tileY=True,
         color=SkillTreeEntry.COLOR_RESTRICTED,
         opacity=0.0)
     self.bgFill = Fill(bgParent=self, padBottom=1)
     leftCont = ContainerAutoSize(padding=(0, 3, 0, 3),
                                  align=uiconst.CENTERLEFT)
     self.icon = Sprite(name='icon',
                        parent=leftCont,
                        align=uiconst.CENTERLEFT,
                        pos=(2, 0, 16, 16),
                        state=uiconst.UI_NORMAL)
     if self.showLevel:
         text = GetByLabel('UI/InfoWindow/SkillAndLevelInRoman',
                           skill=self.typeID,
                           levelInRoman=util.IntToRoman(self.level))
     else:
         text = cfg.invtypes.Get(self.typeID).name
     self.label = Label(name='label',
                        parent=leftCont,
                        align=uiconst.CENTERLEFT,
                        left=self.icon.width + 4,
                        text=text)
     self.AddCell(leftCont)
     self.skillBar = SkillLevels(align=uiconst.CENTERRIGHT,
                                 typeID=self.typeID)
     self.AddCell(self.skillBar, cellPadding=(8, 8, 8, 8))
     self.UpdateState()
Пример #6
0
    def Reload(self):
        """
        Queries the district manager using RemoteSvc. We need to be careful with this for now
        because this service is designed to be called using ServiceProxy and we do not have an
        impementation of that for the EVE client yet. RemoteSvc will work for any methods with
        the resolve param marked const.cluster.NODE_ANY_SERVER.
        """
        self.DisableDistrict()
        self.districts = {}
        if session.solarsystemid is not None:
            self.districts = sm.RemoteSvc('districtLocation').GetDistrictsBySolarSystem(session.solarsystemid2)
            for district in self.districts.itervalues():
                district['name'] = localization.GetImportantByLabel('UI/Locations/LocationDistrictFormatter', solarSystemID=district['solarSystemID'], romanCelestialIndex=util.IntToRoman(district['celestialIndex']), districtIndex=district['index'])

            self._AddDistrictsToPlanets()