def ConstructNewFWPlayerHeader(self): self.topCont.Flush() iconSize = 50 firstLine = uicls.Container(parent=self.topCont, align=uiconst.TOTOP_PROP, height=0.4, padLeft=20) uicls.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/NonFWPlayerHeader1', 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) uicls.EveLabelLarge(parent=firstLine, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL, left=iconSize + 20, text=text) secondLine = uicls.Container(parent=self.topCont, align=uiconst.TOTOP_PROP, height=0.6, padLeft=20) uicls.Sprite(parent=secondLine, align=uiconst.CENTERLEFT, pos=(0, 0, iconSize, iconSize), texturePath='res:/UI/Texture/Icons/34_64_8.png') enemyID = facwarCommon.GetFactionMainEnemy(self.factionID) labelCont = uicls.ContainerAutoSize(parent=secondLine, align=uiconst.CENTERLEFT, left=iconSize + 20) uicls.EveCaptionSmall(parent=labelCont, text=localization.GetByLabel( 'UI/FactionWarfare/FightForFaction', factionName=cfg.eveowners.Get( self.factionID).name)) uicls.EveLabelMedium( state=uiconst.UI_NORMAL, parent=labelCont, top=25, text=localization.GetByLabel( 'UI/FactionWarfare/FightForFactionText', url='localsvc:service=facwar&method=ShowRulesOfEngagementTab'))
def UpdateSystemsScroll(self): fwSvc = sm.GetService('facwar') foeID = facwarCommon.GetFactionMainEnemy(self.factionID) systemIDs = fwSvc.GetSolarSystemsOccupiedByFactions( (self.factionID, foeID)) scrolllist = [] for systemID in systemIDs: data = util.KeyVal() numJumps = int( sm.GetService('pathfinder').GetJumpCountFromCurrent(systemID)) captureStatus = fwSvc.GetSystemCaptureStatusTxt(systemID) level = self.GetSystemLevelString(systemID) systemName = self.ColorTextBySide( cfg.evelocations.Get(systemID).name, systemID) data.label = '%s<t>%s<t>%s<t>%s' % (systemName, level, numJumps, captureStatus) data.itemID = systemID data.typeID = const.typeSolarSystem data.selectable = 0 data.OnMouseEnter = self.OnSystemEntryMouseEnter data.OnMouseExit = self.OnSystemEntryMouseExit data.hint = self.GetSolarSystemHint( systemID, fwSvc.GetSystemCaptureStatus(systemID)) scrolllist.append(listentry.Get('Generic', data=data)) headers = (localization.GetByLabel('UI/FactionWarfare/System'), localization.GetByLabel('UI/FactionWarfare/Level'), localization.GetByLabel('UI/FactionWarfare/Jumps'), localization.GetByLabel('UI/FactionWarfare/Capture status')) self.systemsScroll.Load(contentList=scrolllist, headers=headers) return scrolllist
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)
def ConstructMap(self): fwSvc = sm.StartService('facwar') foeID = facwarCommon.GetFactionMainEnemy(self.factionID) systems = fwSvc.GetSolarSystemsOccupiedByFactions( (self.factionID, foeID)) solarSystemIDs = systems.keys() translations = self.sceneContainer.GetTranslationsForSolarsystemIDs( solarSystemIDs) self.bracketsByID = {} for i, translation in enumerate(translations): systemID = solarSystemIDs[i] captureStatus = fwSvc.GetSystemCaptureStatus(systemID) bracket = uicls.FWMapBracket( parent=self.bracketParent, controller=self, width=8, height=8, curveSet=self.sceneContainer.bracketCurveSet, systemID=systemID, captureStatus=captureStatus, occupierID=systems[systemID], friendID=self.factionID, foeID=foeID) bracket.trackTransform = self.sceneContainer.CreateBracketTransform( translation) self.bracketsByID[systemID] = bracket if self.factionID in (const.factionAmarrEmpire, const.factionMinmatarRepublic): self.sceneContainer.camera.SetOrbit(5.44, -0.16) self.sceneContainer.camera.translationFromParent = 10 self.sceneContainerNav.SetMinMaxZoom(0.5, 12.0) else: self.sceneContainer.camera.SetOrbit(5.61, -0.16) self.sceneContainer.camera.translationFromParent = 14 self.sceneContainerNav.SetMinMaxZoom(0.5, 15.0) self.sceneContainer.AnimRotateFrom(yaw=-40.0, pitch=-40.0, zoom=10.0, duration=1.5)