def ConstructFriendSquares(self, proportion): self.topCont.Flush() for i in xrange(5): cont = uiprimitives.Container(parent=self.topCont, align=uiconst.TOLEFT_PROP, state=uiconst.UI_NORMAL, width=0.2, padding=(0, 20, 0, 2), hint=localization.GetByLabel( self.TIERHINTS[i])) subCont = uiprimitives.Container(parent=cont, padding=(2, 0, 2, 0)) uiprimitives.Sprite( bgParent=subCont, texturePath='res:/UI/Texture/Classes/FWWindow/TierBlock.png', opacity=0.5) uiprimitives.Fill(bgParent=subCont, color=facwarCommon.COLOR_FRIEND) if proportion * 5 < i: cont.opacity = 0.2 uicontrols.EveHeaderLarge(parent=subCont, align=uiconst.CENTERTOP, top=-22, text=localization.GetByLabel( 'UI/FactionWarfare/TierNum', tierNum=i + 1), color=facwarCommon.COLOR_FRIEND_LIGHT)
def Startup(self, *etc): self.sr.infoIcon = uicontrols.Icon(hint=localization.GetByLabel('UI/Common/ShowInfo'), parent=self, name='infoIcon', icon='ui_38_16_208', size=16) self.sr.icon = uicontrols.Icon(parent=self, name='icon', size=96, top=40) self.sr.upgradeLevelHeader = uicontrols.EveHeaderLarge(parent=self, name='upgradeLevelHeader', state=uiconst.UI_DISABLED, text=localization.GetByLabel('UI/Station/StationManagment/OutpostUpgradeLevel'), bold=True, left=20, top=10) self.sr.upgradeLevelLabel = uicontrols.Label(parent=self, name='upgradeLevelLabel', state=uiconst.UI_DISABLED, text=localization.GetByLabel('UI/Station/StationManagment/OutpostUpgradeLevel'), bold=True, fontsize=60, top=25) self.sr.trunk = uiprimitives.Fill(parent=self, align=uiconst.RELATIVE, name='trunk') self.sr.trunk.width = ImprovementsMetrics.trunkThickness self.sr.trunk.color.a = ImprovementsMetrics.lineAlpha
def CreateEditModeContainer(self): uicontrols.EveHeaderLarge(parent=self.editModeContent, text=localization.GetByLabel('UI/PI/Common/EditsPending'), align=uiconst.RELATIVE) self.powerGauge = uicls.Gauge(parent=self.editModeContent, pos=(0, 22, 115, 34), color=planetCommon.PLANET_COLOR_POWER, label=localization.GetByLabel('UI/PI/Common/PowerUsage')) self.cpuGauge = uicls.Gauge(parent=self.editModeContent, pos=(130, 22, 115, 34), color=planetCommon.PLANET_COLOR_CPU, label=localization.GetByLabel('UI/PI/Common/CpuUsage')) self.UpdatePowerAndCPUGauges() btns = [[localization.GetByLabel('UI/Common/Submit'), self.Submit, ()], [localization.GetByLabel('UI/Common/Cancel'), self.Cancel, ()]] bottom = uiprimitives.Container(parent=self.editModeContent, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 40)) btns = uicontrols.ButtonGroup(btns=btns, subalign=uiconst.CENTERRIGHT, parent=bottom, line=False, alwaysLite=True) self.costText = CaptionAndSubtext(parent=bottom, align=uiconst.TOPLEFT, top=13, caption=localization.GetByLabel('UI/Common/Cost'), subtext='')
def SetCounter(self, count): if count is None or count <= 1: if self.counterText is not None: self.counterText.Close() self.counterText = None else: if self.counterText is None: self.counterText = uicontrols.EveHeaderLarge(parent=self.content, name='counter', left=34, top=-2, bold=True, color=self.timerData.color) text = str(count) if count < 10 else '9+' self.counterText.text = text
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 SetCounter(self, count): """ Set a special counter giving use for number of engagements """ if count is None or count <= 1: if self.counterText is not None: self.counterText.Close() self.counterText = None else: if self.counterText is None: self.counterText = uicontrols.EveHeaderLarge(parent=self.content, name='counter', left=34, top=-2, bold=True, color=self.timerData.color) text = str(count) if count < 10 else '9+' self.counterText.text = text
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) leftCont = uiprimitives.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 = uiprimitives.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 = uiprimitives.Container(name='topCont', parent=self, align=uiconst.TOTOP_PROP, height=0.4) self.bottomCont = uiprimitives.Container(name='bottomCont', parent=self, align=uiconst.TOBOTTOM_PROP, height=0.4) self.centerCont = uiprimitives.Container( name='centerCont', parent=self, bgColor=facwarCommon.COLOR_CENTER_BG, padding=2) w, h = self.centerCont.GetAbsoluteSize() spWidth = 134 / 16.0 * h self.friendBar = uiprimitives.Container( parent=self.centerCont, align=uiconst.TOLEFT_PROP, state=uiconst.UI_NORMAL, bgColor=facwarCommon.COLOR_FRIEND_BAR, clipChildren=True) self.friendBarSprite = uiprimitives.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 = uiprimitives.Container(name='friendPointer', align=uiconst.TOPLEFT_PROP, parent=self, pos=(0.0, 0.5, 2, 0.2), idx=0) uiprimitives.Line(parent=self.friendPointer, align=uiconst.TOLEFT, weight=2, padBottom=2, color=facwarCommon.COLOR_FRIEND_LIGHT) self.friendPointerTxt = uicontrols.EveHeaderLarge( name='friendPointerTxt', parent=self.friendPointer, align=uiconst.CENTERTOP, top=-28) uiprimitives.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 = uiprimitives.Container( parent=self.centerCont, align=uiconst.TORIGHT_PROP, state=uiconst.UI_NORMAL, bgColor=facwarCommon.COLOR_FOE_BAR, clipChildren=True) self.foeBarSprite = uiprimitives.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 = uiprimitives.Container(name='foePointer', align=uiconst.TOPLEFT_PROP, parent=self, pos=(0.0, 0.5, 2, 0.2), idx=0) uiprimitives.Line(parent=self.foePointer, align=uiconst.TORIGHT, weight=2, padTop=2, color=facwarCommon.COLOR_FOE_LIGHT) self.foePointerTxt = uicontrols.EveHeaderLarge( name='foePointerTxt', parent=self.foePointer, align=uiconst.CENTERBOTTOM, top=-28) uiprimitives.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 ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) charID = attributes.charID self.charID = None self.corp = None self.standing2 = None self.charMgr = None self.memberinfo = None self.corporation = None self.roleGroupings = None self.myGrantableRoles = None self.myGrantableRolesAtHQ = None self.myGrantableRolesAtBase = None self.myGrantableRolesAtOther = None self.isCEOorEq = None self.userIsCEO = None self.member = None self.playerIsCEO = 0 self.playerIsDirector = 0 self.roles = 0 self.grantableRoles = 0 self.rolesAtHQ = 0 self.grantableRolesAtHQ = 0 self.rolesAtBase = 0 self.grantableRolesAtBase = 0 self.rolesAtOther = 0 self.grantableRolesAtOther = 0 self.baseID = None self.title = '' self.titleMask = 0 self.args = '' self.ddxFunction = None self.viewType = 0 self.viewRoleGroupingID = 1 self.bases = [('-', None)] self.LoadServices() self.LoadChar(charID) self.SetScope('all') if not self.member: self.Close() return self.SetTopparentHeight(70) self.SetCaption( localization.GetByLabel( 'UI/Corporations/EditMemberDialog/EditMemberCaption')) self.SetMinSize([310, 300]) self.sr.main = uiutil.GetChild(self, 'main') self.wndCombos = uiprimitives.Container(name='options', parent=self.sr.main, align=uiconst.TOTOP, height=34) viewOptionsList1 = [[ localization.GetByLabel('UI/Corporations/Common/Roles'), VIEW_ROLES ], [ localization.GetByLabel( 'UI/Corporations/Common/GrantableRoles'), VIEW_GRANTABLE_ROLES ]] viewOptionsList2 = [] for roleGrouping in self.roleGroupings.itervalues(): viewOptionsList2.append([ localization.GetByMessageID(roleGrouping.roleGroupNameID), roleGrouping.roleGroupID ]) i = 0 for optlist, label, config, defval in [ (viewOptionsList1, localization.GetByLabel('UI/Common/View'), 'viewtype', 1000), (viewOptionsList2, localization.GetByLabel('UI/Corporations/Common/GroupType'), 'rolegroup', None) ]: combo = uicontrols.Combo(label=label, parent=self.wndCombos, options=optlist, name=config, callback=self.OnComboChange, width=146, pos=(const.defaultPadding + i * 152 + 1, const.defaultPadding + 12, 0, 0)) i += 1 self.sr.dynamicScroll = uicontrols.BasicDynamicScroll( parent=self.sr.main, padding=const.defaultPadding) self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=const.defaultPadding) self.sr.standardBtns = uicontrols.ButtonGroup( btns=[[ localization.GetByLabel('UI/Common/Buttons/OK'), self.OnOK, ( ), 81 ], [ localization.GetByLabel('UI/Common/Buttons/Cancel'), self.OnCancel, (), 81 ], [ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/Apply'), self.OnApply, (), 81 ]]) self.sr.main.children.insert(0, self.sr.standardBtns) cap = uicontrols.CaptionLabel(text=cfg.eveowners.Get(self.charID).name, parent=self.sr.topParent, align=uiconst.RELATIVE, left=74, top=20) if self.member.title: uicontrols.EveHeaderLarge(text=self.member.title, parent=self.sr.topParent, align=uiconst.RELATIVE, left=cap.left, top=cap.top + cap.height, bold=True) if util.IsDustCharacter(charID): btns = [] else: btns = [[ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/GiveShares'), self.OnGiveShares, (), 81 ]] buttons = uicontrols.ButtonGroup(btns=btns) self.sr.main.children.insert(1, buttons) maintabs = uicontrols.TabGroup(name='tabparent', parent=self.sr.main, idx=0) maintabs.Startup( [[ localization.GetByLabel('UI/Generic/General'), self.sr.scroll, self, 'general', buttons ], [ localization.GetByLabel('UI/Corporations/Common/Roles'), self.sr.dynamicScroll, self, 'roles' ], [ localization.GetByLabel('UI/Corporations/Common/Titles'), self.sr.dynamicScroll, self, 'titles' ], [ localization.GetByLabel( 'UI/Corporations/EditMemberDialog/RolesSummary'), self.sr.scroll, self, 'roles_summary' ]], 'editmemberdialog') self.sr.maintabs = maintabs self.DisplayPhoto()