def ExpandMenu(self, *args): if self.destroyed: return if self.IsExpanded(): self.CloseMenu() return background = self.AccessBackground() icon = self.AccessIcon() l, t, w, h = background.GetAbsolute() buttonCopy = Container(parent=uicore.layer.utilmenu, align=uiconst.TOPLEFT, pos=(l, t, self.GetFullWidth(), h), state=uiconst.UI_NORMAL, idx=0) buttonCopy.OnMouseDown = self.CloseMenu if self._label is not None: label = EveLabelMedium(parent=buttonCopy, text=self._label.text, align=self._label.align, bold=True, left=self._label.left) Sprite(parent=buttonCopy, texturePath=self.closeTexturePath, state=uiconst.UI_DISABLED, align=icon.align, width=icon.width, height=icon.height, left=icon.left) topOrBottomLine = LineThemeColored(parent=buttonCopy, align=uiconst.TOTOP, opacity=OPACITY_LINES) if self.menuAlign in (uiconst.BOTTOMLEFT, uiconst.BOTTOMRIGHT): topOrBottomLine.align = uiconst.TOBOTTOM LineThemeColored(parent=buttonCopy, align=uiconst.TOLEFT, opacity=OPACITY_LINES) LineThemeColored(parent=buttonCopy, align=uiconst.TORIGHT, opacity=OPACITY_LINES) FillThemeColored(bgParent=buttonCopy, opacity=OPACITY_BG) menuParent = ExpandedUtilMenu(parent=uicore.layer.utilmenu, controller=self, GetUtilMenu=self._getMenuFunction, minWidth=self.GetFullWidth() + 16, idx=1, menuAlign=self.menuAlign) self._menu = weakref.ref(menuParent) self._menuButton = weakref.ref(buttonCopy) uicore.animations.MorphScalar(buttonCopy, 'opacity', startVal=0.5, endVal=1.0, duration=0.2) uthread.new(uicore.registry.SetFocus, menuParent)
def ExpandMenu(self, *args): if self.destroyed: return if self.IsExpanded(): self.CloseMenu() return background = self.AccessBackground() icon = self.AccessIcon() l, t, w, h = background.GetAbsolute() buttonCopy = Container(parent=uicore.layer.utilmenu, align=uiconst.TOPLEFT, pos=(l, t, self.GetFullWidth(), h), state=uiconst.UI_NORMAL, idx=0) buttonCopy.OnMouseDown = self.CloseMenu if self._label is not None: label = EveLabelMedium(parent=buttonCopy, text=self._label.text, align=self._label.align, bold=True, left=self._label.left) Sprite(parent=buttonCopy, texturePath=self.closeTexturePath, state=uiconst.UI_DISABLED, align=icon.align, width=icon.width, height=icon.height, left=icon.left) topOrBottomLine = LineThemeColored(parent=buttonCopy, align=uiconst.TOTOP, opacity=OPACITY_LINES) if self.menuAlign in (uiconst.BOTTOMLEFT, uiconst.BOTTOMRIGHT): topOrBottomLine.align = uiconst.TOBOTTOM LineThemeColored(parent=buttonCopy, align=uiconst.TOLEFT, opacity=OPACITY_LINES) LineThemeColored(parent=buttonCopy, align=uiconst.TORIGHT, opacity=OPACITY_LINES) FillThemeColored(bgParent=buttonCopy, opacity=OPACITY_BG) menuParent = ExpandedUtilMenu(parent=uicore.layer.utilmenu, controller=self, GetUtilMenu=self._getMenuFunction, minWidth=self.GetFullWidth() + 16, idx=1, menuAlign=self.menuAlign) self._menu = weakref.ref(menuParent) self._menuButton = weakref.ref(buttonCopy) uicore.animations.MorphScalar(buttonCopy, 'opacity', startVal=0.5, endVal=1.0, duration=0.2) uthread.new(uicore.registry.SetFocus, menuParent)
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)
def CreateColumns(self, columns, fixedColumns = None): self.headerContainer.Flush() self.columnIDs = columns self.fixedColumns = fixedColumns if columns: sizes = self.GetCurrentSizes() for columnID in columns: header = uiprimitives.Container(parent=self.headerContainer, align=uiconst.TOLEFT, state=uiconst.UI_NORMAL) header.OnClick = (self.ClickHeader, header) header.OnDblClick = (self.DblClickHeader, header) header.columnID = columnID header.sortTriangle = None headerDivider = LineThemeColored(parent=header, align=uiconst.TORIGHT, opacity=uiconst.OPACITY_FRAME) if columnID not in fixedColumns: scaler = uiprimitives.Container(parent=header, align=uiconst.TOPRIGHT, width=4, height=self.height - 1, state=uiconst.UI_NORMAL) scaler.OnMouseDown = (self.StartHeaderScale, header) scaler.OnMouseEnter = (self.OnHeaderMouseEnter, header) scaler.OnMouseExit = (self.OnHeaderMouseExit, header) header.OnMouseEnter = (self.OnHeaderMouseEnter, header) header.OnMouseExit = (self.OnHeaderMouseExit, header) scaler.cursor = 16 label = uicontrols.EveLabelSmall(parent=header, text=sm.GetService('tactical').GetColumnLabel(columnID, addFormatUnit=True), align=uiconst.CENTERLEFT, left=6, state=uiconst.UI_DISABLED, maxLines=1) header.label = label if fixedColumns and columnID in fixedColumns: header.width = fixedColumns[columnID] if header.width <= 32: label.Hide() elif columnID in sizes: header.width = max(self.minSizeByColumnID.get(columnID, COLUMNMINSIZE), sizes[columnID]) else: header.width = max(self.minSizeByColumnID.get(columnID, COLUMNMINSIZE), max(COLUMNMINDEFAULTSIZE, label.textwidth + 24)) header.fill = FillThemeColored(parent=header, colorType=uiconst.COLORTYPE_UIHILIGHT, padLeft=-1, padRight=-1, opacity=0.75) self.UpdateActiveState()
def ApplyAttributes(self, attributes): uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes) self.iconsize = iconsize = 44 LineThemeColored(parent=self, align=uiconst.TOBOTTOM) self.factionParent = uiprimitives.Container(name='factionParent', parent=self, align=uiconst.TOLEFT, pos=(0, 0, 64, 64), padding=MARGIN) middleCont = uiprimitives.Container(parent=self, name='middleContainer', width=MIDDLECONTAINER_WIDTH, align=uiconst.TOLEFT, padTop=MARGIN, clipChildren=True) self.constellationLabel = BigReportLabel(name='constellationName', parent=middleCont, fontsize=20, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.statusText = SmallReportLabel(parent=middleCont, align=uiconst.TOTOP, uppercase=True) SmallReportLabel(name='systemInfluence', parent=middleCont, align=uiconst.TOTOP, text=localization.GetByLabel('UI/Incursion/Common/HUDInfluenceTitle')) self.statusBar = uicls.SystemInfluenceBar(parent=middleCont, pos=(0, 0, 200, 10), align=uiconst.TOTOP, padding=(0, 4, 0, 4)) self.stagingText = SmallReportLabel(parent=middleCont, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.bossIcon = uicls.IncursionBossIcon(parent=middleCont, left=3, top=3, align=uiconst.TOPRIGHT, idx=0) btn = uix.GetBigButton(iconsize, self, left=self.BUTTON_OFFSET, top=MARGIN, align=uiconst.BOTTOMLEFT) btn.hint = localization.GetByLabel('UI/Incursion/Journal/ShowActiveCorpMembersInMap') btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/corpmap.png', ignoreSize=True) self.corpMapButton = btn btn = uix.GetBigButton(iconsize, self, left=self.BUTTON_OFFSET + 50, top=MARGIN, align=uiconst.BOTTOMLEFT) btn.hint = localization.GetByLabel('UI/Incursion/Journal/ShowOnStarMap') btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/map.png', ignoreSize=True) self.mapButton = btn btn = uix.GetBigButton(iconsize, self, left=self.BUTTON_OFFSET + 100, top=MARGIN, align=uiconst.BOTTOMLEFT) btn.hint = localization.GetByLabel('UI/Incursion/Journal/StagingAsAutopilotDestination') btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/ships.png', ignoreSize=True) self.autopilotButton = btn btn = uix.GetBigButton(iconsize, self, left=self.BUTTON_OFFSET, top=MARGIN) btn.hint = localization.GetByLabel('UI/Incursion/Journal/ViewLoyaltyPointLog') btn.sr.icon.LoadIcon('res:/ui/Texture/WindowIcons/lpstore.png', ignoreSize=True) self.lpButton = btn self.loyaltyPoints = ReportNumber(name='loyaltyPoints', parent=self, pos=(self.BUTTON_OFFSET + 50, MARGIN, 105, iconsize), number=0, hint=localization.GetByLabel('UI/Incursion/Journal/LoyaltyPointsWin'), padding=(4, 4, 4, 4))
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)
def LoadTabs(self, tabs, autoselecttab = 1, settingsID = None, iconOnly = False, silently = False): self._iconOnly = iconOnly self.sr.tabs = [] self.sr.mytabs = [] self.sr.tabsmenu = None self.Flush() LineThemeColored(parent=self, align=uiconst.TOBOTTOM) maxTextHeight = 0 for data in tabs: newtab = Tab(parent=self, labelPadding=self.labelPadding) self.sr.mytabs.append(newtab) newtab.Startup(self, data) newtab.align = uiconst.TOLEFT self.sr.Set('%s_tab' % data.label, newtab) self.sr.tabs.append(newtab) maxTextHeight = max(maxTextHeight, newtab.sr.label.textheight) if newtab.sr.icon: maxTextHeight = max(maxTextHeight, newtab.sr.icon.height) self.height = max(self.height, int(maxTextHeight * 1.7)) self._inited = 1 self._settingsID = settingsID self.UpdateSizes() if autoselecttab: self.AutoSelect(silently)
def ApplyAttributes(self, attributes): uicontrols.ContainerAutoSize.ApplyAttributes(self, attributes) data = attributes.data text = r'<fontsize=18><b>%s</b></fontsize> %s %s, by %s<br><br>%s' % ( data.display_name, data.name, data.version, data.author, data.description) uicontrols.EveLabelMedium(text=text, parent=self, align=uiconst.TOTOP, padding=const.defaultPadding) self.buttonCont = Container(name='buttonCont', parent=self, align=uiconst.TOTOP, height=18, padTop=4) for button in getattr(data.module, 'BUTTONS', ()): try: uicontrols.Button(parent=self.buttonCont, align=uiconst.TORIGHT, label=button[0], func=button[1], args=button[2], padRight=4, hint=button[3]) except: pass LineThemeColored(parent=self, align=uiconst.TOTOP, padTop=4)
def Startup(self, *args): self.Flush() self.mainCont = Container(parent=self, align=uiconst.TOTOP, height=30) leftCont = Container(parent=self.mainCont, align=uiconst.TOLEFT, width=50) self.icon = Container(parent=leftCont, align=uiconst.TOPLEFT, pos=(3, 3, 32, 32)) self.corpNameCont = Container(parent=self.mainCont, align=uiconst.TOTOP, height=17) label = GetByLabel('UI/Station/Lobby/CorpName') self.corpNameLabel = EveLabelSmall(text=label, parent=self.corpNameCont, left=5, top=2, state=uiconst.UI_DISABLED) self.corpNameText = EveLabelMedium(text='', parent=self.corpNameCont, left=5, state=uiconst.UI_NORMAL) LineThemeColored(parent=self, align=uiconst.TOBOTTOM) self.buttonCnt = Container(parent=self, align=uiconst.TOTOP, height=25, state=uiconst.UI_PICKCHILDREN) self.buttonCnt.display = False self.infoicon = InfoIcon(left=32, top=3, parent=leftCont, idx=0)
def LoadDScanTooltipPanel(self, tooltipPanel, *args): if uicore.uilib.leftbtn: return tooltipPanel.columns = 2 tooltipPanel.AddLabelSmall(text=localization.GetByLabel( 'UI/Inflight/Scanner/DirectionalScan'), bold=True, cellPadding=(8, 4, 4, 2), colSpan=tooltipPanel.columns) 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, 2), colSpan=tooltipPanel.columns) for optionName, optionID, checked in ( (localization.GetByLabel('UI/Inflight/Scanner/ShowScanCone'), 'showScanCone', GetScanConeDisplayState() == True), (localization.GetByLabel('UI/Inflight/Scanner/AlignWithCamera'), 'cameraAligned', GetActiveScanMode() == SCANMODE_CAMERA)): checkBox = Checkbox(align=uiconst.TOPLEFT, text=optionName, checked=checked, wrapLabel=False, callback=self.OnSettingButtonCheckBoxChange, retval=optionID, prefstype=None) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(5, 0, 5, 0)) tooltipPanel.AddSpacer(width=2, height=2, colSpan=tooltipPanel.columns) tooltipPanel.state = uiconst.UI_NORMAL
def LoadTooltipPanel(self, tooltipPanel, *args): tooltipPanel.columns = 5 tooltipPanel.margin = 6 tooltipPanel.cellPadding = 3 tooltipPanel.cellSpacing = 0 text = GetByLabel('UI/Sovereignty/ActivityDefenseMultiplier') label = EveLabelMedium(text=text, align=uiconst.TOTOP, padTop=1, bold=True) tooltipPanel.AddCell(cellObject=label, colSpan=4) text = GetByLabel('UI/Sovereignty/DefenseMultiplierDisplayNumber', bonusMultiplier=self.currentMultiplier) label = EveLabelLarge(text=text, align=uiconst.TOPRIGHT, bold=True) tooltipPanel.AddCell(cellObject=label) valueAndTextures = [(self.devIndexes[2], 'res:/UI/Texture/classes/Sov/strategicIndex.png', 'UI/Sovereignty/StrategicIndex'), (self.devIndexes[0], 'res:/UI/Texture/classes/Sov/militaryIndex.png', 'UI/Sovereignty/MilitaryIndex'), (self.devIndexes[1], 'res:/UI/Texture/classes/Sov/industryIndex.png', 'UI/Sovereignty/IndustryIndex')] for indexValue, texturePath, labelPath in valueAndTextures: indexSprite = Sprite(name='indexSprite', parent=tooltipPanel, pos=(0, 0, 16, 16), align=uiconst.CENTERLEFT, texturePath=texturePath) label = EveLabelMedium(text=GetByLabel(labelPath)) tooltipPanel.AddCell(cellObject=label) indexBars = IndexBars(currentIndex=indexValue, align=uiconst.CENTERRIGHT) tooltipPanel.AddCell(cellObject=indexBars, cellPadding=(16, 0, 3, 0), colSpan=3) if self.isCapital: tooltipPanel.state = uiconst.UI_NORMAL l = LineThemeColored(height=1, align=uiconst.TOTOP, opacity=0.3) tooltipPanel.AddCell(l, colSpan=5, cellPadding=(1, 1, 1, 3)) capitalSprite = Sprite(name='capitalSprite', parent=tooltipPanel, pos=(0, 0, 16, 16), align=uiconst.CENTERLEFT, texturePath='res:/UI/Texture/classes/Sov/bonusShieldCapital16.png') capitalLabel = EveLabelMedium(text=GetByLabel('UI/Sovereignty/Capital'), align=uiconst.CENTERLEFT) tooltipPanel.AddCell(cellObject=capitalLabel) infoLabel = GetByLabel('UI/Contracts/ContractsWindow/ShowInfoLink', showInfoName=cfg.eveowners.Get(self.capitalOwnerID).name, info=('showinfo', const.typeAlliance, self.capitalOwnerID)) tooltipPanel.AddLabelMedium(text=infoLabel, colSpan=3, wrapWidth=160, align=uiconst.CENTERRIGHT, state=uiconst.UI_NORMAL)
def CreateColumns(self, columns): self.headerContainer.Flush() self.rightAlignedHeaderContainer.Flush() self.rightAlignedHeaderContainer.width = 0 self.headers = [] self.columnIDs = columns sizes = self.GetColumnSizes() for columnID in columns: isRigthAligned = True if self.rightAlignedColumns and columnID in self.rightAlignedColumns else False isStretchColumn = True if self.stretchColumns and columnID in self.stretchColumns else False header = Container(parent=self.rightAlignedHeaderContainer if isRigthAligned else self.headerContainer, align=uiconst.TOLEFT, state=uiconst.UI_NORMAL) header.OnClick = (self.ClickHeader, header) header.columnID = columnID header.sortTriangle = None if not isStretchColumn: header.OnDblClick = (self.DblClickHeader, header) headerDivider = LineThemeColored( parent=header, align=uiconst.TORIGHT if not isRigthAligned else uiconst.TOLEFT, opacity=uiconst.OPACITY_FRAME) if self.fixedColumns and columnID not in self.fixedColumns: scaler = Container(parent=header, align=uiconst.TOPRIGHT, width=4, height=self.height - 1, state=uiconst.UI_NORMAL) scaler.OnMouseDown = (self.StartHeaderScale, header) scaler.cursor = 16 label = EveLabelSmall(parent=header, text=columnID, align=uiconst.CENTERLEFT, left=6, state=uiconst.UI_DISABLED, maxLines=1) header.label = label if isStretchColumn: header.width = label.width + label.left + 20 elif self.fixedColumns and columnID in self.fixedColumns: header.width = self.fixedColumns[columnID] if header.width <= 32: label.Hide() elif columnID in sizes: header.width = max( self.minSizeByColumnID.get(columnID, COLUMNMINSIZE), sizes[columnID]) else: header.width = max( self.minSizeByColumnID.get(columnID, COLUMNMINSIZE), max(COLUMNMINDEFAULTSIZE, label.textwidth + 24)) if isRigthAligned: self.rightAlignedHeaderContainer.width += header.width self.headers.append(header) self.UpdateActiveState()
def Startup(self, *etc): self.photoSvc = sm.StartService('photo') self.sr.cellContainer = uiprimitives.Container(name='CellContainer', parent=self, padding=(2, 2, 2, 2)) self.sr.agentContainer = uiprimitives.Container(parent=self.sr.cellContainer, align=uiconst.TORIGHT, state=uiconst.UI_NORMAL, width=330) self.sr.careerContainer = uiprimitives.Container(parent=self.sr.cellContainer, align=uiconst.TOALL, padding=(const.defaultPadding * 2, const.defaultPadding, const.defaultPadding, const.defaultPadding)) LineThemeColored(parent=self, align=uiconst.TOBOTTOM)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) LineThemeColored(parent=self, align=uiconst.TOBOTTOM, opacity=uiconst.OPACITY_FRAME) self.headerContainer = uiprimitives.Container(parent=self) self.settingsID = attributes.settingsID self.customSortIcon = None self.columnIDs = [] self.fixedColumns = None self.defaultColumn = None
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) LineThemeColored(parent=self, align=uiconst.TOBOTTOM, opacity=uiconst.OPACITY_FRAME) self.headerContainer = Container(parent=self) self.settingsID = attributes.settingsID self.columnIDs = [] self.fixedColumns = None self.defaultColumn = None self.scroll = weakref.ref(attributes.scroll)
def Prepare_Appearance_(self): self.subpar = Container(parent=self, name='btns', state=uiconst.UI_PICKCHILDREN, align=self.subalign) if self.line: LineThemeColored(parent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, align=uiconst.TOTOP)
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()
def LoadSupport(self, panel, *args): if self.supportLoaded: return subpar = uiprimitives.Container(name='subpar', parent=panel, align=uiconst.TOALL) sumHeight = 0 sumHeight += self._LoadSupportHelpChannel(subpar) LineThemeColored(parent=subpar, align=uiconst.TOTOP) sumHeight += self._LoadSupportPetitions(subpar) + 1 LineThemeColored(parent=subpar, align=uiconst.TOTOP) sumHeight += self._LoadSupportCareer(subpar) + 1 if int( sm.GetService('machoNet').GetGlobalConfig().get( 'bugReporting_ShowButton', 0)) > 0: LineThemeColored(parent=subpar, align=uiconst.TOTOP) sumHeight += self._LoadSupportBugReport(subpar) + 1 self.SetMinSize([ self.minsize[0], self.sr.topParent.height + self.sr.headerParent.height + sumHeight + 32 ]) BumpedUnderlay(bgParent=panel) self.supportLoaded = True
def Startup(self, *args): LineThemeColored(parent=self, align=uiconst.TOBOTTOM) self.text = uicontrols.EveLabelMedium( parent=self, align=uiconst.TOTOP, state=uiconst.UI_NORMAL, padding=const.defaultPadding, linkStyle=uiconst.LINKSTYLE_REGULAR) self.postedBy = uicontrols.EveLabelMedium(parent=self, align=uiconst.BOTTOMRIGHT, state=uiconst.UI_NORMAL, maxLines=1, top=const.defaultPadding, left=const.defaultPadding)
def Setup(self, menu, parent=None, minwidth=None): log.LogInfo('Menu.Setup', id(self)) entries = menu.GetEntries() wasLine = 0 idNo = 0 for i, entry in enumerate(entries): if entry is None: if not len(self.sr.entries.children ) or i == len(entries) - 1 or wasLine: continue item = LineThemeColored(align=uiconst.TOTOP, parent=self.sr.entries, opacity=0.15, padding=(0, 2, 0, 1)) wasLine = 1 else: size = settings.user.ui.Get('cmenufontsize', 10) from carbonui.control.menu import MenuEntryViewCoreOverride as MenuEntryView menuEntryViewClass = entry.menuClass or MenuEntryView item = menuEntryViewClass(name='entry', align=uiconst.TOTOP, state=uiconst.UI_NORMAL, parent=self.sr.entries) item.Setup(entry, size, menu, idNo) idNo += 1 wasLine = 0 if len(self.sr.entries.children): self.width = max( max([each.width for each in self.sr.entries.children]) + 8, minwidth or 0) + self.sr.entries.left + self.sr.entries.width else: self.width = 100 self.sr.entries.SetSizeAutomatically() self.SetSizeAutomatically() self.menu = menu log.LogInfo('Menu.Setup Completed', id(self))
def LoadTooltipPanel(self, tooltipPanel, *args): if uicore.uilib.leftbtn: return tooltipPanel.columns = 2 tooltipPanel.AddLabelSmall( text=localization.GetByLabel('UI/Map/Layout'), bold=True, cellPadding=(8, 4, 4, 2), colSpan=tooltipPanel.columns) for settingsGroupKey in self.settingGroupKeys: if len(tooltipPanel.children): divider = LineThemeColored(align=uiconst.TOTOP, height=1, padding=(1, 1, 1, 0), opacity=0.3) tooltipPanel.AddCell(cellObject=divider, colSpan=tooltipPanel.columns) if settingsGroupKey in MV_GROUPS_BY_ID: for settingsID in MV_GROUPS_BY_ID[settingsGroupKey]: checked = settingsID == GetMapViewSetting( settingsGroupKey, self.mapViewID) checkBox = Checkbox(align=uiconst.TOPLEFT, text=LABEL_MAP_BY_ID[settingsID], groupname=settingsGroupKey, checked=checked, wrapLabel=False, callback=self.OnCheckBoxChange, configName=settingsGroupKey, retval=settingsID, prefstype=None) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(5, 0, 5, 0)) else: checked = bool( GetMapViewSetting(settingsGroupKey, self.mapViewID)) checkBox = Checkbox(align=uiconst.TOPLEFT, text=LABEL_MAP_BY_ID[settingsGroupKey], checked=checked, wrapLabel=False, callback=self.OnCheckBoxChange, configName=settingsGroupKey, prefstype=None) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(5, 0, 5, 0)) tooltipPanel.state = uiconst.UI_NORMAL
def Startup(self, args): jumpText = localization.GetByLabel( 'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/Jump') self.sr.JumpBtn = uicontrols.Button(parent=self, label=jumpText, align=uiconst.CENTER, func=self.OnClickJump) destroyLabel = localization.GetByLabel( 'UI/CharacterSheet/CharacterSheetWindow/JumpCloneScroll/Destroy') self.sr.DecomissionBtn = uicontrols.Button( parent=self, label=destroyLabel, align=uiconst.CENTER, func=self.OnClickDecomission) LineThemeColored(parent=self, align=uiconst.TOBOTTOM, opacity=0.4)
def Startup(self, *args): self.Flush() main = Container(parent=self, align=uiconst.TOTOP, height=30, state=uiconst.UI_PICKCHILDREN) left = Container(parent=main, align=uiconst.TOLEFT, width=50, state=uiconst.UI_PICKCHILDREN) icon = Container(parent=left, align=uiconst.TOPLEFT, width=32, height=32, left=3, top=3, state=uiconst.UI_PICKCHILDREN) par = Container(parent=main, align=uiconst.TOTOP, height=17, state=uiconst.UI_PICKCHILDREN) label = localization.GetByLabel('UI/Station/Lobby/CorpName') fieldName = 'corpName' l = EveLabelSmall(text=label, parent=par, left=5, top=2, state=uiconst.UI_DISABLED) t = EveLabelMedium(text='', parent=par, left=5, state=uiconst.UI_NORMAL) setattr(self.sr, fieldName + '_Label', l) setattr(self.sr, fieldName + '_Text', t) setattr(self.sr, fieldName, par) LineThemeColored(parent=self, align=uiconst.TOBOTTOM) self.sr.buttonCnt = Container(parent=self, align=uiconst.TOTOP, height=25, state=uiconst.UI_HIDDEN) self.sr.icon = icon self.sr.main = main self.sr.infoicon = InfoIcon(left=32, top=3, parent=left, idx=0)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.baseColorPicker = ColorPicker( parent=self.sr.main, align=uiconst.TOTOP, label='Base Color', colorCallback=self.OnBaseColor, padding=(8, 4, 4, 20), color=sm.GetService('uiColor').GetUIColor( uiconst.COLORTYPE_UIBASE), maxValue=0.3) LineThemeColored(parent=self.sr.main, align=uiconst.TOTOP) self.hiliteColorPicker = ColorPicker( parent=self.sr.main, align=uiconst.TOTOP, label='Hilite Color', colorCallback=self.OnHiliteColor, padding=(8, 20, 4, 4), color=sm.GetService('uiColor').GetUIColor( uiconst.COLORTYPE_UIHILIGHT))
def LoadTooltipPanel(self, tooltipPanel, *args): if uicore.uilib.leftbtn: return tooltipPanel.columns = 2 tooltipPanel.AddLabelSmall( text=localization.GetByLabel('UI/Map/Markers'), bold=True, cellPadding=(8, 4, 4, 2), colSpan=tooltipPanel.columns) 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, 2), colSpan=tooltipPanel.columns) currentActive = GetMapViewSetting(self.settingGroupKey, self.mapViewID) sortList = [] for groupID in VIEWMODE_MARKERS_OPTIONS: sortList.append((evetypes.GetGroupNameByGroup(groupID), groupID)) for customID in VIEWMODE_MARKERS_OPTIONS_CUSTOM: sortList.append((localization.GetByLabel( VIEWMODE_MARKERS_CUSTOM_LABELS[customID]), customID)) for optionName, optionID in sorted(sortList): checkBox = Checkbox(align=uiconst.TOPLEFT, text=optionName, checked=optionID in currentActive, wrapLabel=False, callback=self.OnSettingButtonCheckBoxChange, retval=optionID, prefstype=None) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(5, 0, 5, 0)) tooltipPanel.AddSpacer(width=2, height=2, colSpan=tooltipPanel.columns) tooltipPanel.state = uiconst.UI_NORMAL
def LoadTooltipPanel(self, tooltipPanel, *args): if uicore.uilib.leftbtn: return tooltipPanel.columns = 2 tooltipPanel.margin = 2 for settingsGroupKey in self.settingGroupKeys: if len(tooltipPanel.children): divider = LineThemeColored(align=uiconst.TOTOP, height=1) tooltipPanel.AddCell(cellObject=divider, colSpan=tooltipPanel.columns) if settingsGroupKey in MV_GROUPS_BY_ID: for settingsID in MV_GROUPS_BY_ID[settingsGroupKey]: checked = settingsID == GetMapViewSetting(settingsGroupKey) checkBox = Checkbox(align=uiconst.TOPLEFT, text=LABEL_MAP_BY_ID[settingsID], groupname=settingsGroupKey, checked=checked, wrapLabel=False, callback=self.OnCheckBoxChange, configName=settingsGroupKey, retval=settingsID) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(3, 0, 3, 0)) else: checked = bool(GetMapViewSetting(settingsGroupKey)) checkBox = Checkbox(align=uiconst.TOPLEFT, text=LABEL_MAP_BY_ID[settingsGroupKey], checked=checked, wrapLabel=False, callback=self.OnCheckBoxChange, configName=settingsGroupKey) tooltipPanel.AddCell(cellObject=checkBox, colSpan=tooltipPanel.columns, cellPadding=(3, 0, 3, 0)) tooltipPanel.state = uiconst.UI_NORMAL
def CreateColumns(self, columns, fixedColumns = None): self.headerContainer.Flush() self.columnIDs = columns if columns: for columnID in columns: header = Container(parent=self.headerContainer, align=uiconst.TOLEFT, state=uiconst.UI_NORMAL) header.OnClick = (self.ClickHeader, header) header.columnID = columnID header.sortTriangle = None headerDivider = LineThemeColored(parent=header, align=uiconst.TORIGHT, opacity=uiconst.OPACITY_FRAME) entry = VerticalLabel(parent=header, text=columnID, align=uiconst.BOTTOMLEFT, state=uiconst.UI_DISABLED) entry.top = -entry.label.textheight + const.defaultPadding header.label = entry.label header.hint = columnID header.width = fixedColumns[columnID] if columnID in self.LEFTCENTERED_COLUMNIDS: entry.left = 4 else: entry.left = (header.width - entry.label.textheight) / 2 header.fill = FillThemeColored(parent=header, colorType=uiconst.COLORTYPE_UIHILIGHT, padLeft=-1, padRight=-1, opacity=0.75) header.label.SetRightAlphaFade(fadeEnd=self.height - 10, maxFadeWidth=20) self.UpdateActiveState()
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.settingsID = attributes.settingsID self.scroll = attributes.scroll self.entryClass = attributes.entryClass LineThemeColored(parent=self, align=uiconst.TOBOTTOM, opacity=uiconst.OPACITY_FRAME) self.rightAlignedHeaderContainer = Container(parent=self, align=uiconst.TORIGHT) self.headerContainer = Container(parent=self, clipChildren=True) self.columnIDs = [] self.fixedColumns = None self.defaultColumn = None self.minSizeByColumnID = {} if self.scroll and self.entryClass: self.SetDefaultColumn( *self.entryClass.GetDefaultColumnAndDirection()) self.SetMinSizeByColumnID(self.entryClass.GetColumnsMinSize()) self.SetFixedColumns(self.entryClass.GetFixedColumns()) self.SetRightAlignedColumns( self.entryClass.GetRightAlignedColumns()) self.SetStretchColumns(self.entryClass.GetStretchColumns()) self.CreateColumns(self.entryClass.GetColumns())
def ConstructUI(self, flush=True): self.Flush() profileID = self.structureBrowserController.GetSelectedProfileID() if profileID == ALL_PROFILES: return btnCont = Container(parent=self, idx=0, height=32, align=uiconst.TOBOTTOM) LineThemeColored(parent=btnCont, colorType=uiconst.COLORTYPE_UIHILIGHT, align=uiconst.TOTOP) self.saveBtn = Button(parent=btnCont, label=GetByLabel('UI/Common/Buttons/Save'), func=self.SaveProfile, align=uiconst.CENTERRIGHT) self.mainCont = Container(name='mainCont', parent=self, padding=(0, 4, 4, 4)) self.categoryListCont = ServiceListCont( name='groupListCont', parent=self.mainCont, structureBrowserController=self.structureBrowserController) profileName = self.structureProfileController.GetProfileName() EveLabelLarge(text=profileName, parent=self.mainCont, state=uiconst.UI_DISABLED, align=uiconst.TOTOP, top=4, padBottom=5) self.categoryCont = SettingsCategoryCont( name='categoryCont', parent=self.mainCont, padding=(0, 2, 0, 2), structureBrowserController=self.structureBrowserController, structureProfileController=self.structureProfileController)
def LoadTooltipPanelNoOwner(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) tooltipPanel.AddCell(icon) structureTypeID = self.structureInfo['typeID'] if structureTypeID == const.typeOutpostConstructionPlatform: headerText = GetByLabel('UI/Sovereignty/Freeport') unclaimedText = GetByLabel('UI/Sovereignty/StationOpen') else: headerText = GetByLabel('UI/Sovereignty/Neutral') structureName = evetypes.GetName(structureTypeID) unclaimedText = GetByLabel('UI/Sovereignty/StructureUnclaimed', structureName=structureName) 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)) tooltipPanel.AddLabelMedium(text='<center>%s</center>' % unclaimedText, align=uiconst.CENTER, width=190, colSpan=2) statusContainer = SovStructureStatusHorizontal(structureInfo=self.structureInfo, width=200, align=uiconst.CENTER, centerLabel=True, barBgColor=(0.2, 0.2, 0.2, 0.3), autoHeight=True) tooltipPanel.AddCell(cellObject=statusContainer, colSpan=2) timeLabel = SovStatusTimeLabel(align=uiconst.CENTER, state=uiconst.UI_NORMAL, structureInfo=self.structureInfo, width=190) tooltipPanel.AddCell(cellObject=timeLabel, colSpan=2)
def ApplyAttributes(self, attributes): padding = attributes.padding or 0 attributes.height = 1 + padding * 2 Container.ApplyAttributes(self, attributes) LineThemeColored(parent=self, align=uiconst.TOTOP, padTop=padding, padLeft=1, padRight=1, opacity=OPACITY_LINES)