def CheckGroupAllButton(self): if self.destroyed: return icon = self.groupAllIcon if icon is None or icon.destroyed: return dogmaLocation = sm.GetService('clientDogmaIM').GetDogmaLocation() for typeID, qty in dogmaLocation.GetGroupableTypes( session.shipid).iteritems(): if qty > 1: break else: icon.state = uiconst.UI_HIDDEN return icon.state = uiconst.UI_NORMAL if dogmaLocation.CanGroupAll(session.shipid): iconID = self.groupAllIconID hintPath = self.groupAllLabelPath else: iconID = self.ungroupAllIconID hintPath = self.ungroupAllLabelPath icon.LoadIcon(iconID) hint = GetByLabel(hintPath) if settings.user.ui.Get('lockModules', False): hint = GetByLabel(self.lockeLabelPath, unit=hint) icon.hint = hint if getattr(self, 'updateGroupAllButtonThread', None): self.updateGroupAllButtonThread.kill() self.updateGroupAllButtonThread = uthread.new( self.UpdateGroupAllButton)
def GetTextAndTextureForEvent(cls, eventInfo): charText = GetLinkForCharacter(eventInfo.characterID) if eventInfo.actionID == GROUP_CREATED: return (GetByLabel('UI/Structures/LoggedChanges/GroupCreated', actorName=charText), 'res:/UI/Texture/classes/AccessGroups/groupCreated.png') if eventInfo.actionID == GROUP_DELETED: return (GetByLabel('UI/Structures/LoggedChanges/GroupDeleted', actorName=charText), '') return ('', '')
def BuildTopParentUI(self): self.sr.topParent.padding = (2 * const.defaultPadding, 0, 2 * const.defaultPadding, 0) self.shipIcon = Icon(name='shipIcon', parent=self.sr.topParent, state=uiconst.UI_NORMAL, size=64, ignoreSize=True) self.shipIcon.GetDragData = self.GetFittingDragData self.shipIcon.OnClick = self.OpenFitting self.shipIcon.hint = GetByLabel('UI/Fitting/ShowFitting') self.techSprite = Sprite(name='techIcon', parent=self.sr.topParent, align=uiconst.RELATIVE, width=16, height=16, idx=0) self.fitNameEdit = SinglelineEdit( name='fitNameEdit', parent=self.sr.topParent, left=72, width=150, maxLength=20, hint=GetByLabel('UI/Common/ShipName')) top = self.fitNameEdit.top + self.fitNameEdit.height + 5 self.shipNameLabel = EveLabelMedium(name='shipNameLabel', parent=self.sr.topParent, left=77, top=top, state=uiconst.UI_NORMAL)
def GetFixedColumns(): return { GetByLabel('UI/Structures/Browser/HeaderServices'): ICONSIZE * len(stationServiceConst.serviceData) + 2, GetByLabel('UI/Structures/Browser/HeaderSchedule'): 76 }
def _LoadDamageTooltip(self, tooltipPanel): tooltipPanel.LoadGeneric3ColumnTemplate() tooltipPanel.margin = (6, 4, 8, 4) for key, iconNo, labelText in (('Shield', 'res:/UI/Texture/Icons/1_64_13.png', GetByLabel('Tooltips/Hud/Shield')), ('Armor', 'res:/UI/Texture/Icons/1_64_9.png', GetByLabel('Tooltips/Hud/Armor')), ('Structure', 'res:/UI/Texture/Icons/2_64_12.png', GetByLabel('Tooltips/Hud/Structure'))): iconObj, labelObj, valueObj = tooltipPanel.AddIconLabelValue( iconNo, labelText, '', iconSize=36) valueObj.fontsize = 16 valueObj.bold = True valueObj.top = -2 labelObj.bold = False setattr(tooltipPanel, 'label' + key, labelObj) setattr(tooltipPanel, 'valueLabel' + key, valueObj) tooltipPanel.AddCell() f = Container(align=uiconst.TOPLEFT, width=100, height=1) tooltipPanel.AddCell(f, colSpan=2) self._UpdateDamageTooltip(tooltipPanel) self._damageTooltipUpdate = AutoTimer(10, self._UpdateDamageTooltip, tooltipPanel)
def UnfitModule(self, *args): if self.IsSimulated(): return self.ghostFittingExtension.UnfitFromSlot( None, self.GetModule()) if self.GetModule() is None: return parentID = self.GetParentID() if parentID is None: return masterID = self.IsInWeaponBank() invCache = sm.GetService('invCache') if masterID: ret = eve.Message( 'CustomQuestion', { 'header': GetByLabel('UI/Common/Confirm'), 'question': GetByLabel('UI/Fitting/ClearGroupModule') }, uiconst.YESNO) if ret != uiconst.ID_YES: return self.GetModule().dogmaLocation.UngroupModule(parentID, masterID) if self.GetCharge() is not None: self.UnfitCharge() if session.stationid2 or session.structureid: invCache.GetInventory(const.containerHangar).Add( self.GetModuleID(), parentID, flag=const.flagHangar) else: shipInv = invCache.GetInventoryFromId( parentID, locationID=session.stationid2) shipInv.Add(self.GetModuleID(), parentID, qty=None, flag=const.flagCargo)
def GetMinimumColWidth(): textWidth, textHeight = LabelThemeColored.MeasureTextSize( GetByLabel('UI/Inventory/AssetSafety/DeliverTo')) return { GetByLabel('UI/Inventory/AssetSafety/ManualDelivery'): textWidth + 30 }
def ConstructLoginCont(self): Line(parent=self.loginCont, align=uiconst.TOTOP, padBottom=10, opacity=0.1) EveCaptionSmall(parent=self.loginCont, align=uiconst.TOTOP, text=GetByLabel('UI/Twitch/LoginCaption')) twitchSvc = sm.GetService('twitch') username = twitchSvc.GetUsername() if username is None or not twitchSvc.HasToken(): password = None else: password = PASSWORD_IF_HAS_TOKEN self.usernameCont = EditWithLabel(parent=self.loginCont, text=GetByLabel('UI/Login/Username'), value=username, OnChange=self.CheckEnableStreamBtn) self.passwordCont = EditWithLabel(parent=self.loginCont, text=GetByLabel('UI/Login/Password'), OnReturn=self.StartStream, OnChange=self.CheckEnableStreamBtn, OnSetFocus=self.OnPasswordContFocus) self.passwordCont.edit.SetPasswordChar(u'\u2022') self.passwordCont.edit.SetValue(password) Label(parent=self.loginCont, align=uiconst.TOTOP, state=uiconst.UI_NORMAL, padding=(LABELWIDTH, 7, 0, 0), text=GetByLabel('UI/Twitch/SignupLink'), fontsize=10) Line(parent=self.loginCont, align=uiconst.TOBOTTOM, idx=0, opacity=0.1)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.sr.main.clipChildren = True self.MakeUnMinimizable() self.HideHeader() descText = attributes.missingText self.faildToLoadInfo = attributes.faildToLoadInfo title = GetByLabel('UI/Common/Information') caption = EveCaptionLarge(text=title, align=uiconst.CENTERLEFT, parent=self.sr.topParent, left=64, width=270) self.SetTopparentHeight(max(56, caption.textheight + 16)) self.SetWndIcon('res:/ui/Texture/WindowIcons/info.png') descLabel = EveLabelMedium(parent=self.sr.main, text=descText, align=uiconst.TOTOP, padding=(11, 11, defaultPadding, defaultPadding)) buttonGroup = ButtonGroup(parent=self.sr.main, unisize=1, idx=0) buyAllBtn = buttonGroup.AddButton( GetByLabel('UI/Market/MarketQuote/BuyAll'), self.BuyAll) closeBtn = buttonGroup.AddButton(GetByLabel('/Carbon/UI/Common/Close'), self.Close) if session.role & ROLE_GMH == ROLE_GMH: buttonGroup.AddButton('GM: Give all', self.GiveAllGM) self.typeScroll = Scroll(name='typeScroll', parent=self.sr.main, padding=(defaultPadding, 0, defaultPadding, 0)) self.LoadTypes(self.faildToLoadInfo)
def LoadTotalTooltip(self, tooltipPanel, *args): totalShown = self.GetSum() if not totalShown or not self.orderMultiplier: return numTypes, numAvailableTypes = self.GetNumTypesAndNumAvailableTypes() pricePerOrder = totalShown / float(self.orderMultiplier) tooltipPanel.LoadGeneric2ColumnTemplate() tooltipPanel.cellPadding = (4, 1, 4, 1) tooltipPanel.AddLabelMedium( text=GetByLabel('UI/Market/MarketQuote/NumOrders')) tooltipPanel.AddLabelMedium(text=FmtAmt(self.orderMultiplier), align=uiconst.CENTERRIGHT) tooltipPanel.AddLabelMedium( text=GetByLabel('UI/Market/MarketQuote/PricePerOrder')) tooltipPanel.AddLabelMedium(text=FmtISK(pricePerOrder), align=uiconst.CENTERRIGHT) if pricePerOrder >= MILLION: tooltipPanel.AddCell() tooltipPanel.AddLabelMedium( text='=%s' % FmtISKWithDescription(pricePerOrder, justDesc=True), align=uiconst.CENTERRIGHT) buyingText = GetByLabel( 'UI/Market/MarketQuote/TypesAvailableAndTotalInOrder', numAvailable=numAvailableTypes, numTypes=numTypes) buyingLabel = tooltipPanel.AddLabelSmall(text=buyingText, align=uiconst.CENTERRIGHT, colSpan=tooltipPanel.columns) buyingLabel.SetAlpha(0.6) tooltipPanel.AddSpacer(1, 8, colSpan=tooltipPanel.columns) deltaText = self.GetOrderDeltaText() tooltipPanel.AddLabelMedium(text=deltaText, colSpan=tooltipPanel.columns)
def UpdateState(self): state, stateName = twitch.get_api_state() if state <= twitch.api.STATE.FOUND_INGEST_SERVER: text = GetByLabel('UI/Twitch/StreamingInactive') btnLabel = GetByLabel('UI/Twitch/StartStream') btnFunc = self.StartStream color = COLOR_STOPPED self.EnableInputFields() elif state == twitch.api.STATE.STREAMING: text = GetByLabel('UI/Twitch/StreamingToTwitch') btnLabel = GetByLabel('UI/Twitch/StopStream') btnFunc = self.StopStream color = COLOR_STREAMING self.DisableInputFields() uicore.animations.FadeTo(self.stateLabel, 0.7, 1.2, loops=ANIM_REPEAT, curveType=ANIM_WAVE, duration=3.6) else: raise RuntimeError('unhandled state: %s (%s)' % (state, stateName)) self.stateIcon.icon.SetRGBA(*color) self.stateLabel.text = text self.stateLabel.SetRGBA(*color) self.streamBtn.SetLabel(btnLabel) self.streamBtn.func = btnFunc
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.SetTopparentHeight(0) mainCont = Container(name='mainCont', parent=self.sr.main, padding=const.defaultPadding) buttonCont = Container(name='buttonCont', parent=mainCont, align=uiconst.TOBOTTOM, height=26) scrollCont = Container(name='scrollCont', parent=mainCont) self.planetScroll = Scroll(name='planetsScroll', parent=scrollCont) self.planetScroll.multiSelect = False self.planetScroll.sr.id = 'planetscroll' self.planetScroll.OnSelectionChange = self.OnPlanetScrollSelectionChange self.planetClickID = None scrolllist, headers = self.GetPlanetScrollList() noCommandBuiltLabel = GetByLabel( 'UI/ScienceAndIndustry/ScienceAndIndustryWindow/NoCommandCenterBuilt' ) self.planetScroll.Load(contentList=scrolllist, headers=headers, noContentHint=noCommandBuiltLabel) viewPlanetLabel = GetByLabel( 'UI/ScienceAndIndustry/ScienceAndIndustryWindow/ViewPlanet') buttons = ButtonGroup(btns=[[viewPlanetLabel, self.ViewPlanet, ()]], parent=buttonCont, idx=0) viewPlanetLabel = GetByLabel( 'UI/ScienceAndIndustry/ScienceAndIndustryWindow/ViewPlanet') self.viewPlanetBtn = buttons.GetBtnByLabel(viewPlanetLabel) self.viewPlanetBtn.Disable()
def AddColumnSalary(self): col = self.AddColumnContainer() col.state = uiconst.UI_NORMAL self.salaryLabel = EveLabelMedium(parent=col, text=GetByLabel('UI/Common/Formatting/Percentage', percentage=self.teamCost), align=uiconst.CENTERLEFT, left=6) col.hint = GetByLabel('UI/Industry/SalaryHint') col.OnMouseEnter = self.OnMouseEnter col.OnMouseExit = self.OnMouseExit
def LoadAuctionHintPanel(self, tooltipPanel, *args): tooltipPanel.LoadGeneric3ColumnTemplate() tooltipPanel.AddLabelLarge(text=GetByLabel('UI/Industry/SystemBidList'), colSpan=tooltipPanel.columns, align=uiconst.CENTER) tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=2) topSystems = self.GetTopSystems() if topSystems: for i, (amount, solarSystemID) in enumerate(topSystems): if i > 2: break systemName = self.FormatSystemName(solarSystemID) systemLabel = '%i %s' % (i + 1, systemName) tooltipPanel.AddLabelSmall(text=systemLabel, colSpan=1) tooltipPanel.AddSpacer(width=10, height=0) tooltipPanel.AddLabelSmall(text=FmtISK(amount, 0), colSpan=1, align=uiconst.TORIGHT) myBids = self.GetMyBids() if myBids: tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=6) tooltipPanel.AddLabelLarge(text=GetByLabel('UI/Industry/MyBidList'), colSpan=tooltipPanel.columns, align=uiconst.CENTER) tooltipPanel.AddSpacer(colSpan=tooltipPanel.columns, width=0, height=2) for solarSystemID, amount in myBids: systemName = self.FormatSystemName(solarSystemID) tooltipPanel.AddLabelSmall(text=systemName, colSpan=1) tooltipPanel.AddSpacer(width=10, height=0) tooltipPanel.AddLabelSmall(text=FmtISK(amount, 0), colSpan=1, align=uiconst.TORIGHT)
def PrimeToEmptySlotHint(self): flagID = self.controller.GetFlagID() slotKey = self.GetSlotKey(flagID) if slotKey is None or slotKey not in self.slotsToHintDict: return (GetByLabel('UI/Fitting/EmptySlot'), '') labelPath, tooltipName = self.slotsToHintDict[slotKey] return (GetByLabel(labelPath), tooltipName)
def LoadTooltipPanel(self, tooltipPanel, *args): LeftSideButtonCameraBase.LoadTooltipPanel(self, tooltipPanel, *args) tooltipPanel.AddSpacer(width=0, height=5) tooltipPanel.AddLabelShortcut(GetByLabel('Tooltips/Hud/FOVZoom'), GetByLabel('Tooltips/Hud/AltPlusZoom')) cmd = uicore.cmd.commandMap.GetCommandByName('CmdToggleAutoTracking') tooltipPanel.AddSpacer(width=0, height=1) tooltipPanel.AddCommandTooltip(cmd)
def LoadContentCont(self): self.contentCont.Flush() groupDesc = self.groupInfo['description'] admins = self.groupInfo['admins'] if groupDesc: EveLabelMedium(parent=self.contentCont, text=groupDesc, padTop=6, align=uiconst.TOTOP) else: descText = GetByLabel( 'UI/Structures/AccessGroups/NoGroupDescription') EveLabelMedium(parent=self.contentCont, text=descText, align=uiconst.TOTOP, padTop=6, italic=True) for adminID in admins: ownerInfo = cfg.eveowners.Get(adminID) charName = ownerInfo.name charText = GetShowInfoLink(ownerInfo.typeID, charName, itemID=adminID) text = GetByLabel('UI/Structures/AccessGroups/GroupOwner', ownerName=charText) EveLabelMedium(parent=self.contentCont, text=text, align=uiconst.TOTOP, padTop=6, state=uiconst.UI_NORMAL)
def SetTargetingHeader(self, shipID, multiplyMaxTargetRange): maxTargetRange = GetShipAttribute(shipID, dogmaConst.attributeMaxTargetRange) maxRange = maxTargetRange * multiplyMaxTargetRange / 1000.0 headerText = GetMultiplyColor(multiplyMaxTargetRange) headerText += GetByLabel('UI/Fitting/FittingWindow/TargetingHeader', startColorTag='', endColorTag='', maxRange=maxRange) headerHint = GetByLabel('UI/Fitting/FittingWindow/TargetingHeaderHint') self.SetStatusText(headerText, headerHint)
def AddRow(self, idx): labelPath, what, iconNo, labelHintPath = rowsInfo[idx] rowName = 'row_%s' % what row = Container(name='row_%s' % rowName, parent=self, align=uiconst.TOTOP, height=32) mainIcon = Icon(icon=iconNo, parent=row, pos=(0, 0, 32, 32), ignoreSize=True) mainIcon.hint = GetByLabel(labelPath) statusLabel = Label(text='', parent=row, left=mainIcon.left + mainIcon.width, state=uiconst.UI_NORMAL, align=uiconst.CENTERLEFT, width=62) statusLabel.hint = GetByLabel(labelHintPath) self.statsLabelsByIdentifier[what] = statusLabel dmgContainer = Container(parent=row, name='dmgContainer', left=self.col1Width) gaugeCont = DamageGaugeContainerFitting(parent=dmgContainer) self.statsContsByIdentifier[what] = gaugeCont
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetTopparentHeight(0) self.preSelectedItems = attributes.selectedItems self.outputPrice = 0 self.outputItemsCount = 0 mainCont = Container(name='mainCont', parent=self.sr.main, padding=const.defaultPadding) bottomCont = Container(name='bottomCont', parent=mainCont, align=uiconst.TOBOTTOM, height=36) reprocessingCont = Container(name='reprocessingCont', parent=mainCont, align=uiconst.TOALL) inputCont = Container(name='inputCont', parent=reprocessingCont, align=uiconst.TOLEFT_PROP, width=0.48) centerCont = Container(name='centerCont', parent=reprocessingCont, align=uiconst.TOLEFT_PROP, width=0.02) outputCont = Container(name='outputCont', parent=reprocessingCont, align=uiconst.TORIGHT_PROP, width=0.48) self.inputInfoCont = ReprocessInputContainer(name='inputInfo', parent=inputCont, dropFunc=self.AddItemByDrag, removeFunc=self.RemoveItem) self.outputInfoCont = ReprocessOutputContainer(name='outputInfo', parent=outputCont) self.loadingOverlay = Container(parent=self.inputInfoCont, idx=0) Fill(bgParent=self.loadingOverlay, color=(0.0, 0.0, 0.0, 0.3)) LoadingWheel(name='loadingWheel', parent=self.loadingOverlay, align=uiconst.CENTER, width=80, height=80) self.loadingOverlay.opacity = 0.0 self.controller = CreateReprocessingWindowController(self, self.inputInfoCont, self.outputInfoCont, sm.GetService('invCache'), sm.GetService('reprocessing'), GetActiveShip) self.inputInfoCont.captionLabel.text = GetByLabel('UI/Reprocessing/ReprocessingWindow/InputMaterials') self.outputInfoCont.captionLabel.text = GetByLabel('UI/Reprocessing/ReprocessingWindow/OutputResults') btnCont = Container(name='buttonCont', parent=bottomCont, align=uiconst.TOBOTTOM, height=36, idx=0, padding=(-4, 3, -4, -2)) GradientUnderlay(bgParent=btnCont) self.reprocessButton = Button(parent=btnCont, label=GetByLabel('UI/Reprocessing/ReprocessingWindow/ReprocessButton'), func=self.ReprocessItems, align=uiconst.CENTER, fixedheight=28) self.cancelButton = Button(parent=btnCont, label=GetByLabel('UI/Common/Buttons/Cancel'), func=self.Cancel, align=uiconst.CENTERRIGHT, left=8) self.DisableReprocessButton(disable=True) if self.preSelectedItems: start_tasklet(self.AddPreselectedItems, self.preSelectedItems)
def PrimeTimeMenu(self, menuParent): headerCont = menuParent.AddContainer(align=uiconst.TOTOP, height=20, padding=const.defaultPadding) EveLabelLargeBold(parent=headerCont, text=GetByLabel('UI/Sovereignty/SetSovereigntyHour'), align=uiconst.TOTOP) menuParent.AddSpace(height=10) text = menuParent.AddText( GetByLabel('UI/Sovereignty/SetNewVulnerabilityTimeDescription')) text.GetEntryWidth = lambda mc=text: 250 cont = menuParent.AddContainer(align=uiconst.TOTOP, height=60, padding=const.defaultPadding) myCont = Container(name='myCont', parent=cont, align=uiconst.TOTOP, height=22, padTop=10) currentPrimeHour = self.GetCurrentPrimeHour() self.primeTimeCombo = Combo(name='primeTimeCombo', parent=myCont, options=self.GetTimeComboOptions(), select=currentPrimeHour, width=150) setBtn = Button(name='SetPrimeTimeBtn', align=uiconst.TOPRIGHT, parent=myCont, label=GetByLabel('UI/Common/CommandSet'), func=self.SetPrimeTime)
def GetStationEfficiencyAsLabel(stationEfficiency): """ Takes in float: stationEfficiency and returns labels: stationBonusLabel, stationTextLabel. """ stationBonusLabel = EveLabelMedium(text=GetByLabel('UI/Common/Formatting/Percentage', percentage=stationEfficiency * 100), colSpan=1, align=uiconst.TORIGHT, padRight=2, color=COL_LIGHTBLUE, bold=True) stationTextLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/BaseYield'), colSpan=1, padLeft=2) return (stationBonusLabel, stationTextLabel)
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()
def GetOreAvgBonusAsLabel(avgBonus): """ Takes in float: avgBonus and returns labels: oreAvgBonusLabel, oreAvgTextLabel. """ oreAvgBonusLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/YieldFormatting', bonusYield=1.0 + avgBonus / 100), colSpan=1, align=uiconst.TORIGHT, padRight=3, color=COL_GREEN, bold=True) oreAvgTextLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/OreProcessingHint'), colSpan=1, padLeft=3) return (oreAvgBonusLabel, oreAvgTextLabel)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.MakeUnResizeable() self.controller = attributes.controller self.btnGroup = ButtonGroup(parent=self.sr.main, idx=0, line=True) self.btnGroup.AddButton(GetByLabel(self.confirmLabelPath), self.OnConfirmClicked) self.btnGroup.AddButton(GetByLabel('UI/Commands/Cancel'), self.Cancel) self.groupNameField = SinglelineEdit(parent=self.sr.main, align=uiconst.TOTOP, label=GetByLabel( self.nameLabelPath), padding=4, top=10, maxLength=30) EveLabelSmall(name='titleHeader', parent=self.sr.main, text=GetByLabel(self.descriptionLabelPath), align=uiconst.TOTOP, top=6, padLeft=4) self.groupDescField = EditPlainText(parent=self.sr.main, padding=(4, 0, 4, 4), maxLength=200) self.PopulateFields()
def GetStationTaxAsLabel(stationTax): """ Takes in float: stationTax and returns two labels: taxBonusLabel, taxTextLabel. """ taxBonusLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/YieldFormatting', bonusYield=1.0 - stationTax), colSpan=1, align=uiconst.TORIGHT, padRight=3, color=COL_RED, bold=True) taxTextLabel = EveLabelMedium(text=GetByLabel('UI/Reprocessing/ReprocessingWindow/StationTaxHint'), colSpan=1, padLeft=3) return (taxBonusLabel, taxTextLabel)
def AddScheduleToTooltip(self, tooltipPanel, typeID, hoursThisWeek, hoursNextWeek): tooltipPanel.margin = (8, 8, 8, 8) tooltipPanel.cellSpacing = (30, 10) tooltipPanel.AddLabelLarge( text=GetByLabel('UI/StructureProfiles/ThisWeek'), align=uiconst.CENTER, bold=True) thisWeekSchedule = structures.Schedule(hoursThisWeek) scheduleCont = Container(width=self.scheduleSize, height=self.scheduleSize, align=uiconst.TOPLEFT) VulnerabilitySchedulerWithReinforcement(parent=scheduleCont, canModify=False, schedule=thisWeekSchedule, frame=False) if hoursThisWeek == hoursNextWeek: tooltipPanel.columns = 1 tooltipPanel.AddCell(cellObject=scheduleCont) else: tooltipPanel.columns = 2 tooltipPanel.AddLabelLarge( text=GetByLabel('UI/StructureProfiles/NextWeek'), align=uiconst.CENTER, bold=True) tooltipPanel.AddCell(cellObject=scheduleCont) nextWeekSchedule = structures.Schedule(hoursNextWeek) scheduleCont = Container(width=self.scheduleSize, height=self.scheduleSize, align=uiconst.TOPLEFT) VulnerabilitySchedulerWithReinforcement(parent=scheduleCont, canModify=False, schedule=nextWeekSchedule, frame=False) tooltipPanel.AddCell(cellObject=scheduleCont)
def _GetSpeedFormatted(self, speed): if math.isnan(speed): return '' if speed < 100: return GetByLabel('UI/Inflight/MetersPerSecond', speed=round(speed, 1)) return GetByLabel('UI/Inflight/MetersPerSecond', speed=int(speed))
def UpdateProgress(self): if self.groupData.IsCompleted(): self.rewardAmount.hint = GetByLabel( 'UI/Achievements/OpportunityRewardGiven') self.rewardAmount.bold = True self.rewardAmount.color = self.rewardAmountThemeColor else: self.rewardAmount.color = (1.0, 1.0, 1.0, 0.5) self.rewardAmount.hint = GetByLabel( 'UI/Achievements/OpportunityRewardNotGiven') self.rewardAmount.bold = False progressProportion = self.groupData.GetProgressProportion() maxWidth = ReverseScaleDpi(self.displayWidth) - POINTER_PADRIGHT uicore.animations.MorphScalar(self.progress, 'padRight', startVal=self.progress.padRight, endVal=POINTER_PADRIGHT + maxWidth * (1 - progressProportion), curveType=uiconst.ANIM_SMOOTH, duration=0.33) uicore.animations.MorphScalar(self.progress, 'opacity', startVal=self.progress.opacity, endVal=min(progressProportion, 0.25), curveType=uiconst.ANIM_SMOOTH, duration=0.33)
def CheckExpandBtns(self): on = settings.user.ui.Get('hudButtonsExpanded', 1) if on: self.toggleLeftBtn.LoadTexture('res:/UI/Texture/classes/ShipUI/expandBtnRight.png') else: self.toggleLeftBtn.LoadTexture('res:/UI/Texture/classes/ShipUI/expandBtnLeft.png') self.toggleLeftBtn.hint = [GetByLabel('UI/Inflight/ShowButtons'), GetByLabel('UI/Inflight/HideButtons')][on]