Exemplo n.º 1
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.streamBtn = None
     self.topCont = ContainerAutoSize(name='topCont',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      padding=(10, 10, 10, 0))
     self.loginCont = Container(name='loginCont',
                                parent=self.sr.main,
                                align=uiconst.TOTOP,
                                height=120,
                                padding=5)
     self.settingsCont = ContainerAutoSize(name='settingsCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOTOP,
                                           padding=5)
     self.ConstructTopCont()
     self.ConstructLoginCont()
     self.ConstructSettingsCont()
     self.ConstructBottomButtons()
     self.bottomGradient = GradientSprite(bgParent=self.btnGroup,
                                          rotation=-pi / 2,
                                          rgbData=[(0, (0.3, 0.3, 0.3))],
                                          alphaData=[(0, 0.3), (0.9, 0.0)])
     self.UpdateState()
     self.CheckEnableStreamBtn()
     if bool(session.role & ROLE_PROGRAMMER):
         self.debugLabel = Label(parent=self.topCont,
                                 align=uiconst.TOPLEFT,
                                 top=120)
Exemplo n.º 2
0
 def ApplyAttributes(self, attributes):
     super(VgsLoadingPanel, self).ApplyAttributes(attributes)
     text = attributes.get('text', None)
     mainCont = ContainerAutoSize(parent=self,
                                  align=uiconst.CENTER,
                                  alignMode=uiconst.TOTOP,
                                  width=1)
     wheelWrap = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP)
     VgsLoadingWheel(parent=wheelWrap, align=uiconst.CENTER)
     labelWrap = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP)
     VgsLabelLarge(parent=labelWrap, align=uiconst.CENTER, text=text)
Exemplo n.º 3
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     Sprite(
         parent=self,
         align=uiconst.TOLEFT,
         width=259,
         texturePath='res:/UI/Texture/classes/shipTree/frame/bottomLeft.png'
     )
     cont = ContainerAutoSize(parent=self, align=uiconst.TOLEFT, padLeft=4)
     Label(parent=cont,
           align=uiconst.TOPLEFT,
           text=GetByLabel('UI/ShipTree/Showing'),
           uppercase=True,
           top=38,
           fontsize=9,
           color=COLOR_FONT)
     Label(parent=self,
           text='V1.%s.%s' % (len(cfg.shiptypes), macho.version),
           uppercase=True,
           top=43,
           left=82,
           fontsize=10,
           color=COLOR_FONT)
     Label(parent=cont,
           align=uiconst.TOPLEFT,
           text=GetByLabel('UI/ShipTree/MilitaryAndIndustrialVessels'),
           uppercase=True,
           top=49,
           fontsize=9,
           color=COLOR_FONT)
     self.AddSeperator(uiconst.TOLEFT)
     self.AddSeperator(uiconst.TORIGHT)
     Label(parent=ContainerAutoSize(align=uiconst.TORIGHT,
                                    parent=self,
                                    padLeft=4),
           align=uiconst.TOPLEFT,
           text=GetByLabel('UI/ShipTree/CourtesyLabel'),
           uppercase=True,
           top=49,
           fontsize=9,
           color=COLOR_FONT)
     self.AddSeperator(uiconst.TORIGHT)
     StretchSpriteHorizontal(
         parent=Container(parent=self, padding=(4, 0, 4, 0)),
         align=uiconst.TOBOTTOM,
         texturePath='res:/UI/Texture/classes/ShipTree/frame/bottomLine.png',
         leftEdgeSize=20,
         rightEdgeSize=20,
         height=2)
Exemplo n.º 4
0
 def ApplyAttributes(self, attributes):
     super(PurchaseSuccessPanel, self).ApplyAttributes(attributes)
     text = attributes.pop('text', localization.GetByLabel(self.default_text))
     subText = attributes.pop('subText', localization.GetByLabel(self.default_subText) if self.default_subText is not None else None)
     mainCont = ContainerAutoSize(parent=self, align=uiconst.CENTER, alignMode=uiconst.TOTOP, width=1)
     iconCont = Container(parent=mainCont, align=uiconst.TOTOP, height=72)
     self.iconForegroundTransform = Transform(parent=iconCont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5))
     self.iconForeground = Sprite(parent=self.iconForegroundTransform, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=self.ICON_FOREGROUND, width=72, height=64, opacity=0)
     self.iconBackgroundTransform = Transform(parent=iconCont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5))
     self.iconBackground = Sprite(parent=self.iconBackgroundTransform, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=self.ICON_BACKGROUND, width=72, height=64, opacity=0)
     labelCont = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP, top=4)
     VgsLabelLarge(parent=labelCont, align=uiconst.CENTER, text=text)
     if subText:
         self.subTextCont = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP, top=12, opacity=0)
         VgsLabelSmall(parent=self.subTextCont, align=uiconst.CENTER, width=460, text='<center>%s</center>' % subText)
 def ConstructLayout(self):
     headerContainer = Container(parent=self,
                                 align=uiconst.TOTOP,
                                 height=28,
                                 padTop=4,
                                 padBottom=6)
     self.groupName = EveLabelLarge(parent=headerContainer,
                                    align=uiconst.CENTERLEFT,
                                    left=8)
     Frame(texturePath=
           'res:/UI/Texture/classes/Achievements/pointRightHeaderFrame.png',
           cornerSize=16,
           offset=-14,
           parent=headerContainer,
           color=(1, 1, 1, 0.25),
           align=uiconst.TOALL)
     progressClipper = Container(parent=headerContainer,
                                 align=uiconst.TOALL,
                                 clipChildren=True,
                                 padRight=-POINTER_PADRIGHT)
     self.progress = Frame(
         texturePath=
         'res:/UI/Texture/classes/Achievements/pointRightHeaderBackground.png',
         cornerSize=15,
         offset=-13,
         parent=progressClipper,
         color=(1, 1, 1, 0.25))
     self.progress.padRight = 400
     self.progress.opacity = 0.0
     self.tasksContainer = ContainerAutoSize(parent=self,
                                             name='tasksContainer',
                                             align=uiconst.TOTOP,
                                             state=uiconst.UI_NORMAL)
Exemplo n.º 6
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.sr.entries = ContainerAutoSize(parent=self,
                                         name='_entries',
                                         align=uiconst.TOTOP,
                                         padding=(0, 1, 0, 1))
     self.Prepare_()
Exemplo n.º 7
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     mainArea = self.GetMainArea()
     mainArea.padding = 6
     self._selectedObject = None
     self.SetTopparentHeight(0)
     self._infoContainer = Container(parent=mainArea, align=uiconst.TOTOP, height=72)
     self.searchInput = SinglelineEdit(parent=self._infoContainer, align=uiconst.BOTTOMRIGHT, left=4, top=8, width=100, OnChange=self.OnSearchInputChange, hinttext='Search')
     self.searchInput.SetHistoryVisibility(False)
     self.searchInput.ShowClearButton()
     m = UtilMenu(menuAlign=uiconst.TOPRIGHT, parent=self._infoContainer, align=uiconst.TOPRIGHT, GetUtilMenu=self.SettingMenu)
     self._infoLabel = Label(parent=self._infoContainer, state=uiconst.UI_DISABLED, color=(1.0, 1.0, 1.0, 0.75), left=2)
     self.searchResultParent = ContainerAutoSize(parent=mainArea, align=uiconst.TOTOP_NOPUSH, padding=(26, -6, 4, 0), bgColor=(0.5, 0.5, 0.5, 1))
     self.attributeScroll = Scroll(parent=mainArea, align=uiconst.TOBOTTOM, name='attributeScroll')
     self.attributeScroll.height = min(self.height / 2, max(72, settings.user.ui.Get('uitree_attributeScroll_height', 200)))
     settings.user.ui.Set('uitree_attributeScroll_height', self.attributeScroll.height)
     self.divider = Divider(align=uiconst.TOBOTTOM, parent=mainArea, height=11, state=uiconst.UI_NORMAL)
     self.divider.OnChange_ = self.OnDividerMove
     self.divider.OnChangeStart_ = self.OnDividerMoveStart
     Fill(parent=self.divider, align=uiconst.CENTER, pos=(0, 0, 20, 1))
     self.scroll = Scroll(parent=mainArea, name='treeScroll')
     self._hiliteFrame = Fill(parent=uicore.desktop, align=uiconst.ABSOLUTE, color=(0, 1, 0, 0.3), idx=0, state=uiconst.UI_DISABLED)
     self._selectedFrame = Frame(parent=uicore.desktop, align=uiconst.ABSOLUTE, color=(0, 1, 0, 0.3), idx=0, state=uiconst.UI_DISABLED)
     self.ReloadUIRoots()
     uthread.new(self.UpdateInfo)
     self._keyDownCookie = uicore.uilib.RegisterForTriuiEvents([uiconst.UI_KEYDOWN], self.OnGlobalKeyDown)
 def ConstructNormal(self):
     self.mainCont.Flush()
     completedText = self.GetCompletedText()
     subTextCont = Container(parent=self.mainCont,
                             name='subTextCont',
                             align=uiconst.TOTOP,
                             height=20)
     self.backSprite = Sprite(
         name='arrow',
         parent=subTextCont,
         pos=(0, 0, 14, 14),
         texturePath=
         'res:/UI/Texture/Classes/InfoPanels/opportunitiesReturnArrow.png',
         state=uiconst.UI_NORMAL,
         align=uiconst.CENTERLEFT)
     self.backSprite.OnClick = self.OnBackClicked
     self.backSprite.display = False
     self.subTextLabel = EveLabelMediumBold(parent=subTextCont,
                                            align=uiconst.CENTERLEFT,
                                            text=completedText,
                                            state=uiconst.UI_DISABLED)
     self.subTextLabel.OnClick = self.OnBackClicked
     self.achievementContent = ContainerAutoSize(parent=self.mainCont,
                                                 name='achievementContent',
                                                 height=30,
                                                 align=uiconst.TOTOP,
                                                 padBottom=4)
     groupID = settings.user.ui.Get('opportunities_infoPanel_group', None)
     self.LoadContent(groupID)
Exemplo n.º 9
0
    def Layout(self):
        self.ghostClip = Container(name='ghostClip',
                                   parent=self.clipCont,
                                   clipChildren=True)
        self.mainCont.SetParent(self.ghostClip)
        self.ghostCont = ContainerAutoSize(parent=self.clipCont,
                                           align=uiconst.TOPLEFT,
                                           alignMode=uiconst.TOPLEFT,
                                           clipChildren=True)
        self.ghostList = FlowContainer(parent=self.ghostCont,
                                       align=uiconst.TOPLEFT,
                                       width=ENTRY_EXPANDED_WIDTH,
                                       contentSpacing=(0, 4),
                                       idx=0)
        self.ghostShadow = GradientSprite(parent=self.ghostClip,
                                          align=uiconst.TOPLEFT,
                                          state=uiconst.UI_DISABLED,
                                          height=12,
                                          width=ENTRY_EXPANDED_WIDTH,
                                          rgbData=[(0, (0.0, 0.0, 0.0))],
                                          alphaData=[(0, 0.0), (0.8, 0.6),
                                                     (1, 1.0)],
                                          rotation=math.pi / 2,
                                          opacity=0.0,
                                          idx=0)

        def AutoSizeCallback():
            height = self.ghostList.height
            self.mainCont.padTop = -height
            self.ghostClip.padTop = height

        self.ghostCont.callback = AutoSizeCallback
Exemplo n.º 10
0
 def _GetInfoCont(self):
     self.currProductTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/Producing'))
     self.ingredientsTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/SchematicInput'),
         top=50)
     self.ingredientsTxt.state = uiconst.UI_DISABLED
     self.ingredientCont = ContainerAutoSize(parent=self.infoContLeft,
                                             top=63,
                                             state=uiconst.UI_PICKCHILDREN)
     self.RenderIngredientGauges()
     self.currCycleGauge = uicls.Gauge(
         parent=self.infoContRight,
         value=0.0,
         color=planetCommon.PLANET_COLOR_CYCLE,
         width=140)
     self.amountPerCycleTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerCycle'),
         top=40)
     self.amountPerHourTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'),
         top=70)
Exemplo n.º 11
0
 def BuildUI(self, thisWeek, nextWeek):
     self.topCont = ContainerAutoSize(name='topCont', parent=self.sr.main, alignMode=uiconst.TOTOP, align=uiconst.TOTOP, padTop=6)
     LineThemeColored(parent=self.topCont, align=uiconst.TOBOTTOM)
     self.topCont.GetAutoSize = self.GetTopContAutoSize
     self.comboCont = Container(parent=self.topCont, align=uiconst.TORIGHT)
     text = GetByLabel('UI/Structures/Deployment/ModifyingVulnerabilitySchedule', count=len(self.infoOnStructures))
     EveLabelLarge(parent=self.topCont, align=uiconst.TOTOP, left=10, top=4, text=text)
     self.AddCombos()
     btnGroup = ButtonGroup(parent=self.sr.main, idx=0)
     saveBtn = btnGroup.AddButton(GetByLabel('UI/Common/Buttons/Save'), func=self.Save)
     parent = Container(parent=self.sr.main, padding=(10, 10, 10, 0))
     mouseParent = Container(parent=parent, align=uiconst.TOBOTTOM, height=46)
     mouseCont = MouseCont(parent=mouseParent, inMoveMode=False, align=uiconst.TORIGHT_PROP, width=0.5)
     labelCont = GridContainer(parent=parent, align=uiconst.TOTOP, columns=2, lines=1, height=30)
     lableSubCont1 = Container(parent=labelCont)
     lableSubCont2 = Container(parent=labelCont)
     EveLabelMedium(parent=lableSubCont1, text=GetByLabel('UI/StructureProfiles/ThisWeek'), align=uiconst.CENTERLEFT)
     EveLabelMedium(parent=lableSubCont2, text=GetByLabel('UI/StructureProfiles/NextWeek'), align=uiconst.CENTERLEFT)
     self.leftSide = Container(parent=parent, width=0.5, align=uiconst.TOLEFT_PROP)
     self.rightSide = Container(parent=parent, align=uiconst.TOALL)
     thisWeekSchedule = structures.Schedule(thisWeek, required=self.requiredHours)
     w1 = VulnerabilitySchedulerWithReinforcement(parent=self.leftSide, canModify=False, schedule=thisWeekSchedule, frame=False, padRight=10)
     Sprite(name='lock', parent=w1.weekContParent, pos=(0, 0, 54, 64), align=uiconst.CENTER, texturePath='res:/UI/Texture/Classes/StructureDeployment/lock.png', state=uiconst.UI_DISABLED)
     w1.opacity = 0.3
     self.nextWeekSchedule = structures.Schedule(nextWeek, required=self.requiredHours)
     self.w2 = VulnerabilitySchedulerWithReinforcement(parent=self.rightSide, canModify=True, schedule=self.nextWeekSchedule, frame=False, padRight=10)
     self.ChangeSignalConnection(connect=True)
Exemplo n.º 12
0
 def CreateInfoBox(self, upperText, lowerText, upperSize, lowerSize):
     textLayer = Container(name='TextLayer',
                           parent=self,
                           align=uiconst.TOALL)
     infoBox = ContainerAutoSize(name='InfoBox',
                                 parent=textLayer,
                                 align=uiconst.TOBOTTOM,
                                 height=INFO_BOX_HEIGHT,
                                 state=uiconst.UI_DISABLED,
                                 bgColor=OFFER_TEXT_BOX_COLOR)
     Label(parent=infoBox,
           align=uiconst.TOTOP,
           text=upperText,
           fontsize=upperSize,
           padding=(INFO_PADDING, 2, INFO_PADDING, -2),
           fontStyle=fontConst.STYLE_HEADER,
           uppercase=True,
           lineSpacing=-0.15)
     AurAmountContainer(parent=infoBox,
                        align=uiconst.TOTOP,
                        height=20,
                        amount=self.offer.price,
                        baseAmount=self.offer.basePrice,
                        padLeft=8,
                        padBottom=2)
Exemplo n.º 13
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.MakeUnstackable()
     self.MakeUnResizeable()
     self.MakeUncollapseable()
     self.scheduleStepBuilt = False
     self.structureTypeID = attributes.typeID
     self.height = 100
     self.width = self.default_width
     self.step = STEP_POSITION
     self.controller = attributes.controller
     self.structureDeploymentCont = StructureDeploymentCont(
         parent=self.sr.main,
         controller=self.controller,
         align=uiconst.TOBOTTOM,
         positionCallback=self.OnPositionBtnClicked,
         confirmCallback=self.OnConfirmBtnClicked)
     self.structureDeploymentCont.ChangeMouseDisplayFade(faded=False,
                                                         animated=True)
     requiredHours = sm.GetService(
         'clientDogmaIM').GetDogmaLocation().GetModifiedTypeAttribute(
             self.structureTypeID, const.attributeVulnerabilityRequired)
     self.mySchedule = structures.Schedule(required=int(requiredHours))
     self.scheduleContParent = Container(parent=self.sr.main,
                                         name='scheduleContParent',
                                         padding=(10, 4, 10, 4),
                                         controller=self.controller)
     self.explanationCont = ContainerAutoSize(parent=self.sr.main,
                                              name='explanationCont',
                                              alignMode=uiconst.TOTOP,
                                              align=uiconst.TOTOP)
     self.BuildExplanationStep()
     self.ChangeSignalConnection()
Exemplo n.º 14
0
 def ConstructNormal(self, blinkAchievementID=None):
     if not self.achievementContent or self.achievementContent.destroyed:
         self.mainCont.Flush()
         self.achievementContent = ContainerAutoSize(
             parent=self.mainCont,
             name='achievementContent',
             align=uiconst.TOTOP,
             alignMode=uiconst.TOTOP)
         grid = LayoutGrid(parent=self.mainCont,
                           align=uiconst.TOTOP,
                           columns=2,
                           opacity=0.0)
         button = ButtonIcon(
             texturePath=
             'res:/ui/Texture/Classes/InfoPanels/opportunitiesTreeIcon.png',
             align=uiconst.TOPLEFT,
             iconSize=16,
             parent=grid,
             func=self.OpenOpportunitiesTree,
             pos=(0, 0, 16, 16))
         subTextLabel = InfoPanelLabel(parent=grid,
                                       align=uiconst.CENTERLEFT,
                                       text='See all opportunities',
                                       state=uiconst.UI_NORMAL,
                                       fontsize=EVE_SMALL_FONTSIZE,
                                       bold=True,
                                       left=4)
         subTextLabel.OnClick = self.OpenOpportunitiesTree
         uicore.animations.FadeIn(grid)
     groupID = sm.GetService('achievementSvc').GetActiveAchievementGroupID()
     self.LoadContent(groupID, blinkAchievementID=blinkAchievementID)
Exemplo n.º 15
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     Sprite(
         parent=self,
         align=uiconst.TOLEFT,
         width=126,
         texturePath='res:/UI/Texture/classes/shipTree/frame/topLeft.png')
     cont = ContainerAutoSize(
         parent=self,
         align=uiconst.TOLEFT,
         alignMode=uiconst.TOPLEFT,
         bgTexturePath='res:/UI/Texture/classes/shipTree/frame/topMiddle.png'
     )
     Label(parent=cont,
           text=GetByLabel('UI/ShipTree/InterbusShipIdentificationSystem'),
           color=COLOR_BG,
           top=3,
           fontsize=12,
           uppercase=True,
           bold=True,
           padRight=4)
     StretchSpriteHorizontal(
         parent=Container(parent=self),
         align=uiconst.TOTOP,
         texturePath='res:/UI/Texture/classes/ShipTree/frame/topRight.png',
         leftEdgeSize=40,
         rightEdgeSize=5,
         height=26)
Exemplo n.º 16
0
 def ConstructInventoryIcons(self):
     cargoDroneCont = ContainerAutoSize(name='cargoDroneCont',
                                        parent=self.overlayCont,
                                        align=uiconst.BOTTOMLEFT,
                                        width=110,
                                        left=const.defaultPadding,
                                        top=4)
     if IsControllingStructure():
         cargoSlot = CargoStructureAmmoBay(name='structureCargoSlot',
                                           parent=cargoDroneCont,
                                           align=uiconst.TOTOP,
                                           height=32,
                                           controller=self.controller)
         SetFittingTooltipInfo(cargoSlot, 'StructureAmmoHold')
     else:
         cargoSlot = CargoCargoSlots(name='cargoSlot',
                                     parent=cargoDroneCont,
                                     align=uiconst.TOTOP,
                                     height=32,
                                     controller=self.controller)
         SetFittingTooltipInfo(cargoSlot, 'CargoHold')
     self.fighterAndDroneCont = Container(name='fighterAndDroneCont',
                                          parent=cargoDroneCont,
                                          align=uiconst.TOTOP,
                                          height=32)
     self.ContructDroneAndFighterIcons()
Exemplo n.º 17
0
    def ConstructChildren(self):
        self.childrenInitialized = True
        children = self.data.GetChildren()
        if self.destroyed:
            return
        if self.childCont is None:
            self.childCont = ContainerAutoSize(parent=self,
                                               name='childCont',
                                               align=uiconst.TOTOP,
                                               clipChildren=True,
                                               state=uiconst.UI_HIDDEN)
        if children:
            for child in children:
                cls = self.GetTreeViewEntryClassByTreeData(child)
                child = cls(parent=self.childCont,
                            parentEntry=self,
                            level=self.level + 1,
                            eventListener=self.eventListener,
                            data=child,
                            settingsID=self.settingsID,
                            state=uiconst.UI_HIDDEN)
                child.UpdateLabel()

            if self.childCont.children:
                self.childCont.children[-1].padBottom = 5
            self.toggleBtn.state = uiconst.UI_NORMAL
Exemplo n.º 18
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.MakeUnMinimizable()
     self.MakeUnpinable()
     self.MakeUnstackable()
     mainArea = self.GetMainArea()
     mainArea.clipChildren = True
     self.isFadingOut = False
     leftSide = Container(parent=mainArea,
                          align=uiconst.TOLEFT,
                          width=AURA_SIZE * 0.8)
     auraSprite = Sprite(
         parent=leftSide,
         texturePath='res:/UI/Texture/classes/achievements/auraAlpha.png',
         pos=(0, -4, AURA_SIZE, AURA_SIZE),
         align=uiconst.CENTERTOP)
     self.mainContent = ContainerAutoSize(parent=self.GetMainArea(),
                                          align=uiconst.TOTOP,
                                          alignMode=uiconst.TOTOP,
                                          padding=(0, 6, 10, 10))
     self.opacity = 0.0
     self.fadeoutState = FADE_STATE_OUT
     self.sizeTimer = AutoTimer(10, self.UpdateWindowSize)
     if not settings.char.ui.Get('opportunities_aura_introduced', False):
         settings.char.ui.Set('opportunities_aura_introduced', True)
         self.Step_Intro()
     elif attributes.loadAchievementTask:
         self.Step_TaskInfo_Manual(attributes.loadAchievementTask,
                                   attributes.loadAchievementGroup)
     else:
         self.UpdateOpportunityState()
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.node = attributes.node
     self.factionID = self.node.factionID
     self.shipGroupID = self.node.shipGroupID
     self.iconsPerRow = self.node.GetIconsPerRow()
     self.typeIDs = sm.GetService('shipTree').GetShipTypeIDs(self.factionID, self.shipGroupID)
     self.zoomLevel = sm.GetService('shipTreeUI').GetZoomLevel()
     self.iconSize = self.node.GetIconSize()
     nodeNum = attributes.nodeNum
     self.groupNameLabel = EveHeaderMedium(name='groupNameLabel', parent=self, align=uiconst.TOPLEFT, text=GetByMessageID(cfg.fsdInfoBubbleGroups[self.shipGroupID].nameID), left=43, top=0)
     self.iconAndBar = ShipGroupIconAndSkillBar(parent=self, top=20, node=self.node)
     self.shipContainer = ContainerAutoSize(name='shipContainer', parent=self, align=uiconst.TOPLEFT, height=self.iconSize, left=46, top=24)
     self.LoadShips()
     self.lineTop = StretchSpriteHorizontal(name='lineTop', parent=self, align=uiconst.TOTOP, texturePath='res:/UI/Texture/Classes/ShipTree/Groups/frameUpper.png', leftEdgeSize=4, rightEdgeSize=4, height=3, padTop=16)
     width = len(self.typeIDs) % self.iconsPerRow or self.iconsPerRow
     width = self.iconSize * width + 4
     self.lineBottom = StretchSpriteHorizontal(name='lineBottom', parent=self, align=uiconst.BOTTOMLEFT, texturePath='res:/UI/Texture/Classes/ShipTree/Groups/frameLower.png', leftEdgeSize=4, rightEdgeSize=4, height=1, width=width, left=43, top=-7)
     self.UpdateState(nodeNum, animate=False)
     zoomLevel = sm.GetService('shipTreeUI').GetZoomLevel()
     if zoomLevel == ZOOMED_OUT:
         self.groupNameLabel.opacity = 0.0
         self.lineTop.opacity = 0.0
         self.lineBottom.opacity = 0.0
Exemplo n.º 20
0
 def ConstructLayout(self):
     if not self.jobData:
         return
     if self.jobData.status == industry.STATUS_READY:
         self.deliverBtn = Button(
             name='deliverBtn',
             parent=self,
             align=uiconst.TOALL,
             label='<b>' + localization.GetByLabel('UI/Industry/Deliver'),
             func=self.OnDeliverBtn,
             padding=2)
         self.deliverBtn.width = self.deliverBtn.height = 0
         self.deliverBtn.Blink(time=3000)
         self.Enable()
     else:
         self.Disable()
         gaugeCont = ContainerAutoSize(name='gaugeCont',
                                       parent=self,
                                       align=uiconst.TOBOTTOM)
         mainCont = Container(name='mainCont', parent=self)
         self.deliverBtn = None
         self.valueLabel = EveLabelMedium(parent=mainCont,
                                          align=uiconst.CENTERLEFT,
                                          left=4)
     if self.jobData.status == industry.STATUS_INSTALLED:
         color = industryUIConst.COLOR_MANUFACTURING if self.jobData.activityID == industry.MANUFACTURING else industryUIConst.COLOR_SCIENCE
         self.gauge = Gauge(parent=gaugeCont,
                            align=uiconst.TOTOP,
                            state=uiconst.UI_DISABLED,
                            color=color,
                            height=6,
                            gaugeHeight=6,
                            padTop=1,
                            backgroundColor=(1.0, 1.0, 1.0, 0.05))
Exemplo n.º 21
0
 def ApplyAttributes(self, attributes):
     self.iconCont = None
     TreeViewEntry.ApplyAttributes(self, attributes)
     self.iconCont = ContainerAutoSize(parent=self.topRightCont,
                                       align=uiconst.CENTERLEFT,
                                       height=16)
     self.fleetAccessBtn = ButtonIcon(
         name='fleetAccessBtn',
         parent=self.iconCont,
         align=uiconst.TOLEFT,
         width=14,
         iconSize=14,
         texturePath='res:/UI/Texture/classes/Inventory/fleetAccess.png',
         func=self.OnFleetAccessBtn,
         colorSelected=COLOR_SELECTED)
     self.corpAccessBtn = ButtonIcon(
         name='corpAccessBtn',
         parent=self.iconCont,
         align=uiconst.TOLEFT,
         width=14,
         padLeft=1,
         iconSize=12,
         texturePath='res:/UI/Texture/classes/Inventory/corpAccess.png',
         func=self.OnCorpAccessBtn,
         colorSelected=COLOR_SELECTED)
     self.UpdateFleetIcon()
     self.UpdateCorpIcon()
Exemplo n.º 22
0
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.main = ContainerAutoSize(parent=self.sr.main,
                                   name='main',
                                   padding=3,
                                   state=uiconst.UI_PICKCHILDREN,
                                   align=uiconst.TOTOP,
                                   alignMode=uiconst.TOTOP)
     self.planetUISvc = sm.GetService('planetUI')
     self.planetSvc = sm.GetService('planetSvc')
     self.pin = attributes.Get('pin', None)
     self.uiEffects = uicls.UIEffects()
     self.showingActionContainer = False
     self.currentRoute = None
     self.showNext = None
     self.lastCalled = None
     self.commodityToRoute = None
     self.buttonTextValue = ''
     infoCont = Container(parent=self.main,
                          name='infoCont',
                          padding=5,
                          align=uiconst.TOTOP,
                          height=self.INFO_CONT_HEIGHT)
     self.infoContLeft = Container(name='leftCol',
                                   parent=infoCont,
                                   align=uiconst.TOLEFT_PROP,
                                   width=0.5)
     self.infoContRight = Container(name='rightCol',
                                    parent=infoCont,
                                    align=uiconst.TOLEFT_PROP,
                                    width=0.5)
     self._GetInfoCont()
     self._UpdateInfoCont()
     self.buttonCont = GridContainer(parent=self.main,
                                     name='buttonCont',
                                     height=40,
                                     align=uiconst.TOTOP,
                                     padding=(-1, 0, -1, 0))
     BumpedUnderlay(bgParent=self.buttonCont)
     self.buttonCont.lines = 1
     self.buttonCont.columns = 6
     self.buttonTextCont = self._DrawAlignTopCont(22, 'buttonTextCont')
     self.buttonText = EveLabelSmall(parent=self.buttonTextCont,
                                     align=uiconst.CENTER,
                                     color=(1.0, 1.0, 1.0, 1.0),
                                     state=uiconst.UI_NORMAL)
     self.buttonTextCont.height = max(22, self.buttonText.textheight)
     self.actionCont = Container(parent=self.sr.main,
                                 name='actionCont',
                                 padding=(6, 0, 6, 6),
                                 clipChildren=True)
     self.SetCaption(self._GetPinName())
     self.main.SetSizeAutomatically()
     self.height = self.GetBaseHeight()
     self.LoadActionButtons(self._GetActionButtons())
     uicore.animations.FadeTo(self, 0.0, 1.0, duration=0.3)
     self.updateInfoContTimer = base.AutoTimer(100, self._UpdateInfoCont)
     sm.GetService('audio').SendUIEvent(
         'wise:/msg_pi_pininteraction_open_play')
     self.ResizeActionCont(None)
    def _ShowDetails(self):
        if not self.autoShowDetails:
            return
        self.detailsParent = ContainerAutoSize(align=uiconst.TOTOP, parent=self, clipChildren=True)
        if self.callbackTaskExpanded:
            self.callbackTaskExpanded(self)
        self.detailsParent.DisableAutoSize()
        label = EveLabelMedium(parent=self.detailsParent, text=self.achievementTask.description, align=uiconst.TOTOP, padding=(6, 3, 6, 2))
        extraInfo = ACHIEVEMENT_TASK_EXTRAINFO.get(self.achievementTask.achievementID, None)
        if extraInfo:
            grid = LayoutGrid(parent=self.detailsParent, align=uiconst.TOTOP, cellPadding=1, columns=2, padLeft=4, padBottom=2)
            for taskInfoEntry in extraInfo:
                if isinstance(taskInfoEntry, TaskInfoEntry_Text):
                    label = EveLabelMedium(text=taskInfoEntry.text, color=taskInfoEntry.textColor, width=240, state=uiconst.UI_NORMAL)
                    grid.AddCell(label, colSpan=2)
                elif isinstance(taskInfoEntry, TaskInfoEntry_ImageText):
                    texturePath = taskInfoEntry.GetTexturePath()
                    icon = Sprite(name='icon', parent=grid, pos=(0,
                     0,
                     taskInfoEntry.imageSize,
                     taskInfoEntry.imageSize), texturePath=texturePath, state=uiconst.UI_DISABLED, align=uiconst.CENTER, color=taskInfoEntry.imageColor)
                    text = GetByLabel(taskInfoEntry.textPath)
                    label = EveLabelMedium(text=text, color=taskInfoEntry.textColor, width=220, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL)
                    grid.AddCell(label)

        blue.synchro.Yield()
        height = self.detailsParent.GetAutoSize()[1]
        uicore.animations.FadeIn(self.detailsParent, duration=0.3)
        uicore.animations.MorphScalar(self.detailsParent, 'height', self.detailsParent.height, height, duration=0.25, sleep=True)
        self.detailsParent.EnableAutoSize()
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     pushContent = attributes.pushContent or self.pushContent
     showUnderlay = attributes.Get('showUnderlay',
                                   self.default_showUnderlay)
     self.scrollbarsDisabled = False
     self.scrollToVerticalPending = None
     self.scrollToHorizontalPending = None
     self.noContentHint = None
     self.verticalScrollBar = ScrollBar(
         parent=self,
         align=uiconst.TORIGHT if pushContent else uiconst.TORIGHT_NOPUSH)
     self.verticalScrollBar.OnScrolled = self._OnVerticalScrollBar
     self.horizontalScrollBar = ScrollBar(
         parent=self,
         align=uiconst.TOBOTTOM if pushContent else uiconst.TOBOTTOM_NOPUSH)
     self.horizontalScrollBar.OnScrolled = self._OnHorizontalScrollBar
     self.clipCont = Container(name='clipCont',
                               parent=self,
                               clipChildren=True)
     self.mainCont = ContainerAutoSize(name='mainCont',
                                       parent=self.clipCont,
                                       state=uiconst.UI_NORMAL)
     self.mainCont._OnSizeChange_NoBlock = self._OnMainContSizeChange
     self.children.insert = self._InsertChild
     self.children.append = self._AppendChild
     self.children.remove = self._RemoveChild
     self._mouseHoverCookie = uicore.uilib.RegisterForTriuiEvents(
         uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
     if showUnderlay:
         self.underlay = BumpedUnderlay(bgParent=self)
     else:
         self.underlay = None
Exemplo n.º 25
0
 def CreateWindow(self):
     self.capitalSystemInfo = sm.GetService('alliance').GetCapitalSystemInfo()
     self.systems = sm.RemoteSvc('stationSvc').GetSystemsForAlliance(session.allianceid)
     alliance = sm.GetService('alliance').GetAlliance()
     self.isExecDirector = self._IsDirectorInExecCorp(alliance.executorCorpID)
     infoCont = ContainerAutoSize(parent=self, align=uiconst.TOTOP, padding=(const.defaultPadding,
      const.defaultPadding,
      const.defaultPadding,
      0))
     topCont = Container(parent=infoCont, height=42, align=uiconst.TOTOP)
     FillThemeColored(parent=topCont, colorType=uiconst.COLORTYPE_UIHEADER, opacity=0.15)
     texturePath = 'res:/ui/Texture/classes/Sov/capitalSystem.png'
     Sprite(name='capitalIcon', parent=topCont, texturePath=texturePath, width=32, height=32, align=uiconst.CENTERLEFT, left=4)
     EveLabelLarge(text=GetByLabel('UI/Sovereignty/AllianceCapital'), parent=topCont, align=uiconst.CENTERLEFT, left=42, top=-8)
     EveLabelSmall(text=GetByLabel('UI/Sovereignty/SelectCapitalSystemDescription'), parent=topCont, align=uiconst.CENTERLEFT, left=42, top=8)
     currentSystemCont = Container(parent=infoCont, height=24, align=uiconst.TOTOP)
     self.currentCapitalLabel = EveLabelMedium(text='', left=4, parent=currentSystemCont, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL)
     self.capitalLabel = EveLabelMedium(text=GetByLabel('UI/Sovereignty/CurrentCapital'), left=22, parent=currentSystemCont, align=uiconst.CENTERRIGHT)
     self.capitalSprite = Sprite(name='capitalIcon', parent=currentSystemCont, texturePath='res:/ui/Texture/classes/Sov/CapitalStarSelection.png', width=16, height=16, align=uiconst.CENTERRIGHT, left=4)
     self.SetDisplayOfCapitalLabelAndIcon(False)
     self.futureSystemCont = Container(parent=infoCont, height=24, align=uiconst.TOTOP)
     self.futureSystemLabel = EveLabelMedium(text='', left=4, parent=self.futureSystemCont, align=uiconst.CENTERLEFT)
     self.futureSystemTime = EveLabelMedium(text='', left=4, parent=self.futureSystemCont, align=uiconst.CENTERRIGHT)
     self.removeBtn = ButtonIcon(texturePath='res:/UI/Texture/Icons/73_16_210.png', pos=(4, 0, 16, 16), align=uiconst.CENTERRIGHT, parent=self.futureSystemCont, idx=0, func=self.RemoveCapital, hint=GetByLabel('UI/Common/Buttons/Cancel'))
     self.removeBtn.display = False
     if self.isExecDirector:
         self.removeBtn.display = True
         self.futureSystemTime.left = 22
     self.futureSystemCont.display = False
     self.claimedSystems = ClaimedSystemsDashboard(parent=self, padTop=const.defaultPadding)
     self.claimedSystems.CreateWindow()
     self.UpdateCapitalInfo()
Exemplo n.º 26
0
 def Layout(self):
     Fill(bgParent=self, color=(0, 0, 0, 0.2))
     BlurredBackgroundSprite(bgParent=self, color=(1, 1, 1, 0.9))
     headerContainer = ContainerAutoSize(parent=self,
                                         align=uiconst.TOTOP,
                                         alignMode=uiconst.TOPLEFT)
     self.completedFill = FillThemeColored(
         bgParent=headerContainer,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         opacity=0.0)
     self.headerFill = InfoPanelHeaderBackground(bgParent=headerContainer)
     headerGrid = LayoutGrid(parent=headerContainer)
     if self.quest.isComplete:
         texturePath = RES_COMPLETED
     else:
         texturePath = RES_AVAILABLE
     self.check = Sprite(align=uiconst.TOPLEFT,
                         state=uiconst.UI_DISABLED,
                         texturePath=texturePath,
                         width=14,
                         height=14)
     headerGrid.AddCell(self.check, cellPadding=(4, 3, 4, 3))
     headerGrid.AddCell(EveLabelMedium(align=uiconst.TOPLEFT,
                                       text=self.quest.titleLabel),
                        cellPadding=(0, 2, 0, 2))
     self.timer = EveLabelMedium(parent=headerContainer,
                                 align=uiconst.CENTERRIGHT,
                                 state=uiconst.UI_DISABLED,
                                 left=4,
                                 opacity=0.0)
 def _SetupHistoryArea(self):
     self.historySettingsContainer = ContainerAutoSize(
         name='HistorySettings',
         align=uiconst.TOTOP,
         parent=self.rightContainer,
         alignMode=uiconst.TOTOP,
         padding=(self.basePadLeft, 0, 0, 0))
     EveLabelMediumBold(
         name='History',
         align=uiconst.TOTOP,
         parent=self.historySettingsContainer,
         text=localization.GetByLabel(
             'Notifications/NotificationSettings/HistoryHeader'))
     self._MakeSeperationLine(self.historySettingsContainer)
     Button(
         name='Restore Notification History Button',
         align=uiconst.TOTOP,
         label=localization.GetByLabel(
             'Notifications/NotificationSettings/RestoreNotificationHistory'
         ),
         func=self.OnExportHistoryClick,
         pos=(0, 0, 100, 20),
         parent=self.historySettingsContainer,
         padding=(5, 5, 50, 5))
     Button(
         name='clearNotificationHistoryBtn',
         align=uiconst.TOTOP,
         label=localization.GetByLabel(
             'Notifications/NotificationSettings/ClearNotificationHistory'),
         func=self.OnClearHistoryClick,
         pos=(0, 0, 100, 20),
         parent=self.historySettingsContainer,
         padding=(5, 0, 50, 5))
Exemplo n.º 28
0
 def thread():
     self.details = ContainerAutoSize(parent=self,
                                      align=uiconst.TOTOP,
                                      clipChildren=True)
     self.details.DisableAutoSize()
     EveLabelMedium(parent=self.details,
                    align=uiconst.TOTOP,
                    padding=(6, 3, 6, 2),
                    text=self.quest.descriptionLabel)
     EveLabelMedium(
         parent=self.details,
         align=uiconst.TOTOP,
         padding=(6, 3, 6, 2),
         text=localization.GetByLabel('UI/Quest/RewardTitle'))
     EveLabelMedium(parent=self.details,
                    align=uiconst.TOTOP,
                    padding=(12, 6, 6, 12),
                    text=self.quest.rewardLabel)
     _, height = self.details.GetAutoSize()
     animations.FadeIn(self.details, duration=0.3)
     animations.MorphScalar(self.details,
                            'height',
                            startVal=self.details.height,
                            endVal=height,
                            duration=0.25,
                            callback=self.details.EnableAutoSize)
Exemplo n.º 29
0
    def Load(self):
        self.Flush()
        topCont = ContainerAutoSize(parent=self,
                                    align=uiconst.TOTOP,
                                    padding=(0, 2, 0, 2))
        btnGroup = ToggleButtonGroup(parent=topCont,
                                     align=uiconst.CENTER,
                                     height=38,
                                     width=248,
                                     callback=self.LoadActivity)
        for activityID in industry.ACTIVITIES:
            isDisabled = activityID not in self.bpData.activities
            color = industryUIConst.GetActivityColor(activityID)
            color = color[:3] + (0.5, )
            btnGroup.AddButton(
                activityID,
                iconPath=industryUIConst.ACTIVITY_ICONS_LARGE[activityID],
                iconSize=26,
                colorSelected=color,
                isDisabled=isDisabled,
                btnClass=ActivityToggleButtonGroupButton,
                activityID=activityID)

        self.activityNameLabel = EveLabelMediumBold(name='label',
                                                    parent=self,
                                                    align=uiconst.TOTOP,
                                                    padding=(6, 0, 0, 0))
        self.scroll = Scroll(parent=self, padding=const.defaultPadding)
        activityID = self.GetSelectedActivityID(activityID)
        btnGroup.SelectByID(activityID)
Exemplo n.º 30
0
 def Layout(self):
     self.HideHeader()
     self.MakeUnResizeable()
     self.SetWndIcon(self.iconNum, mainTop=2, mainLeft=6)
     self.SetTopparentHeight(self.TOP_PARENT_HEIGHT)
     station = cfg.stations.Get(session.stationid2)
     WndCaptionLabel(parent=self.sr.topParent,
                     align=uiconst.RELATIVE,
                     text=localization.GetByLabel('UI/Medical/Medical'),
                     subcaption=station.stationName)
     self.container = ContainerAutoSize(parent=self.GetMainArea(),
                                        align=uiconst.TOTOP,
                                        alignMode=uiconst.TOTOP,
                                        state=uiconst.UI_PICKCHILDREN,
                                        padding=(self.PADDING, self.PADDING,
                                                 self.PADDING,
                                                 self.PADDING),
                                        callback=self.OnContainerResized,
                                        opacity=0.0)
     EveLabelLargeBold(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/MedicalClone'))
     EveLabelMedium(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/MedicalCloneDescription'),
         color=GRAY_COLOR,
         padding=(0, 0, 0, self.HALF_PADDING))
     self.homeStation = CreateSectionContainer(self.container)
     EveLabelLargeBold(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/ActiveClone'),
         padding=(0, self.PADDING, 0, 0))
     EveLabelMedium(parent=self.container,
                    align=uiconst.TOTOP,
                    text=localization.GetByLabel(
                        'UI/Medical/DestroyActiveCloneDescription'),
                    color=GRAY_COLOR,
                    padding=(0, 0, 0, self.HALF_PADDING))
     EveLabelMediumBold(parent=self.container,
                        align=uiconst.TOTOP,
                        text=localization.GetByLabel(
                            'UI/Medical/DestroyActiveCloneWarning'),
                        color=RED_COLOR,
                        padding=(0, 0, 0, self.HALF_PADDING))
     self.activeClone = CreateSectionContainer(self.container)
     EveLabelLargeBold(parent=self.container,
                       align=uiconst.TOTOP,
                       text=localization.GetByLabel('UI/Medical/JumpClone'),
                       padding=(0, self.PADDING, 0, 0))
     EveLabelMedium(
         parent=self.container,
         align=uiconst.TOTOP,
         text=localization.GetByLabel('UI/Medical/JumpCloneDescription'),
         color=GRAY_COLOR,
         padding=(0, 0, 0, self.HALF_PADDING))
     self.jumpClone = CreateSectionContainer(self.container)
     animations.FadeIn(self.container, duration=0.5)