Ejemplo n.º 1
0
 def _SetCaption(self, title):
     if self.sr.Get('loading_caption', None) is None:
         self.sr.loading_caption = uicls.EveCaptionMedium(
             text=['<center>', title],
             parent=self.sr.main,
             align=uiconst.CENTERTOP,
             width=self.width - 50,
             top=12,
             idx=0,
             state=uiconst.UI_DISABLED,
             name='caption')
         self.sr.loading_title = title
     elif self.sr.Get('loading_title', None) != title:
         self.sr.loading_caption.text = ['<center>', title]
         self.sr.loading_title = title
Ejemplo n.º 2
0
 def ShowHint(self, hint=None):
     isNew = self.sr.hint is None or self.sr.hint.text != hint
     if self.sr.hint is None and hint:
         clipperWidth = self.GetContentWidth()
         self.sr.hint = uicls.EveCaptionMedium(parent=self.sr.clipper,
                                               align=uiconst.TOPLEFT,
                                               left=16,
                                               top=32,
                                               width=clipperWidth - 32,
                                               text=hint)
     elif self.sr.hint is not None and hint:
         self.sr.hint.text = hint
         self.sr.hint.state = uiconst.UI_DISABLED
         isNew = isNew or self.sr.hint.display == False
     elif self.sr.hint is not None and not hint:
         self.sr.hint.state = uiconst.UI_HIDDEN
     if self.sr.hint and self.sr.hint.display and isNew:
         uicore.animations.FadeTo(self.sr.hint, 0.0, 0.5, duration=0.3)
Ejemplo n.º 3
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     transmission = attributes.transmission
     self.isDockWnd = 0
     caption = getattr(transmission, 'caption', None) or localization.GetByLabel('UI/Generic/Information')
     hasDungeonWarp = getattr(transmission, 'hasDungeonWarp', False)
     self.scope = 'inflight'
     self.sr.main = uiutil.GetChild(self, 'main')
     uicls.Line(parent=self.sr.topParent, align=uiconst.TOBOTTOM)
     uicls.Container(name='push', parent=self.sr.topParent, align=uiconst.TOLEFT, width=70)
     self.sr.header = uicls.EveCaptionMedium(text=' ', parent=self.sr.topParent, align=uiconst.TOTOP, padTop=8)
     self.sr.messageArea = uicls.EditPlainText(parent=self.sr.main, padding=const.defaultPadding, readonly=1)
     self.sr.messageArea.HideBackground()
     self.sr.messageArea.RemoveActiveFrame()
     self.NoSeeThrough()
     self.SetMinSize([360, 240], 1)
     self.SetCaption(caption)
     self.MakeUnResizeable()
     self.MakeUnKillable()
     self.SetTopparentHeight(58)
     if not hasDungeonWarp:
         self.DefineButtons(uiconst.OK, okLabel=localization.GetByLabel('UI/Generic/Close'), okFunc=self.Close)
     else:
         self.sr.instanceID = getattr(transmission.rec.rec, 'instanceID', 0)
         self.sr.solarSystemID = getattr(transmission.rec.rec, 'solarSystemID', 0)
         if self.sr.solarSystemID == eve.session.solarsystemid:
             okLabel = localization.GetByLabel('UI/Commands/WarpTo')
             okFunc = self.WarpToEPLocation
         else:
             inFleet = bool(eve.session.fleetid)
             isLeader = sm.GetService('menu').ImFleetLeaderOrCommander()
             if inFleet and isLeader:
                 okLabel = localization.GetByLabel('UI/Fleet/FleetBroadcast/Commands/BroadcastTravelTo')
                 okFunc = self.SetFleetDestination
             else:
                 okLabel = localization.GetByLabel('UI/Inflight/SetDestination')
                 okFunc = self.SetDestination
         if self.sr.instanceID and self.sr.solarSystemID:
             self.DefineButtons(uiconst.OKCANCEL, okLabel=okLabel, okFunc=okFunc, cancelLabel=localization.GetByLabel('UI/Generic/Close'), cancelFunc=self.Close)
         else:
             self.DefineButtons(uiconst.OK, okLabel=localization.GetByLabel('UI/Generic/Close'), okFunc=self.Close)
Ejemplo n.º 4
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     self.typeID = None
     self.scope = 'all'
     self.SetCaption(localization.GetByLabel('UI/Preview/PreviewCaption'))
     self.sr.main = uiutil.GetChild(self, 'main')
     self.SetWndIcon()
     self.SetTopparentHeight(0)
     self.SetMinSize([420, 320])
     self.sr.rightSide = rightSide = uicls.Container(name='rightSide',
                                                     parent=self.sr.main,
                                                     align=uiconst.TOALL,
                                                     pos=(0, 0, 0, 0),
                                                     padding=(6, 6, 6, 6),
                                                     clipChildren=1)
     self.loadingWheel = uicls.LoadingWheel(parent=self.sr.rightSide,
                                            align=uiconst.CENTER,
                                            state=uiconst.UI_NORMAL)
     listbtn = uicls.MenuIcon(size=24, ignoreSize=True)
     listbtn.sr.owner = self
     listbtn.state = uiconst.UI_NORMAL
     listbtn.align = uiconst.NOALIGN
     listbtn.left = 2
     listbtn.top = 10
     listbtn.hint = localization.GetByLabel('UI/Neocom/ListItemsInSystem')
     listbtn.GetMenu = self.GetShipMenu
     self.listbtn = listbtn
     self.sr.title = uicls.EveCaptionMedium(text='',
                                            parent=rightSide,
                                            align=uiconst.TOTOP,
                                            padding=(17, 4, 17, 0),
                                            state=uiconst.UI_NORMAL)
     self.sr.title.GetMenu = self.GetShipMenu
     self.sr.title.expandOnLeft = 1
     self.sr.subtitle = uicls.EveHeaderSmall(text='',
                                             parent=rightSide,
                                             align=uiconst.TOTOP,
                                             padding=(19, 0, 17, 0),
                                             state=uiconst.UI_DISABLED)
     self.textCont = uicls.Container(parent=self.sr.rightSide,
                                     align=uiconst.TOBOTTOM,
                                     pos=(0, 0, 0, 150))
     self.desc = uicls.EditPlainText(parent=self.textCont,
                                     readonly=1,
                                     padding=6,
                                     fontsize=12)
     self.desc.HideBackground()
     self.desc.RemoveActiveFrame()
     sc = form.SceneContainer(parent=self.sr.main,
                              align=uiconst.TOALL,
                              state=uiconst.UI_DISABLED,
                              padding=6)
     sc.Startup()
     self.sr.sceneContainer = sc
     nav = form.SceneContainerBaseNavigation(parent=self.sr.main,
                                             state=uiconst.UI_NORMAL,
                                             padding=6)
     nav.Startup(sc)
     nav.OnClick = self.OnClickNav
     self.sr.navigation = nav
     self.mannequin = None
     self.loadingCharacterThread = None
     self.previewingWhat = ''
     self.previewType = attributes.previewType
     self.previewCharacterInfo = None
     if attributes.previewCharacter:
         dna = attributes.dna
         if dna:
             self.previewCharacterInfo = (attributes.previewCharacter, dna)
Ejemplo n.º 5
0
 def ConstructLayout(self):
     self.leftCont = uicls.Container(name='leftCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOLEFT,
                                     width=SEARCH_WIDTH,
                                     clipChildren=True)
     self.rightCont = uicls.Container(name='rightCont',
                                      parent=self.sr.main,
                                      align=uiconst.TOALL)
     topCont = uicls.Container(name='topCont',
                               parent=self.rightCont,
                               align=uiconst.TOTOP,
                               height=90)
     uicls.EveLabelMedium(
         text=localization.GetByLabel('UI/AgentFinder/AgentLevel'),
         parent=topCont,
         align=uiconst.CENTERTOP,
         top=4)
     self.sliderCont = uicls.Container(name='sliderCont',
                                       parent=topCont,
                                       align=uiconst.TOTOP,
                                       pos=(0, 28, 0, 20),
                                       padding=(SLIDER_PADDING, 0,
                                                SLIDER_PADDING, 0))
     self.sliderAdjusterCont = uicls.Container(name='sliderAdjusterCont',
                                               parent=topCont,
                                               align=uiconst.TOTOP,
                                               pos=(0, 0, 0,
                                                    ADJUSTER_WIDTH),
                                               padding=(SLIDER_PADDING, 0,
                                                        SLIDER_PADDING, 0))
     browseCont = uicls.Container(name='browseCont',
                                  parent=self.rightCont,
                                  align=uiconst.TOBOTTOM,
                                  height=22,
                                  padding=(const.defaultPadding, 0,
                                           const.defaultPadding, 0),
                                  state=uiconst.UI_NORMAL)
     self.prevBtn = uicls.BrowseButton(parent=browseCont,
                                       prev=True,
                                       state=uiconst.UI_NORMAL,
                                       func=self.BrowseAgents)
     self.nextBtn = uicls.BrowseButton(parent=browseCont,
                                       prev=False,
                                       state=uiconst.UI_NORMAL,
                                       align=uiconst.TOPRIGHT,
                                       func=self.BrowseAgents)
     self.pageNumText = uicls.EveLabelMedium(text='',
                                             parent=browseCont,
                                             align=uiconst.CENTERTOP,
                                             state=uiconst.UI_HIDDEN)
     self.noAgentsCont = uicls.Container(
         name='noAgentsCont',
         parent=self.rightCont,
         align=uiconst.TOALL,
         padding=(const.defaultPadding * 3, const.defaultPadding,
                  const.defaultPadding * 3, const.defaultPadding),
         state=uiconst.UI_HIDDEN)
     self.noAgentsOrLoadingText = uicls.EveCaptionMedium(
         text='',
         parent=self.noAgentsCont,
         align=uiconst.TOTOP,
         width=self.noAgentsCont.width)
     self.noAgentsOrLoadingText.SetAlpha(0.5)
     self.mainCont = uicls.GridContainer(
         name='mainCont',
         parent=self.rightCont,
         align=uiconst.TOALL,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding))
     self.mainCont.lines = AGENT_LINES
     self.mainCont.columns = AGENT_COLUMNS
     self.expanderCont = uicls.Container(parent=topCont,
                                         align=uiconst.BOTTOMLEFT,
                                         height=16,
                                         width=60,
                                         top=8,
                                         state=uiconst.UI_NORMAL,
                                         left=6)
     self.expanderIcon = uicls.Icon(parent=self.expanderCont,
                                    idx=0,
                                    size=16,
                                    state=uiconst.UI_DISABLED,
                                    icon='ui_1_16_100')
     l = uicls.EveLabelMedium(
         text=localization.GetByLabel('UI/AgentFinder/FilterOptions'),
         parent=self.expanderCont,
         left=16)
     self.expanderCont.SetOpacity(NORMAL_ALPHA)
     self.expanderCont.width = l.width + 16
     self.expanderCont.OnClick = self.OnChangeSize
     self.expanderCont.OnMouseEnter = (self.OnContMouseEnter,
                                       self.expanderCont)
     self.expanderCont.OnMouseExit = (self.OnContMouseExit,
                                      self.expanderCont)
     self.GetStandings()
     self.GetAllAgentInfo()
     self.ConstructSearchUI()
     self.agentLevel = settings.user.ui.Get('agentFinderLevel',
                                            self.bestCorpStanding)
     self.ConstructSlider()
     expanded = settings.user.ui.Get('agentFinderExpanded', None)
     if expanded is None:
         settings.user.ui.Set('agentFinderExpanded', False)
     if expanded:
         self.ExpandSearch()
     else:
         self.CollapseSearch()
     self.GetAgents()
Ejemplo n.º 6
0
 def SetupStuff(self):
     options = [
         (localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyAvailableFleets'), INVITE_ALL),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/MyCorpFleets'),
          INVITE_CORP)
     ]
     selected = settings.user.ui.Get('fleetfinder_scopeFilter', None)
     if session.allianceid is not None:
         options.append((localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyAllianceFleets'), INVITE_ALLIANCE))
     elif selected == INVITE_ALLIANCE:
         selected = None
     if session.warfactionid is not None:
         options.append((localization.GetByLabel(
             'UI/Fleet/FleetRegistry/MyMilitiaFleets'), INVITE_MILITIA))
     elif selected == INVITE_MILITIA:
         selected = None
     options.append((
         localization.GetByLabel('UI/Fleet/FleetRegistry/BasedOnStandings'),
         INVITE_PUBLIC))
     l = 1
     combo = self.sr.scopeCombo = uicls.Combo(
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/Scope'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_scopeFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[0])
     self.sr.scopeCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     selected = settings.user.ui.Get('fleetfinder_rangeFilter', None)
     options = [
         (localization.GetByLabel('UI/Common/Any'), None),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/NumberOfJumps',
                                  numJumps=5), 5),
         (localization.GetByLabel('UI/Fleet/FleetRegistry/NumberOfJumps',
                                  numJumps=10), 10),
         (localization.GetByLabel('UI/Common/LocationTypes/Region'), -1)
     ]
     combo = self.sr.rangeCombo = uicls.Combo(
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/Range'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_rangeFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[1])
     self.sr.rangeCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     selected = settings.user.ui.Get('fleetfinder_standingFilter', None)
     options = [(localization.GetByLabel('UI/Common/Any'), None),
                (localization.GetByLabel('UI/Standings/Good'),
                 const.contactGoodStanding),
                (localization.GetByLabel('UI/Standings/Excellent'),
                 const.contactHighStanding)]
     combo = self.sr.standingCombo = uicls.Combo(
         label=localization.GetByLabel(
             'UI/Fleet/FleetRegistry/RequireStanding'),
         parent=self.sr.filterCont,
         options=options,
         name='fleetfinder_standingFilter',
         select=selected,
         pos=(l, 14, 0, 0),
         width=COMBO_SIZES[2])
     self.sr.standingCombo.OnChange = self.OnComboChange
     l += combo.width + 3
     self.sr.getFleetsBtn = btn = uicls.Button(
         parent=self.sr.filterCont,
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/FindFleets'),
         pos=(0, 14, 0, 0),
         func=self.GetFleetsClick,
         align=uiconst.TOPRIGHT)
     self.sr.scroll = uicls.Scroll(parent=self.sr.scrollCont)
     self.sr.scroll.sr.id = 'fleetfinderScroll'
     self.sr.scroll.multiSelect = 0
     self.sr.scroll.Load(contentList=[],
                         headers=[],
                         scrolltotop=0,
                         noContentHint=localization.GetByLabel(
                             'UI/Fleet/FleetRegistry/SearchHint'))
     self.sr.caption = uicls.EveLabelMediumBold(text='',
                                                parent=self.sr.topInfoCont,
                                                align=uiconst.RELATIVE,
                                                left=4,
                                                top=2,
                                                state=uiconst.UI_NORMAL)
     self.sr.detailsText = uicls.EditPlainText(name='detailsText',
                                               parent=self.sr.descrCont,
                                               padTop=2,
                                               state=uiconst.UI_NORMAL,
                                               readonly=1)
     self.sr.detailsText.HideBackground()
     self.sr.detailsText.RemoveActiveFrame()
     uicls.Frame(parent=self.sr.detailsText, color=(0.4, 0.4, 0.4, 0.7))
     tabs = [110, 540]
     self.sr.infoText = uicls.EveLabelMedium(name='infoText',
                                             text='',
                                             parent=self.sr.descrCont,
                                             top=const.defaultPadding,
                                             idx=0,
                                             tabs=tabs,
                                             state=uiconst.UI_NORMAL)
     self.sr.joinBtn = btn = uicls.Button(
         parent=self.sr.topInfoCont,
         label=localization.GetByLabel('UI/Fleet/FleetRegistry/JoinFleet'),
         pos=(0, 1, 0, 0),
         func=self.JoinFleet,
         align=uiconst.CENTERRIGHT)
     self.sr.joinRequestBtn = btn = uicls.Button(
         parent=self.sr.topInfoCont,
         label=localization.GetByLabel(
             'UI/Fleet/FleetRegistry/RequestJoinFleet'),
         pos=(0, 1, 0, 0),
         func=self.JoinFleet,
         align=uiconst.CENTERRIGHT)
     self.sr.myAdvertMainCont = uicls.Container(name='myAdvertMainCont',
                                                parent=self.sr.myAdvertCont,
                                                align=uiconst.TOALL,
                                                pos=(0, 0, 0, 0))
     self.myAdvertButtons = [
         (localization.GetByLabel('UI/Fleet/FleetWindow/EditAdvert'),
          sm.GetService('fleet').OpenRegisterFleetWindow, (), 84),
         (localization.GetByLabel('UI/Fleet/FleetWindow/RemoveAdvert'),
          sm.GetService('fleet').UnregisterFleet, (), 84)
     ]
     self.sr.myAdvertButtonWnd = uicls.ButtonGroup(
         btns=self.myAdvertButtons,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertCaption = uicls.EveCaptionMedium(
         text='',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOTOP,
         left=0,
         top=7,
         state=uiconst.UI_DISABLED)
     self.sr.myAdvertDescCont = uicls.Container(name='myAdvertDescCont',
                                                parent=self.sr.myAdvertCont,
                                                align=uiconst.TOALL,
                                                pos=(0, 0, 0, 0))
     self.sr.myAdvertText = uicls.EveLabelMedium(
         text='',
         parent=self.sr.myAdvertCont,
         top=const.defaultPadding,
         tabs=tabs,
         align=uiconst.TOTOP,
         state=uiconst.UI_NORMAL)
     self.sr.myAdvertDesc = uicls.EditPlainText(
         parent=self.sr.myAdvertDescCont,
         padTop=2,
         state=uiconst.UI_NORMAL,
         readonly=1)
     self.myAdvertButtons_Register = [
         (localization.GetByLabel('UI/Fleet/FleetWindow/CreateAdvert'),
          sm.GetService('fleet').OpenRegisterFleetWindow, (), 84)
     ]
     self.sr.myAdvertButtonWnd_Register = uicls.ButtonGroup(
         btns=self.myAdvertButtons_Register,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertButtonWnd_Register.state = uiconst.UI_HIDDEN
Ejemplo n.º 7
0
 def ConstructExistingFWPlayerHeader(self):
     self.topCont.Flush()
     iconSize = 50
     rightCont = uicls.Container(name='rightCont',
                                 parent=self.topCont,
                                 align=uiconst.TORIGHT,
                                 width=200,
                                 padLeft=2)
     leftCont = uicls.Container(name='leftCont',
                                parent=self.topCont,
                                clipChildren=True)
     firstLine = uicls.Container(parent=leftCont,
                                 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/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)
     uicls.EveLabelLarge(parent=firstLine,
                         align=uiconst.CENTERLEFT,
                         state=uiconst.UI_NORMAL,
                         left=iconSize + 20,
                         text=text)
     secondLine = uicls.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 = uicls.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)
     uicls.EveLabelMedium(parent=labelCont, text=text, tabs=[100])
     firstLine = uicls.Container(name='firstLine',
                                 parent=rightCont,
                                 align=uiconst.TOTOP,
                                 height=80)
     secondLine = uicls.Container(name='secondLine',
                                  parent=rightCont,
                                  align=uiconst.TOTOP,
                                  height=40,
                                  top=3)
     totalPointsCont = uicls.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)))
     uicls.EveLabelSmall(
         parent=totalPointsCont,
         text=localization.GetByLabel('UI/FactionWarfare/Points'),
         align=uiconst.CENTERTOP,
         top=-15)
     uicls.Frame(bgParent=totalPointsCont, color=(0.392, 0.635, 0.212, 0.2))
     uicls.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 = uicls.EveCaptionMedium(
         parent=totalPointsCont,
         align=uiconst.CENTER,
         text=self.warZoneInfo.factionPoints)
     systemsCont = uicls.Container(
         parent=firstLine,
         align=uiconst.TOPLEFT,
         pos=(65, 5, 50, 100),
         state=uiconst.UI_NORMAL,
         hint=localization.GetByLabel(
             'UI/FactionWarfare/NumConqueredSystems'))
     uicls.Sprite(parent=systemsCont,
                  align=uiconst.CENTERTOP,
                  state=uiconst.UI_DISABLED,
                  pos=(0, 0, 32, 32),
                  texturePath='res:/UI/Texture/Icons/Systems_64.png')
     numSystems = len(
         sm.GetService('facwar').GetSolarSystemsOccupiedByFactions(
             [self.factionID]))
     self.numSystemsLabel = uicls.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 = uicls.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)))
         uicls.EveLabelMedium(parent=cont,
                              align=uiconst.CENTERTOP,
                              text=util.IntToRoman(i + 1),
                              top=-20)
         uicls.EveHeaderLarge(parent=cont, align=uiconst.CENTER, text=num)
Ejemplo n.º 8
0
    def ApplyAttributes(self, attributes):
        uicls.Window.ApplyAttributes(self, attributes)
        self.itemID = attributes.Get('itemID')
        lpPool = sm.GetService('facwar').GetSolarSystemLPs()
        topCont = uicls.Container(name='topCont',
                                  parent=self.sr.main,
                                  align=uiconst.TOTOP,
                                  height=40,
                                  padding=(self.PADSIDE, self.PADTOP,
                                           self.PADSIDE, self.PADSIDE))
        mainCont = uicls.ContainerAutoSize(name='mainCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOTOP)
        bottomCont = uicls.Container(name='bottomCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOBOTTOM,
                                     height=100,
                                     padTop=self.PADTOP)
        uicls.EveLabelLarge(parent=topCont,
                            text=localization.GetByLabel(
                                'UI/FactionWarfare/IHub/SystemUpgradePanel',
                                systemName=cfg.evelocations.Get(
                                    session.solarsystemid2).name),
                            align=uiconst.TOPLEFT,
                            top=5)
        uicls.EveLabelLarge(
            parent=topCont,
            text=localization.GetByLabel('UI/FactionWarfare/IHub/TotalLP'),
            align=uiconst.TOPRIGHT,
            top=5)
        self.lpPoolLabel = uicls.EveCaptionSmall(parent=topCont,
                                                 align=uiconst.TOPRIGHT,
                                                 top=25)
        limits = [0] + const.facwarSolarSystemUpgradeThresholds + [
            const.facwarSolarSystemMaxLPPool
        ]
        self.upgradeBars = []
        for i in xrange(1, 7):
            bar = uicls.FWUpgradeLevelCont(parent=mainCont,
                                           align=uiconst.TOTOP,
                                           padding=(self.PADSIDE, 0, 10, 10),
                                           lowerLimit=limits[i - 1],
                                           upperLimit=limits[i],
                                           lpAmount=lpPool,
                                           level=i,
                                           idx=0)
            self.upgradeBars.append(bar)

        self.bottomGradient = uicls.GradientSprite(bgParent=bottomCont,
                                                   rotation=-pi / 2,
                                                   rgbData=[(0, (0.3, 0.3,
                                                                 0.3))],
                                                   alphaData=[(0, 0.3),
                                                              (0.9, 0.0)])
        self.bottomFlashEffect = uicls.GradientSprite(bgParent=bottomCont,
                                                      rotation=-pi / 2,
                                                      rgbData=[(0, (0.6, 0.6,
                                                                    0.6))],
                                                      alphaData=[(0, 0.3),
                                                                 (0.9, 0.0)],
                                                      opacity=0.0)
        uicls.Line(parent=bottomCont,
                   align=uiconst.TOTOP,
                   color=(0.3, 0.3, 0.3, 0.3))
        bottomMainCont = uicls.Container(name='bottomMainCont',
                                         parent=bottomCont,
                                         align=uiconst.CENTER,
                                         width=450,
                                         height=100)
        self.myLPLabel = uicls.Label(parent=bottomMainCont,
                                     text=self.GetLPOwnedLabel(),
                                     align=uiconst.TOPLEFT,
                                     left=self.PADSIDE,
                                     top=self.PADTOP)
        self.bottomBottomCont = uicls.Container(name='bottomBottom',
                                                align=uiconst.TOPLEFT,
                                                pos=(self.PADSIDE, 40, 450,
                                                     25),
                                                parent=bottomMainCont)
        self.donateAmountEdit = uicls.SinglelineEdit(
            parent=self.bottomBottomCont,
            name='donateAmountEdit',
            align=uiconst.TOLEFT,
            setvalue=0,
            width=155,
            OnReturn=self.OnDonateLPBtn,
            OnChange=self.OnDonateValueChanged)
        self.donateBtn = uicls.Button(
            parent=self.bottomBottomCont,
            align=uiconst.TOLEFT,
            func=self.OnDonateLPBtn,
            label=localization.GetByLabel('UI/FactionWarfare/IHub/DonateLPs'),
            padLeft=4)
        self.donationReceivedLabel = uicls.EveCaptionMedium(
            name='donationReceivedLabel',
            parent=bottomMainCont,
            align=uiconst.TOPLEFT,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/DonationReceived'),
            left=self.PADSIDE,
            top=50,
            opacity=0.0)
        self.bottomTaxCont = uicls.Container(name='bottomTax',
                                             align=uiconst.TOPLEFT,
                                             pos=(self.PADSIDE, 73, 400, 25),
                                             parent=bottomMainCont)
        self.myLPToIhubLabel = None
        factionID = sm.GetService('facwar').GetSystemOccupier(
            session.solarsystemid)
        self.myLPTaxLabel = uicls.Label(
            name='myLPTaxLabel',
            parent=self.bottomTaxCont,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/maintenanceTax',
                tax=int(facwarCommon.GetDonationTax(factionID) * 100)),
            align=uiconst.TOLEFT,
            state=uiconst.UI_NORMAL,
            left=5)
        self.SetLPPoolAmount(lpPool)
        self.UpdateMyLPAmount()
        self.UpdateMyLPToIHubLabel()
        uthread.new(self.CheckOpenThread)
Ejemplo n.º 9
0
 def ConstructLayout(self):
     topCont = uicls.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, height=135, clipChildren=True, padding=(const.defaultPadding,
      0,
      const.defaultPadding,
      0))
     self.loadingCont = uicls.Container(name='loadingCont', parent=self.sr.main, align=uiconst.TOALL)
     self.loadingText = uicls.EveCaptionMedium(text='', parent=self.loadingCont, align=uiconst.CENTER)
     self.loadingCont.display = True
     self.historyCont = uicls.Container(name='historyCont', parent=self.sr.main, align=uiconst.TOALL, padding=(const.defaultPadding,
      const.defaultPadding * 2,
      const.defaultPadding,
      const.defaultPadding))
     self.historyCont.display = False
     line = uicls.Line(parent=topCont, align=uiconst.TOBOTTOM)
     textCont = uicls.Container(name='textCont', parent=topCont, align=uiconst.TOTOP, height=35)
     self.warDateLabel = uicls.EveLabelMedium(text='', parent=textCont, align=uiconst.CENTER)
     self.mutualWarLabel = uicls.EveLabelMedium(text=localization.GetByLabel('UI/Corporations/Wars/MutualWar'), parent=textCont, align=uiconst.CENTER)
     self.mutualWarLabel.display = False
     warInfoCont = uicls.Container(name='buttonCont', parent=topCont, align=uiconst.TOBOTTOM, height=33)
     self.surrenderBtn = uicls.ButtonIcon(name='surrenderBtn', parent=warInfoCont, align=uiconst.TOLEFT, width=24, iconSize=24, texturePath='res:/UI/Texture/Icons/Surrender_64.png', func=self.OpenSurrenderWnd)
     self.surrenderBtn.display = False
     self.allyBtn = uicls.ButtonIcon(name='allyBtn', parent=warInfoCont, align=uiconst.TORIGHT, width=24, iconSize=24, texturePath='res:/UI/Texture/Icons/Mercenary_64.png', func=self.OpenAllyWnd)
     warCont = uicls.Container(name='warCont', parent=topCont, align=uiconst.TOALL)
     attackerCont = uicls.Container(name='attackerCont', parent=warCont, align=uiconst.TOLEFT_PROP, width=0.45)
     attackerLogoCont = uicls.Container(name='attackerLogoCont', parent=attackerCont, align=uiconst.TORIGHT, width=64)
     self.attackerLogoDetailed = uicls.Container(name='attackerLogoDetailed', parent=attackerLogoCont, align=uiconst.TOPRIGHT, width=64, height=64)
     attackerTextCont = uicls.Container(name='attackerTextCont', parent=attackerCont, align=uiconst.TOALL, padding=(4, 0, 8, 4))
     self.attackerNameLabel = uicls.EveLabelLarge(text='', parent=attackerTextCont, align=uiconst.TOPRIGHT, state=uiconst.UI_NORMAL)
     self.attackerISKLostLabel = uicls.EveLabelMedium(text='', parent=attackerTextCont, align=uiconst.CENTERRIGHT, height=16)
     self.attackerShipsLostLabel = uicls.EveLabelMedium(text='', parent=attackerTextCont, align=uiconst.BOTTOMRIGHT)
     centerCont = uicls.Container(name='centerCont', parent=warCont, align=uiconst.TOLEFT_PROP, width=0.1)
     iconSize = 24
     swords = uicls.Icon(name='warIcon', parent=centerCont, align=uiconst.CENTER, size=iconSize, ignoreSize=True, state=uiconst.UI_NORMAL)
     swords.LoadIcon('res:/UI/Texture/Icons/swords.png')
     swords.SetAlpha(0.7)
     swords.hint = localization.GetByLabel('UI/Corporations/Wars/Vs')
     defenderCont = uicls.Container(name='defenderCont', parent=warCont, align=uiconst.TOLEFT_PROP, width=0.45)
     defenderLogoCont = uicls.Container(name='defenderLogoCont', parent=defenderCont, align=uiconst.TOLEFT, width=64)
     self.defenderLogoDetailed = uicls.Container(name='defenderLogoDetailed', parent=defenderLogoCont, align=uiconst.TOPLEFT, width=64, height=64)
     defenderTextCont = uicls.Container(name='defenderTextCont', parent=defenderCont, align=uiconst.TOALL, padding=(8, 0, 4, 4))
     self.defenderNameLabel = uicls.EveLabelLarge(text='', parent=defenderTextCont, state=uiconst.UI_NORMAL)
     self.defenderISKKilledLabel = uicls.EveLabelMedium(text='', parent=defenderTextCont, align=uiconst.CENTERLEFT, height=16)
     self.defenderShipsKilledLabel = uicls.EveLabelMedium(text='', parent=defenderTextCont, align=uiconst.BOTTOMLEFT)
     killsFilterCont = uicls.Container(name='killsFilterCont', parent=self.historyCont, align=uiconst.TOTOP, height=24)
     killOptions = [(localization.GetByLabel('UI/Corporations/Wars/ShowAllKills'), None), (localization.GetByLabel('UI/Corporations/Wars/ShowAggressorKills'), 'attacker'), (localization.GetByLabel('UI/Corporations/Wars/ShowDefenderKills'), 'defender')]
     comboSetting = settings.user.ui.Get('killComboValue', 0)
     self.killsFilterCombo = uicls.Combo(name='killsFilterCombo', parent=killsFilterCont, options=killOptions, adjustWidth=True, select=comboSetting, callback=self.OnKillComboChange)
     showGraph = settings.user.ui.Get('killShowGraph', 0)
     self.showGraph = uicls.Checkbox(text=localization.GetByLabel('UI/Corporations/Wars/ShowGraph'), parent=killsFilterCont, padLeft=self.killsFilterCombo.width + const.defaultPadding, checked=showGraph, callback=self.ShowGraph)
     self.killsParent = uicls.Container(name='killsParent', parent=self.historyCont, align=uiconst.TOALL)
     self.killsScroll = uicls.Scroll(name='killsScroll', parent=self.killsParent)
     self.killsByGroupParent = uicls.Container(name='killsByGroupParent', parent=self.historyCont, align=uiconst.TOALL)
     killGroupsCont = uicls.Container(name='killsFilterCont', parent=self.killsByGroupParent, align=uiconst.TOTOP, height=188)
     self.killGroupsTextCont = uicls.Container(name='killGroupsTextCont', parent=killGroupsCont, align=uiconst.TOLEFT, width=90)
     self.killGroupsLegendCont = uicls.Container(name='killGroupsTextCont', parent=killGroupsCont, align=uiconst.TOBOTTOM, height=20)
     self.killGroupsDataCont = uicls.Container(name='killGroupsDataCont', parent=killGroupsCont, align=uiconst.TOALL, padding=(const.defaultPadding,
      0,
      0,
      const.defaultPadding), bgColor=util.Color.GetGrayRGBA(0.4, 0.2))
     self.killGroupsScroll = uicls.Scroll(name='killGroupsScroll', parent=self.killsByGroupParent)
     self.LoadInfo(self.warID)
Ejemplo n.º 10
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     padding = 2 * const.defaultPadding
     self.contHeights = 30
     inputLeft = 130
     self.btns = None
     self.scope = 'station'
     self.SetWndIcon()
     self.SetTopparentHeight(64 + 2 * padding)
     self.SetMinSize([400, 220], 1)
     self.NoSeeThrough()
     self.MakeUnResizeable()
     self.MakeUncollapseable()
     self.topImage = uicls.Icon(
         parent=self.sr.topParent,
         pos=(padding, padding, 64, 64),
         texturePath='res:/UI/Texture/Icons/102_128_2.png',
         align=uiconst.TOPLEFT,
         idx=0)
     self.captionLabel = uicls.EveCaptionMedium(parent=self.sr.topParent,
                                                name='itemName',
                                                align=uiconst.CENTERLEFT,
                                                text='',
                                                pos=(64 + 2 * padding, 0,
                                                     320, 0))
     firstCont = uicls.Container(parent=self.sr.main,
                                 name='firstCont',
                                 align=uiconst.TOTOP,
                                 pos=(0, 0, 0, self.contHeights))
     self.firstLabel = uicls.EveLabelSmall(text='',
                                           parent=firstCont,
                                           name='firstLabel',
                                           align=uiconst.CENTERLEFT,
                                           left=padding,
                                           top=0)
     self.firstValue = uicls.EveLabelSmall(text='',
                                           parent=firstCont,
                                           name='firstValue',
                                           align=uiconst.CENTERLEFT,
                                           left=inputLeft,
                                           top=0)
     qtyCont = uicls.Container(parent=self.sr.main,
                               name='secondCont',
                               align=uiconst.TOTOP,
                               pos=(0, 0, 0, self.contHeights))
     self.qtyLabel = uicls.EveLabelSmall(
         text=localization.GetByLabel('UI/Common/Quantity'),
         parent=qtyCont,
         name='secondLabel',
         align=uiconst.CENTERLEFT,
         left=padding,
         top=0)
     self.qtyEdit = uicls.SinglelineEdit(name='qtyEdit',
                                         parent=qtyCont,
                                         setvalue=0,
                                         maxLength=32,
                                         pos=(inputLeft, 0, 60, 0),
                                         label='',
                                         align=uiconst.CENTERLEFT,
                                         ints=[0, 1000000])
     self.qtyEdit.OnChange = self.OnChanged_quantity
     self.qtyAvailLabel = uicls.EveLabelSmall(text='',
                                              parent=qtyCont,
                                              name='qtyAvailLabel',
                                              align=uiconst.CENTERLEFT,
                                              left=self.qtyEdit.left +
                                              self.qtyEdit.width + padding,
                                              top=0)
     totalCont = uicls.Container(parent=self.sr.main,
                                 name='totalCont',
                                 align=uiconst.TOTOP,
                                 pos=(0, 0, 0, self.contHeights))
     width = self.width - inputLeft - 20
     self.totalLabel = uicls.EveLabelSmall(text='',
                                           parent=totalCont,
                                           name='totalLabel',
                                           align=uiconst.CENTERLEFT,
                                           left=padding,
                                           top=0)
     self.totalValueLabel = uicls.CaptionLabel(text='',
                                               parent=totalCont,
                                               align=uiconst.CENTERLEFT,
                                               left=inputLeft,
                                               uppercase=False,
                                               letterspace=0,
                                               width=width)