Example #1
0
 def AddCloneLocation(self, stationID, stationName, stationTypeID, isRemote,
                      func):
     if isRemote:
         if stationID == session.hqID:
             title = localization.GetByLabel(
                 'UI/Medical/Clone/CorporationHeadquarters')
         else:
             title = localization.GetByLabel(
                 'UI/Medical/Clone/CorporationOffice')
         parent = self.remote
         color = self.BLUE_COLOR
     else:
         if stationID in (session.stationid2, session.structureid):
             title = localization.GetByLabel('UI/Medical/Clone/ThisStation')
         else:
             title = localization.GetByLabel(
                 'UI/Medical/Clone/SchoolHeadquarters')
         parent = self.local
         color = self.GREEN_COLOR
     container = uicontrols.ContainerAutoSize(parent=parent,
                                              align=uiconst.TOTOP,
                                              alignMode=uiconst.TOTOP,
                                              state=uiconst.UI_PICKCHILDREN,
                                              bgColor=(0.2, 0.2, 0.2, 0.3))
     container.DisableAutoSize()
     label = "<url=showinfo:%d//%d alt='%s'>%s</url>" % (
         stationTypeID, stationID, title, stationName)
     uicontrols.EveLabelMediumBold(parent=container,
                                   align=uiconst.TOTOP,
                                   text=title,
                                   padding=(7, 5, 0, 0),
                                   color=color)
     uicontrols.EveLabelMediumBold(parent=container,
                                   align=uiconst.TOTOP,
                                   state=uiconst.UI_NORMAL,
                                   text=label,
                                   padding=(7, 0, 140, 5))
     if stationID != self.homeStationID:
         uicontrols.Button(parent=container,
                           label=localization.GetByLabel(
                               'UI/Medical/Clone/SetHomeStationButton'),
                           align=uiconst.CENTERRIGHT,
                           fontsize=13,
                           fixedwidth=140,
                           fixedheight=30,
                           pos=(5, 0, 0, 0),
                           func=func)
     else:
         uicontrols.EveLabelMediumBold(
             parent=container,
             align=uiconst.CENTERRIGHT,
             text=localization.GetByLabel(
                 'UI/Medical/Clone/CurrentHomeStation'),
             padding=(-15, 0, 0, 0))
     uiprimitives.Line(parent=parent,
                       align=uiconst.TOTOP,
                       color=self.LINE_COLOR)
     container.EnableAutoSize()
Example #2
0
 def ConstructLayout(self):
     uicontrols.EveLabelLargeBold(
         name='caption',
         parent=self.sr.topParent,
         text=localization.GetByLabel('UI/SecurityOffice/HeaderCaption'),
         top=20,
         left=98)
     uicontrols.EveLabelSmall(
         name='subcaption',
         parent=self.sr.topParent,
         text=localization.GetByLabel(
             'UI/SecurityOffice/WindowSubheaderDescription'),
         top=40,
         left=98)
     self.securityTagBar = uicls.SecurityTagBar(parent=self.sr.main)
     bottomContainer = uiprimitives.Container(name='bottomContainer',
                                              parent=self.sr.main,
                                              align=uiconst.TOBOTTOM,
                                              height=40)
     self.iskCostText = uicontrols.EveLabelMediumBold(
         parent=bottomContainer, align=uiconst.CENTERLEFT, left=8)
     self.submitButton = uicontrols.Button(
         parent=bottomContainer,
         align=uiconst.CENTERRIGHT,
         left=8,
         label=localization.GetByLabel('UI/SecurityOffice/ExchangeTags'),
         func=self.Submit)
     self.CreateTextFeedback()
     uicontrols.GradientSprite(parent=bottomContainer,
                               align=uiconst.TOALL,
                               rotation=-math.pi / 2,
                               rgbData=[(0, (0.3, 0.3, 0.3))],
                               alphaData=[(0, 0.5), (0.9, 0.15)],
                               state=uiconst.UI_DISABLED)
 def Layout(self):
     """
     Setup UI controls for this window.
     """
     self.HideHeader()
     self.MakeUnResizeable()
     self.container = uicontrols.ContainerAutoSize(parent=self.GetMainArea(), align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, padding=(15, 15, 15, 0), callback=self.OnContainerResized, opacity=0.0)
     uicontrols.EveLabelLargeBold(parent=self.container, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/ActivateHeading'))
     uicontrols.EveLabelMedium(parent=self.container, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/ActivateDescription'), color=self.GRAY_COLOR, padding=(0, 5, 0, 10))
     uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR)
     slot1 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3))
     self.slot1Background = uiprimitives.Fill(parent=slot1, color=self.BLUE_COLOR, opacity=0.0)
     self.slot1Title = uicontrols.EveLabelMediumBold(parent=slot1, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/GameTime'), padding=(60, 12, 140, 0), color=self.BLUE_COLOR)
     self.slot1Expiry = uicontrols.EveLabelMediumBold(parent=slot1, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR)
     self.slot1Button = uicontrols.Button(parent=slot1, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0))
     self.slot1Icon = Sprite(parent=slot1, texturePath='res:/UI/Texture/classes/CharacterSelection/plex_timer.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32))
     uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR)
     slot2 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3))
     self.slot2Background = uiprimitives.Fill(parent=slot2, color=self.BLUE_COLOR, opacity=0.0)
     self.slot2Title = uicontrols.EveLabelMediumBold(parent=slot2, align=uiconst.TOTOP, text='', padding=(60, 12, 140, 0), color=self.WHITE_COLOR)
     self.slot2Expiry = uicontrols.EveLabelMediumBold(parent=slot2, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR)
     self.slot2Button = uicontrols.Button(parent=slot2, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0))
     self.slot2Icon = Sprite(parent=slot2, texturePath='res:/UI/Texture/Icons/add_training_queue.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32))
     uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR)
     slot3 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3))
     self.slot3Background = uiprimitives.Fill(parent=slot3, color=self.BLUE_COLOR, opacity=0.0)
     self.slot3Title = uicontrols.EveLabelMediumBold(parent=slot3, align=uiconst.TOTOP, text='', padding=(60, 12, 140, 0), color=self.WHITE_COLOR)
     self.slot3Expiry = uicontrols.EveLabelMediumBold(parent=slot3, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR)
     self.slot3Button = uicontrols.Button(parent=slot3, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0))
     self.slot3Icon = Sprite(parent=slot3, texturePath='res:/UI/Texture/Icons/add_training_queue.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32))
     uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR)
     slot4 = Container(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3), height=70)
     self.slot4Background = uiprimitives.Fill(parent=slot4, color=self.BLUE_COLOR, opacity=0.0)
     self.slot4Title = uicontrols.EveLabelMediumBold(parent=slot4, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/Donate'), padding=(60, 12, 140, 0), color=self.BLUE_COLOR)
     self.slot4Edit = SearchInput(parent=slot4, align=uiconst.TOTOP, padding=(60, 0, 140, 10), height=18, color=self.GRAY_COLOR, GetSearchEntries=self.Search, OnSearchEntrySelected=self.OnSearchEntrySelected, hinttext=localization.GetByLabel('UI/ActivatePlex/SearchHint'))
     self.slot4Edit.SetHistoryVisibility(False)
     self.entryContainer = Container(parent=slot4, align=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, padding=(60, 0, 140, 10), height=32, bgColor=(0, 0, 0, 0.3))
     self.entryContainer.display = False
     self.slot4Button = uicontrols.Button(parent=slot4, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0))
     self.slot4Button.Disable()
     self.slot4Icon = Sprite(parent=slot4, texturePath='res:/UI/Texture/classes/CharacterSelection/plex_timer.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32))
     self.entryContainerIcon = Sprite(parent=self.entryContainer, texturePath='', align=uiconst.CENTERLEFT, pos=(0, 0, 32, 32))
     clipContainer = Container(parent=self.entryContainer, clipChildren=True, padding=(40, 0, 36, 0))
     self.entryContainerTitle = uicontrols.EveLabelMediumBold(parent=clipContainer, align=uiconst.CENTERLEFT, text='', width=150)
     self.entryContainerButton = uicontrols.ButtonIcon(parent=self.entryContainer, texturePath='res:/UI/Texture/Icons/73_16_210.png', align=uiconst.TOPRIGHT, func=self.ResetSearch, width=16, height=16, iconSize=16)
     uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR)
     self.closeButton = uicontrols.Button(parent=self.container, label='', func=self.Close, align=uiconst.TOTOP, fontsize=13, padding=(120, 10, 120, 30))
     uicore.animations.FadeTo(self.container, startVal=0.0, endVal=1.0, duration=0.5)
 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 = uicontrols.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 = uicontrols.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 = uicontrols.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 = uicontrols.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 = uicontrols.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 = uicontrols.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,
                                               padBottom=4,
                                               state=uiconst.UI_NORMAL,
                                               readonly=1)
     self.sr.detailsText.HideBackground()
     self.sr.detailsText.RemoveActiveFrame()
     FrameUnderlay(parent=self.sr.detailsText,
                   colorType=uiconst.COLORTYPE_UIHILIGHT)
     tabs = [110, 540]
     self.sr.infoText = uicontrols.EveLabelMedium(name='infoText',
                                                  text='',
                                                  parent=self.sr.descrCont,
                                                  top=const.defaultPadding,
                                                  idx=0,
                                                  tabs=tabs,
                                                  state=uiconst.UI_NORMAL)
     self.sr.joinBtn = btn = uicontrols.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 = uicontrols.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 = uiprimitives.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 = uicontrols.ButtonGroup(
         btns=self.myAdvertButtons,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertCaption = uicontrols.EveCaptionMedium(
         text='',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOTOP,
         left=0,
         top=7,
         state=uiconst.UI_DISABLED)
     self.sr.myAdvertDescCont = uiprimitives.Container(
         name='myAdvertDescCont',
         parent=self.sr.myAdvertCont,
         align=uiconst.TOALL,
         pos=(0, 0, 0, 0))
     self.sr.myAdvertText = uicontrols.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 = uicontrols.ButtonGroup(
         btns=self.myAdvertButtons_Register,
         parent=self.sr.myAdvertButtons,
         unisize=1)
     self.sr.myAdvertButtonWnd_Register.state = uiconst.UI_HIDDEN
Example #5
0
    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        currentSafetyLevel = attributes.get('safetyLevel')
        self.isTabStop = True
        self.confirmationButton = None
        self.anchor = attributes.get('anchor')
        self.canBeModified = attributes.get('canBeModified', True)
        FillThemeColored(bgParent=self, opacity=OPACITY_BG)
        self.lineTrace = None
        bodyText = '<center>%s</center>' % localization.GetByLabel(
            'UI/Crimewatch/SafetyLevel/SafetyLevelSelectionBody',
            suspectColor=crimewatchConst.Colors.Yellow.GetHex(),
            criminalColor=crimewatchConst.Colors.Red.GetHex())
        captionCont = uiprimitives.Container(parent=self,
                                             align=uiconst.TOTOP,
                                             name='captionCont',
                                             height=24)
        text = uicontrols.EveLabelMediumBold(
            parent=captionCont,
            align=uiconst.CENTERTOP,
            text='<center>%s</center>' % localization.GetByLabel(
                'UI/Crimewatch/SafetyLevel/SafetySettingsCaption'),
            width=self.width - 2 * TEXT_PADDING,
            padTop=TEXT_PADDING,
            color=util.Color.WHITE)
        textCont = uiprimitives.Container(parent=self,
                                          align=uiconst.TOTOP,
                                          name='textCont')
        text = uicontrols.EveLabelSmall(parent=textCont,
                                        align=uiconst.CENTERTOP,
                                        text=bodyText,
                                        width=self.width - 2 * TEXT_PADDING,
                                        padTop=TEXT_PADDING)
        textCont.height = text.textheight + 2 * TEXT_PADDING
        uiprimitives.Container(parent=self,
                               align=uiconst.TOTOP,
                               name='padding',
                               height=TEXT_PADDING)
        self.securityButtons = []
        for safetyLevel in (const.shipSafetyLevelNone,
                            const.shipSafetyLevelPartial,
                            const.shipSafetyLevelFull):
            cont = uiprimitives.Container(parent=self,
                                          name='SecButtonCont',
                                          align=uiconst.TOTOP,
                                          height=44)
            securityButton = SecurityButton(parent=cont,
                                            safetyLevel=safetyLevel,
                                            align=uiconst.CENTERTOP,
                                            canBeModified=self.canBeModified)
            securityButton.SetSelected(safetyLevel == currentSafetyLevel)
            securityButton.OnClick = (self.OnSecurityButtonClick,
                                      securityButton)
            self.securityButtons.append(securityButton)

        height = 0
        for container in self.children:
            if container.GetAlign() == uiconst.TOTOP:
                height += container.height

        self.height = height
        alignToTop = IsShipHudTopAligned()
        self.DrawFrame(alignToTop)
        self.DrawPointer(alignToTop)
        self.SetPosition(alignToTop)
        self.opacity = 0.0
        uicore.animations.FadeIn(self, duration=0.1, loops=1)
        uicore.registry.SetFocus(self)