Exemplo n.º 1
0
    def CreateBlackboard(self, scopeText, channels, scope):
        grid = LayoutGrid(columns=3,
                          parent=self.blackboardScroll,
                          align=uiconst.TOTOP,
                          cellPadding=3,
                          cellSpacing=4)
        row = grid.AddRow(bgColor=(1, 1, 1, 0.1))
        headerLabel = eveLabel.EveLabelMediumBold(text=scopeText,
                                                  align=uiconst.CENTERLEFT,
                                                  state=uiconst.UI_NORMAL)
        headerLabel.GetMenu = lambda: [(
            'Copy Scope', blue.pyos.SetClipboardData(str(scope)))]
        row.AddCell(cellObject=headerLabel, colSpan=3, bpColor=(1, 1, 1, 0.05))
        for message, time, value in sorted(channels):
            row = grid.AddRow(bgColor=(1, 1, 1, 0.05))
            row.AddCell(cellObject=CopyLabelSmallBold(text=message,
                                                      align=uiconst.CENTERLEFT,
                                                      color=(0.4, 0.8, 1.0),
                                                      messageName=message,
                                                      messageValue=value,
                                                      wnd=self,
                                                      blackboardScope=scope))
            row.AddCell(cellObject=eveLabel.EveLabelSmallBold(
                text=FmtDate(time, 'nl') if time else str(time),
                align=uiconst.CENTERLEFT))
            row.AddCell(cellObject=CopyLabelSmallBold(text=str(value),
                                                      align=uiconst.CENTERLEFT,
                                                      color=(0.4, 0.8, 1.0),
                                                      messageName=message,
                                                      messageValue=value,
                                                      wnd=self,
                                                      blackboardScope=scope))

        Container(parent=self.blackboardScroll, height=16, align=uiconst.TOTOP)
Exemplo n.º 2
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     grid = LayoutGrid(parent=self, columns=2)
     self.auraSprite = Sprite(pos=(14, 0, 80, 80), texturePath='res:/UI/Texture/classes/achievements/auraAlpha.png')
     grid.AddCell(self.auraSprite, rowSpan=2)
     header = EveLabelLarge(parent=grid, text='Welcome!', top=16)
     message = EveLabelMedium(parent=grid, text='Welcome blurb', width=300)
Exemplo n.º 3
0
 def DrawNumbers(self):
     self.numbersGrid = LayoutGrid(parent=self.bottomRight,
                                   columns=2,
                                   align=uiconst.TORIGHT,
                                   top=self.numbersGridTop)
     if self.showTaxAndBrokersFee:
         self.brokersFee = EveLabelMedium(text='', padRight=4)
         self.numbersGrid.AddCell(self.brokersFee)
         self.brokersFeeAmt = EveLabelMediumBold(text='',
                                                 align=uiconst.CENTERRIGHT,
                                                 padLeft=4)
         self.numbersGrid.AddCell(self.brokersFeeAmt)
         self.salesTax = EveLabelMedium(text='', padRight=4)
         self.numbersGrid.AddCell(self.salesTax)
         self.salesTaxAmt = EveLabelMediumBold(text='',
                                               align=uiconst.CENTERRIGHT,
                                               padLeft=4)
         self.numbersGrid.AddCell(self.salesTaxAmt)
         spacer = Container(align=uiconst.TOTOP, height=12)
         self.numbersGrid.AddCell(spacer, colSpan=2)
     self.totalAmt = EveLabelLargeBold(text='',
                                       align=uiconst.CENTERRIGHT,
                                       padLeft=4,
                                       state=uiconst.UI_NORMAL)
     self.numbersGrid.AddCell(self.totalAmt, colSpan=2)
Exemplo n.º 4
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.textLabels = []
     self.grid = LayoutGrid(parent=self,
                            columns=3,
                            margin=3,
                            OnGridSizeChanged=self.OnGridSizeChanged)
Exemplo n.º 5
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 _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 LoadMarkerTooltipPanel(self, tooltipPanel, *args, **kwds):
        tooltipPanel.state = uiconst.UI_NORMAL
        tooltipPanel.columns = 1
        tooltipPanel.margin = 2
        scrollContainer = ScrollContainer(parent=tooltipPanel,
                                          pos=(0, 0, 200, 200),
                                          align=uiconst.TOPLEFT)
        self.tooltipScrollContainer = weakref.ref(scrollContainer)
        grid = LayoutGrid(parent=scrollContainer)
        grid.OnGridSizeChanged = self.OnGridSizeChanged
        grid.cellPadding = 4
        grid.state = uiconst.UI_NORMAL
        grid.columns = 3
        if self.overlapMarkers:
            sortList = []
            for markerObject in self.overlapMarkers:
                if getattr(markerObject, 'celestialData', None):
                    label = cfg.evelocations.Get(
                        markerObject.celestialData.itemID).name
                    sortList.append(((markerObject.celestialData.groupID,
                                      label.lower()), markerObject))
                else:
                    sortList.append(((0, 0), markerObject))

            for _label, markerObject in sorted(sortList):
                grid.AddRow(rowClass=CelestialTooltipRow,
                            markerObject=markerObject)

        grid.AddRow(rowClass=CelestialTooltipRow, markerObject=self)
        scrollContainer.ScrollToVertical(1.0)
        uthread.new(self.UpdateTooltipPosition, tooltipPanel)
Exemplo n.º 8
0
    def LoadTooltip(self, *args, **kwds):
        if self.owner.markerObject.markerHandler.IsMarkerPickOverridden():
            return
        sortList = []
        overlapMarkers = self.owner.markerObject.markerHandler.GetIntersectingMarkersForMarker(
            self.owner.markerObject)
        if overlapMarkers:
            for markerObject in overlapMarkers:
                if not markerObject.tooltipRowClass:
                    continue
                sortList.append(
                    (markerObject.GetOverlapSortValue(), markerObject))

        if len(sortList) == 1:
            return
        self.overlappingMarkers = sortList
        self.SetBackgroundAlpha(TOOLTIP_OPACITY)
        self.margin = 3
        scroll = ScrollContainer(align=uiconst.TOPLEFT, parent=self)
        scroll.isTabStop = False
        scroll.verticalScrollBar.align = uiconst.TORIGHT_NOPUSH
        scroll.verticalScrollBar.width = 3
        self.scroll = scroll
        subGrid = LayoutGrid(parent=scroll,
                             align=uiconst.TOPLEFT,
                             columns=1,
                             name='markersTooltipSubGrid')
        self.subGrid = subGrid
        self.sideContainer = BracketTooltipSidePanel(
            align=uiconst.TOPLEFT,
            parent=self.parent,
            idx=self.parent.children.index(self))
        self.sideContainer.display = False
        uthread.new(self.UpdateSideContainer)
        self.LoadEntries()
Exemplo n.º 9
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     self.columns = 4
     self.buttonIconByGroupKey = {}
     self.onSettingsChangedCallback = attributes.onSettingsChangedCallback
     self.mapViewID = attributes.mapViewID
     MapViewCheckboxOptionButton(
         parent=self,
         settingGroupKeys=(VIEWMODE_LAYOUT_SETTINGS,
                           VIEWMODE_LINES_SETTINGS,
                           VIEWMODE_LAYOUT_SHOW_ABSTRACT_SETTINGS),
         callback=self.OnSettingsChanged,
         mapViewID=self.mapViewID)
     MapViewColorModeSettingButton(parent=self,
                                   settingGroupKey=VIEWMODE_COLOR_SETTINGS,
                                   callback=self.OnSettingsChanged,
                                   mapViewID=self.mapViewID)
     MapViewMarkersSettingButton(parent=self,
                                 callback=self.OnSettingsChanged,
                                 mapViewID=self.mapViewID)
     focusSelf = ButtonIcon(
         parent=self,
         width=26,
         height=26,
         iconSize=16,
         func=self.FocusSelf,
         hint=localization.GetByLabel('UI/Map/FocusCurrentLocation'),
         texturePath='res:/UI/Texture/classes/MapView/focusIcon.png')
     focusSelf.tooltipPointer = uiconst.POINT_TOP_1
Exemplo n.º 10
0
 def LoadTooltipPanelNoStructure(self, tooltipPanel, *args):
     tooltipPanel.state = uiconst.UI_NORMAL
     tooltipPanel.columns = 2
     tooltipPanel.margin = 2
     tooltipPanel.cellPadding = 1
     texturePath = self.GetTexturePaths(self.structureInfo['typeID'], large=True)
     icon = Sprite(width=48, height=48, state=uiconst.UI_DISABLED, texturePath=texturePath, opacity=dashboardConst.NO_STRUCTURE_ALPHA)
     tooltipPanel.AddCell(icon)
     structureTypeID = self.structureInfo['typeID']
     if structureTypeID == const.typeTerritorialClaimUnit:
         headerText = GetByLabel('UI/Sovereignty/Unclaimed')
     else:
         headerText = GetByLabel('UI/Sovereignty/Uninstalled')
     if structureTypeID == const.typeOutpostConstructionPlatform:
         structureName = GetByLabel('UI/Common/LocationTypes/Station')
     else:
         structureName = evetypes.GetName(structureTypeID)
     tooltipPanel.AddLabelLarge(text=headerText, width=150, bold=True, align=uiconst.CENTERLEFT)
     l = LineThemeColored(width=200, height=1, align=uiconst.CENTER, opacity=0.3)
     tooltipPanel.AddCell(l, colSpan=2, cellPadding=(1, 1, 1, 3))
     deployText = GetByLabel('UI/Sovereignty/StructureMayBeDeployed', structureName=structureName)
     tooltipPanel.AddLabelMedium(text='<center>%s</center>' % deployText, align=uiconst.CENTER, width=190, colSpan=2)
     buttonGrid = LayoutGrid(columns=2, align=uiconst.CENTER, cellPadding=2)
     showInfoBtn = ShowInfoButton(parent=buttonGrid, typeID=structureTypeID)
     showMarketDetailsBtn = ShowMarketDetailsButton(parent=buttonGrid, typeID=structureTypeID)
     tooltipPanel.AddCell(cellObject=buttonGrid, colSpan=2, cellPadding=3)
Exemplo n.º 11
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.º 12
0
    def ApplyAttributes(self, attributes):
        LayoutGrid.ApplyAttributes(self, attributes)
        self.columns = 5
        self.cellPadding = 1
        self.cellSpacing = 1
        self.margin = (2, 2, 2, 2)
        self.addClear = attributes.get('addClear', True)
        self.colorList = attributes['colorList']
        self.callback = attributes.callback
        currentColor = attributes.currentColor
        colorPos = (0, 0, 10, 10)
        for eachColor in self.colorList:
            if eachColor == currentColor:
                c = Container(name='colorFill', pos=colorPos, align=uiconst.NOALIGN, state=uiconst.UI_NORMAL)
                Frame(parent=c, name='selectedColorFrame', color=(1, 1, 1, 0.75))
                Fill(parent=c, name='colorFill', color=eachColor, padding=1)
            else:
                c = Fill(name='colorFill', pos=colorPos, color=eachColor, align=uiconst.NOALIGN, state=uiconst.UI_NORMAL)
            c.OnClick = (self.callback, eachColor)
            self.AddCell(cellObject=c, colSpan=1, cellPadding=1)

        if self.addClear:
            c = Frame(name='colorFill', pos=colorPos, color=(1, 1, 1, 0.2), align=uiconst.NOALIGN, state=uiconst.UI_NORMAL)
            c.OnClick = (self.callback, None)
            self.AddCell(cellObject=c, colSpan=1)
Exemplo n.º 13
0
 def LoadTooltip(self, bracket, overlaps, boundingBox, overlapSites, *args,
                 **kwds):
     self.overlaps = overlaps
     self.overlapSites = overlapSites
     self.scrollEnabled = False if self.GetNumberOfBrackets(
     ) <= 15 else True
     bracket.SetOrder(0)
     self.SetBackgroundAlpha(TOOLTIP_OPACITY)
     isFloating = bracket.IsFloating()
     if isFloating:
         self.isCompact = settings.user.ui.Get('bracketmenu_floating', True)
     else:
         self.isCompact = settings.user.ui.Get('bracketmenu_docked', False)
     self.LoadGeneric1ColumnTemplate()
     scroll = ScrollContainer(align=uiconst.TOPLEFT, parent=self)
     scroll.isTabStop = False
     scroll.verticalScrollBar.align = uiconst.TORIGHT_NOPUSH
     scroll.verticalScrollBar.width = 3
     self.scroll = scroll
     subGrid = LayoutGrid(parent=scroll,
                          align=uiconst.TOPLEFT,
                          columns=1 if self.isCompact else 3,
                          name='bracketTooltipSubGrid')
     self.subGrid = subGrid
     if self.isCompact:
         self.sideContainer = BracketTooltipSidePanel(
             align=uiconst.TOPLEFT,
             parent=self.parent,
             idx=self.parent.children.index(self))
         self.sideContainer.display = False
         uthread.new(self.UpdateSideContainer)
     self.LoadEntries()
     self.state = uiconst.UI_NORMAL
Exemplo n.º 14
0
 def Close(self, *args):
     LayoutGrid.Close(self, *args)
     if getattr(self, 'debugFrame', None):
         self.debugFrame.Close()
     if self.scaleTransform:
         self.scaleTransform.Close()
         self.scaleTransform = None
Exemplo n.º 15
0
    def Step_TaskInfo(self, achievementTask, activeGroup, manualLoad=False):
        self.FadeOutTransition()
        self.mainContent.Flush()
        if activeGroup:
            self.SetCaption(GetByLabel(activeGroup.groupName))
        self.LoadLargeText(achievementTask.name)
        self.LoadDivider()
        self.LoadMediumText(achievementTask.description)
        extraInfo = ACHIEVEMENT_TASK_EXTRAINFO.get(
            achievementTask.achievementID, None)
        if extraInfo:
            grid = LayoutGrid(parent=self.mainContent,
                              align=uiconst.TOTOP,
                              cellPadding=2,
                              columns=2)
            for taskInfoEntry in extraInfo:
                if isinstance(taskInfoEntry, TaskInfoEntry_Text):
                    label = EveLabelMedium(text=taskInfoEntry.text,
                                           color=taskInfoEntry.textColor,
                                           width=200)
                    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=180,
                                           align=uiconst.CENTERLEFT)
                    grid.AddCell(label)

        self.LoadTreeLink()
        self.SetOrder(0)
        settings.char.ui.Set('opportunities_suppress_taskinfo', False)
        if manualLoad:
            self.activeStep = STEP_TASK_INFO_MANUAL
        else:
            self.activeStep = STEP_TASK_INFO
        self.FadeInTransition()
Exemplo n.º 16
0
 def ApplyAttributes(self, attributes):
     attributes.align = uiconst.TOPLEFT
     LayoutGrid.ApplyAttributes(self, attributes)
     self.backgroundFrame = FrameWithPointer(bgParent=self, color=attributes.color)
     if attributes.owner:
         self.owner = attributes.owner
     else:
         self.opacity = 1.0
Exemplo n.º 17
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     EveLabelSmall(text=GetByLabel('Achievements/UI/active'), parent=self, align=uiconst.CENTERRIGHT)
     activeEffectSprite = SpriteThemeColored(parent=self, state=uiconst.UI_DISABLED, blendMode=trinity.TR2_SBM_ADDX2, texturePath='res:/UI/Texture/classes/Achievements/iconActiveLegend.png', pos=(0, 0, 20, 20))
     iconMap = [(GetByLabel('Achievements/UI/incomplete'), 'res:/UI/Texture/classes/Achievements/iconIncomplete.png'), (GetByLabel('Achievements/UI/partial'), 'res:/UI/Texture/classes/Achievements/iconPartial.png'), (GetByLabel('Achievements/UI/complete'), 'res:/UI/Texture/classes/Achievements/iconComplete.png')]
     for label, texturePath in iconMap:
         EveLabelSmall(text=label, parent=self, align=uiconst.CENTERRIGHT)
         GlowSprite(texturePath=texturePath, parent=self, pos=(0, 0, 20, 20))
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     self.nameLabel = EveLabelLarge(bold=True)
     self.AddCell(cellObject=self.nameLabel, colSpan=self.columns)
     EveLabelMedium(parent=self,
                    text=GetByLabel('UI/Map/StarMap/SecurityStatus'))
     self.securityValue = EveLabelMedium(parent=self,
                                         bold=True,
                                         color=(1, 0, 0, 1))
Exemplo n.º 19
0
 def CreateToolbar(self):
     self.toolbarContainer = Container(parent=self.headerParent, align=uiconst.CENTERTOP, width=TOOLBARWIDTH_FULLSCREEN, height=TOOLBARHEIGHT)
     self.caption = EveLabelMedium(parent=self.toolbarContainer, align=uiconst.CENTER, bold=True)
     FillThemeColored(bgParent=self.toolbarContainer, opacity=0.9, padding=(1, 1, 1, 0))
     grid = LayoutGrid(parent=self.toolbarContainer, columns=5, cellPadding=2, align=uiconst.CENTERRIGHT, left=6, opacity=0.6)
     dockViewMode = DockablePanelHeaderButtonMenu(parent=grid, dockViewModeCallback=self.ChangeViewMode, panelID=self.panelID)
     closeButton = DockablePanelHeaderButton(parent=grid, hint='Close', texturePath='res:/UI/Texture/classes/DockPanel/closeButton.png', func=self.CloseByUser)
     tOutline = StretchSpriteHorizontalThemeColored(texturePath='res:/UI/Texture/classes/MapView/toolbarLine.png', colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=uiconst.OPACITY_FRAME, leftEdgeSize=64, rightEdgeSize=64, parent=self.toolbarContainer, align=uiconst.TOBOTTOM_NOPUSH, padding=(-48, 0, -48, -15), height=64)
     tFill = StretchSpriteHorizontalThemeColored(texturePath='res:/UI/Texture/classes/MapView/toolbarFill.png', colorType=uiconst.COLORTYPE_UIBASE, leftEdgeSize=64, rightEdgeSize=64, parent=self.toolbarContainer, align=uiconst.TOBOTTOM_NOPUSH, padding=(-48, 0, -48, -15), height=64)
Exemplo n.º 20
0
 def ConstructUI(self):
     self.BuildTopParentUI()
     self.AddButtons()
     numColumns = 2
     self.layoutGrid = layoutGrid = LayoutGrid(parent=self.sr.main,
                                               columns=numColumns,
                                               cellSpacing=(4, 10))
     spacer = Container(pos=(0, 0, 50, 0), align=uiconst.TOPLEFT)
     layoutGrid.AddCell(cellObject=spacer, colSpan=1)
     layoutGrid.FillRow()
     self.BuildNumToFitUI()
     self.BuildWarningUI()
     self.BuildRefreshInventory()
     self.missingLayoutGrid = LayoutGrid(parent=self.layoutGrid,
                                         columns=2,
                                         cellSpacing=(4, 10))
     self.BuildAvailableShipsUI()
     self.BuildEquipmentUI()
     self.BuildProgressUI()
     self.MakeRigCbUI()
Exemplo n.º 21
0
 def ConstructLayout(self, iconOpacity, iconPath, iconSize, label):
     if iconPath and label:
         contentCont = LayoutGrid(parent=self,
                                  align=uiconst.CENTER,
                                  left=-10)
         self.AddIcon(contentCont, iconOpacity, iconPath, iconSize)
         self.AddLabel(contentCont, label)
         self.icon = None
     else:
         return ToggleButtonGroupButton.ConstructLayout(
             self, iconOpacity, iconPath, iconSize, label)
Exemplo n.º 22
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     headerClass = attributes.get('headerClass', self.default_headerClass)
     entryClass = attributes.get('entryClass', self.default_entryClass)
     columnInfo = attributes.columnInfo
     headerInfo = columnInfo['headerInfo']
     entryInfoList = columnInfo['entryInfoList']
     headerObject = headerClass(headerInfo=headerInfo)
     self.AddCell(cellObject=headerObject)
     for eachEntryInfo in entryInfoList:
         entryObject = entryClass(entryInfo=eachEntryInfo)
         self.AddCell(cellObject=entryObject)
 def ApplyAttributes(self, attributes):
     Window.ApplyAttributes(self, attributes)
     self.title = attributes.title
     self.channelID = attributes.channelID
     self.channelName = attributes.channelName
     self.displayName = attributes.displayName
     self.SetMinSize([250, 250])
     self.SetCaption(localization.GetByLabel('UI/Menusvc/PasswordRequired'))
     self.SetTopparentHeight(0)
     self.tries = 0
     settings.user.ui.Set('%sPassword' % self.channelName, '')
     parentGrid = LayoutGrid(parent=self.sr.main,
                             columns=1,
                             state=uiconst.UI_PICKCHILDREN,
                             align=uiconst.TOPLEFT,
                             left=10,
                             top=4)
     topLabel = EveLabelMedium(text=attributes.title,
                               state=uiconst.UI_DISABLED,
                               align=uiconst.TOPLEFT,
                               width=300)
     parentGrid.AddCell(cellObject=topLabel)
     passwordLabel = localization.GetByLabel(
         'UI/Menusvc/PleaseEnterPassword')
     self.passwordLabel = EveLabelMedium(text=passwordLabel,
                                         state=uiconst.UI_DISABLED,
                                         align=uiconst.TOPLEFT,
                                         padTop=10)
     parentGrid.AddCell(cellObject=self.passwordLabel)
     self.passwordEdit = SinglelineEdit(name='passwordEdit',
                                        align=uiconst.TOTOP,
                                        passwordCharacter=u'\u2022',
                                        top=4)
     parentGrid.AddCell(cellObject=self.passwordEdit)
     savePasswordLabel = localization.GetByLabel('UI/Chat/SavePassword')
     self.rememberPwdCb = Checkbox(text=savePasswordLabel,
                                   configName='rememberPwdCb',
                                   retval=1,
                                   checked=0,
                                   groupname=None,
                                   align=uiconst.TOTOP)
     parentGrid.AddCell(cellObject=self.rememberPwdCb)
     parentGrid.RefreshGridLayout()
     self.btnGroup = ButtonGroup(parent=self.sr.main, idx=0)
     self.btnGroup.AddButton(
         localization.GetByLabel('UI/Chat/ChannelWindow/JoinChannel'),
         self.TryPassword, ())
     self.btnGroup.AddButton(localization.GetByLabel('UI/Common/Cancel'),
                             self.Close, ())
     self.height = self.btnGroup.height + parentGrid.height + self.sr.headerParent.height + parentGrid.top + 10
     self.width = parentGrid.width + 2 * parentGrid.left
     self.MakeUnResizeable()
     self.MakeUnMinimizable()
     self.MakeUncollapseable()
Exemplo n.º 24
0
 def LoadTooltipPanel(self, tooltipPanel, *args):
     if uicore.uilib.leftbtn:
         return
     tooltipPanel.columns = 1
     tooltipPanel.cellPadding = 2
     tooltipPanel.state = uiconst.UI_NORMAL
     tooltipPanel.AddLabelSmall(
         text=localization.GetByLabel('UI/Map/ColorMapBy'),
         bold=True,
         cellPadding=(8, 4, 4, 2))
     divider = LineThemeColored(align=uiconst.TOTOP,
                                state=uiconst.UI_DISABLED,
                                height=1,
                                padding=(1, 1, 1, 0),
                                opacity=0.3)
     tooltipPanel.AddCell(divider, cellPadding=(0, 0, 0, 0))
     if eve.session.role & service.ROLE_GML:
         Button(parent=tooltipPanel,
                label='Debug Run All',
                func=self.DebugRunAll,
                align=uiconst.CENTER)
     tooltipPanel.AddLabelSmall(
         text=localization.GetByLabel('UI/Map/RecentColorBy'),
         cellPadding=(8, 4, 4, 2))
     self.recentLayoutGrid = LayoutGrid(columns=1, parent=tooltipPanel)
     self.LoadRecentColorModes()
     divider = LineThemeColored(align=uiconst.TOTOP,
                                state=uiconst.UI_DISABLED,
                                height=1,
                                padding=(1, 1, 1, 0),
                                opacity=0.3)
     tooltipPanel.AddCell(divider, cellPadding=(0, 0, 0, 0))
     self.scroll = Scroll(parent=tooltipPanel,
                          align=uiconst.TOPLEFT,
                          width=COLORMODE_MENU_WIDTH,
                          height=COLORMODE_MENU_HEIGHT)
     self.scroll.OnUpdatePosition = self.OnScrollPositionChanged
     self.LoadColorModes()
Exemplo n.º 25
0
    def LoadTooltipPanel(self, tooltipPanel, *args):
        tooltipPanel.LoadGeneric1ColumnTemplate()
        subGrid1 = LayoutGrid()
        icon = Icon(width=64, height=64, align=CENTER)
        icon.LoadIconByTypeID(typeID=self.typeID, ignoreSize=True)
        subGrid1.AddCell(cellObject=icon)
        subGrid1.AddCell(EveLabelMedium(text=evetypes.GetName(self.typeID), width=170, autoFitToText=True, left=6, top=4, bold=True))
        tooltipPanel.AddCell(subGrid1)
        subGrid = LayoutGrid()
        subGrid.columns = 2
        l1 = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessedFrom'), color=COL_BLUE, bold=True)
        subGrid.AddCell(l1, colSpan=2)
        for typeID, quantity in self.typeInfo.iteritems():
            subGrid.AddCell(EveLabelMedium(text=FmtAmt(quantity, showFraction=0), align=uiconst.TORIGHT, padRight=3, color=COL_LIGHTBLUE, bold=True))
            subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessedFromType', typeName=evetypes.GetName(typeID)), padLeft=3))

        subGrid.AddCell(EveLabelMedium(text=FmtAmt(self.stationQty, showFraction=0), colSpan=1, align=uiconst.TORIGHT, padRight=2, color=COL_RED, bold=True))
        subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/OutputTaxHint'), colSpan=1, padLeft=2))
        subGrid.AddCell(EveLabelMedium(text=FmtAmt(self.unrecoverableQty, showFraction=0), colSpan=1, align=uiconst.TORIGHT, padRight=2, color=COL_RED, bold=True))
        subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/NotRecoverableHint'), colSpan=1, padLeft=2))
        subGrid.AddCell(EveLabelMedium(text=FmtAmt(self.quantity, showFraction=0), colSpan=1, align=uiconst.TORIGHT, padRight=2, color=COL_GREEN, bold=True))
        subGrid.AddCell(EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/TotalOutputHint'), colSpan=1, padLeft=2))
        tooltipPanel.AddCell(subGrid)
Exemplo n.º 26
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     self.activityType = None
     self.jobData = None
     self.countCaption = Label(color=Color.GRAY, fontsize=10, top=2)
     self.AddCell(self.countCaption, cellPadding=(0, 0, 5, 0))
     self.countLabel = Label()
     cell = self.AddCell(self.countLabel, cellPadding=(5, 0, 5, 3))
     self.slotsErrorFrame = ErrorFrame(parent=cell, align=uiconst.TOALL, state=uiconst.UI_DISABLED, padBottom=3)
     label = Label(text=localization.GetByLabel('UI/Industry/ControlRange'), color=Color.GRAY, fontsize=10, top=2)
     self.AddCell(label, cellPadding=(0, 0, 5, 0))
     self.rangeLabel = Label()
     cell = self.AddCell(self.rangeLabel, cellPadding=(5, 0, 5, 0))
     self.rangeErrorFrame = ErrorFrame(parent=cell, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
Exemplo n.º 27
0
    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        megaMenuOptions = attributes.megaMenuOptions
        self.categoryInfo = attributes.categoryInfo
        self.openingButtonClass = attributes.openingButtonClass
        buttonContainer = Container(parent=self,
                                    name='buttonContainer',
                                    align=uiconst.TOTOP,
                                    height=50)
        navigationButton = self.openingButtonClass(
            parent=buttonContainer,
            categoryInfo=self.categoryInfo,
            state=uiconst.UI_NORMAL)
        Frame(
            bgParent=navigationButton,
            frameConst=('res:/UI/Texture/Shared/menuButtonBackground_Top.png',
                        17, -16))
        buttonContainer.height = navigationButton.height
        layoutGridCont = Container(name='layoutGridCont', parent=self)
        numSubgroups = len(megaMenuOptions)
        myLayoutGrid = LayoutGrid(parent=layoutGridCont,
                                  columns=numSubgroups,
                                  state=uiconst.UI_NORMAL)
        MouseTargetObject(myLayoutGrid)
        Frame(bgParent=myLayoutGrid,
              frameConst=('res:/UI/Texture/Shared/menuBackground.png', 17,
                          -16))
        for eachColumnInfo in megaMenuOptions:
            column = MegaMenuColumn(columnInfo=eachColumnInfo)
            myLayoutGrid.AddCell(cellObject=column)

        al, at, aw, ah = myLayoutGrid.GetAbsolute()
        self.height = myLayoutGrid.height + buttonContainer.height
        self.width = myLayoutGrid.width
        self.updateThread = AutoTimer(100, self.UpdateMegaMenu)
        uicore.uilib.RegisterForTriuiEvents(uiconst.UI_MOUSEUP,
                                            self.OnGlobalMouseUp)
Exemplo n.º 28
0
class BracketTooltipSidePanel(Container):
    default_state = uiconst.UI_PICKCHILDREN
    default_align = uiconst.TOPLEFT
    default_clipChildren = True

    def ApplyAttributes(self, attributes):
        Container.ApplyAttributes(self, attributes)
        self.textLabels = []
        self.grid = LayoutGrid(parent=self,
                               columns=3,
                               margin=3,
                               OnGridSizeChanged=self.OnGridSizeChanged)

    def OnGridSizeChanged(self, width, height):
        self.width = width

    def CreateBracketEntry(self):
        self.grid.AddCell(cellObject=Container(align=uiconst.TOPLEFT,
                                               pos=(0, 0, 2, MINENTRYHEIGHT)))
        label = BracketShadowLabel(align=uiconst.CENTERLEFT)
        self.grid.AddCell(cellObject=label)
        self.textLabels.append(label)
        self.grid.AddCell(cellObject=Container(align=uiconst.TOPLEFT,
                                               pos=(0, 0, 2, MINENTRYHEIGHT)))
        return label

    def SetContentAlign(self, contentAlign):
        for textlabel in self.textLabels:
            if contentAlign == uiconst.TOLEFT:
                textlabel.align = uiconst.CENTERLEFT
            else:
                textlabel.align = uiconst.CENTERRIGHT

    def Close(self, *args):
        Container.Close(self, *args)
        self.textLabels = None
Exemplo n.º 29
0
    def LoadTooltipPanel(self, tooltipPanel, *args):
        tooltipPanel.LoadGeneric1ColumnTemplate()
        subGrid1 = LayoutGrid()
        icon = Sprite(width=64, height=64, ignoreSize=True, align=CENTER, texturePath='res:/UI/Texture/Reprocessing/Reprocess.png')
        subGrid1.AddCell(icon)
        itemName = self.groupName
        yieldText = '<color=%s>%s%%</color>' % (Color.RGBtoHex(*COL_LIGHTBLUE), FmtAmt(self.percentage * 100.0, showFraction=1))
        topLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/ItemYieldHint', itemName=itemName, itemYield=yieldText), width=170, autoFitToText=True, left=6, top=4, bold=True)
        subGrid1.AddCell(topLabel)
        tooltipPanel.AddCell(subGrid1)
        subGrid = LayoutGrid()
        l1 = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessingCalculations'), color=COL_BLUE, bold=True)
        subGrid.AddCell(l1, colSpan=2)
        for label in GetReprocessingModifiersAsLabels(self.groupID, self.stationEfficiency, self.stationTax, self.getTypeAttribute, self.getSkillLevel, avgBonus=self.avgBonus, category=True):
            subGrid.AddCell(label)

        tooltipPanel.AddCell(subGrid)
Exemplo n.º 30
0
 def ApplyAttributes(self, attributes):
     self._ready = False
     Window.ApplyAttributes(self, attributes)
     self.SetTopparentHeight(8)
     top = Container(parent=self.sr.main,
                     align=uiconst.TOTOP,
                     height=128,
                     padding=8)
     self.loadObjectCacheEnabledChk = Checkbox(
         parent=top,
         align=uiconst.TOTOP,
         text='Load Object Cache Enabled',
         width=120,
         checked=blue.resMan.loadObjectCacheEnabled,
         callback=self._OnLoadObjectCacheEnabledChk)
     self.attributes = Scroll(parent=top, align=uiconst.TOALL)
     bottom = LayoutGrid(parent=self.sr.main,
                         align=uiconst.TOBOTTOM,
                         height=100,
                         columns=4,
                         cellPadding=5)
     self.filterEdit = SinglelineEdit(parent=bottom,
                                      width=150,
                                      label='Filter:',
                                      OnReturn=self._OnRefresh)
     Button(parent=bottom,
            label='Refresh',
            func=self._OnRefresh,
            fixedwidth=80)
     Button(parent=bottom,
            label='Reload',
            func=self._OnReload,
            fixedwidth=80)
     Button(parent=bottom,
            label='Clear cache',
            func=self._OnClear,
            fixedwidth=80)
     Label(parent=self.sr.main,
           align=uiconst.TOTOP,
           text='<b>Resources',
           padLeft=8)
     self.scroll = Scroll(parent=self.sr.main,
                          id='resmanmonitorscroll',
                          align=uiconst.TOALL,
                          padding=2)
     self.PopulateAttributes()
     self.PopulateScroll()
     uthread2.StartTasklet(self.RefreshAttributes)
Exemplo n.º 31
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     charID = attributes.charID
     parentLayoutGrid = LayoutGrid(parent=self,
                                   columns=2,
                                   align=uiconst.TOPLEFT,
                                   padding=6,
                                   cellSpacing=(10, 10))
     addHeader = attributes.get('addHeader', True)
     if addHeader:
         self.AddHeader(parentLayoutGrid)
     sprite = Sprite(parent=parentLayoutGrid,
                     align=uiconst.TOPLEFT,
                     state=uiconst.UI_DISABLED,
                     pos=(0, 0, 128, 128))
     sm.GetService('photo').GetPortrait(charID,
                                        128,
                                        sprite,
                                        allowServerTrip=True)
     subLayoutGrid = LayoutGrid(parent=parentLayoutGrid,
                                columns=2,
                                align=uiconst.TOPLEFT)
     spacer = Fill(align=uiconst.TOPLEFT,
                   state=uiconst.UI_DISABLED,
                   width=128,
                   height=1,
                   color=(0, 0, 0, 0))
     subLayoutGrid.AddCell(cellObject=spacer, colSpan=2)
     parallelCalls = []
     parallelCalls.append(
         (sm.RemoteSvc('charMgr').GetPublicInfo3, (charID, )))
     parallelCalls.append(
         (sm.GetService('corp').GetInfoWindowDataForChar, (charID, 1)))
     charinfo, corpCharInfo = uthread.parallel(parallelCalls)
     charName = cfg.eveowners.Get(charID).name
     nameLabel = EveLabelMedium(text=charName, autoFitToText=True)
     subLayoutGrid.AddCell(cellObject=nameLabel, colSpan=2)
     titleText = self.GetTitleText(corpCharInfo)
     titleLabel = EveLabelMedium(text=titleText, autoFitToText=True)
     if titleLabel.textwidth > self.maxTextWidth:
         titleLabel.width = self.maxTextWidth
     subLayoutGrid.AddCell(cellObject=titleLabel, colSpan=2)
     if corpCharInfo:
         corpID = corpCharInfo.corpID
         allianceID = corpCharInfo.allianceID
         for eachID in (corpID, allianceID):
             if eachID:
                 logo = self.GetLogo(eachID)
                 logo.hint = cfg.eveowners.Get(eachID).name
                 subLayoutGrid.AddCell(cellObject=logo)