def Load(self, args): if not self.sr.Get('inited', 0): self.sr.inited = 1 self.sr.wndButtonContainer = uiprimitives.Container(name='results', parent=self, align=uiconst.TOTOP, height=16) showHide = uiprimitives.Container(name='filters', parent=self.sr.wndButtonContainer, height=48, align=uiconst.TOTOP) uiprimitives.Line(parent=showHide, align=uiconst.TOTOP, top=15, color=(0.0, 0.0, 0.0, 0.25)) uiprimitives.Line(parent=showHide, align=uiconst.TOTOP) self.sr.showHide = showHide uicontrols.EveHeaderSmall(text=localization.GetByLabel('UI/Corporations/BaseCorporationUI/Query'), parent=showHide, left=8, top=3, state=uiconst.UI_NORMAL) a = uicontrols.EveHeaderSmall(text='', parent=showHide, left=18, top=3, state=uiconst.UI_NORMAL, align=uiconst.TOPRIGHT) a.OnClick = self.ShowHideQuery a.GetMenu = None self.sr.ml = a expander = uiprimitives.Sprite(parent=showHide, pos=(6, 2, 11, 11), name='expandericon', state=uiconst.UI_NORMAL, texturePath='res:/UI/Texture/Shared/expanderDown.png', align=uiconst.TOPRIGHT) expander.OnClick = self.ShowHideQuery self.sr.showHideExp = expander self.sr.wndButtonContainer.state = uiconst.UI_HIDDEN wndQueryForm = self.sr.wndQuery.Load(self, self.PopulateView) wndQueryForm.align = uiconst.TOTOP wndQueryForm.height = 180 self.sr.wndQueryForm = wndQueryForm wndForm = uiprimitives.Container(name='form', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.sr.wndForm = wndForm wndOutputTypeArea = uiprimitives.Container(name='output_type', parent=wndForm, align=uiconst.TOTOP, height=24) uiprimitives.Container(name='push', parent=wndOutputTypeArea, align=uiconst.TOTOP, height=6) label = uiprimitives.Container(name='text', parent=wndOutputTypeArea, align=uiconst.TOLEFT, width=150) uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/ShowResultsUsingLabel'), parent=label, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) optlist = [[localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/SimpleList'), form.CorpMembersViewSimple], [localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/RoleManagementList'), form.CorpMembersViewRoleManagement], [localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/TaskManagementList'), form.CorpMembersViewTaskManagement]] countcombo = uicontrols.Combo(label='', parent=wndOutputTypeArea, options=optlist, name='resultViewType', callback=self.OnComboChange, width=146, align=uiconst.TOLEFT) self.sr.outputTypeCombo = countcombo self.sr.outputWindowContainer = None viewClass = self.sr.outputTypeCombo.GetValue() self.SwitchToView(viewClass) sm.GetService('corpui').LoadTop('res:/ui/Texture/WindowIcons/corporationmembers.png', localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/FindMemberInRole'))
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.specialGroups = util.GetNPCGroups() self.filterID = None self.scope = 'inflight' self.SetCaption(localization.GetByLabel('UI/Inflight/Scanner/ScannerFilterEditor')) self.SetMinSize([300, 250]) self.SetWndIcon() self.SetTopparentHeight(0) self.sr.main = uiutil.GetChild(self, 'main') topParent = uiprimitives.Container(name='topParent', parent=self.sr.main, height=64, align=uiconst.TOTOP) topParent.padRight = 6 topParent.padLeft = 6 uicontrols.EveHeaderSmall(text=localization.GetByLabel('UI/Inflight/Scanner/FilterName'), parent=topParent, state=uiconst.UI_DISABLED, idx=0, top=2) nameEdit = uicontrols.SinglelineEdit(name='name', parent=topParent, setvalue=None, align=uiconst.TOTOP, maxLength=64) nameEdit.top = 16 self.sr.nameEdit = nameEdit hint = uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Inflight/Scanner/SelectGroupsToFilter'), parent=topParent, align=uiconst.TOTOP) hint.top = 4 self.sr.topParent = topParent self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll.multiSelect = 0 self.DefineButtons(uiconst.OKCANCEL, okLabel=localization.GetByLabel('UI/Common/Buttons/Save'), okFunc=self.SaveChanges, cancelFunc=self.Close) self.scanGroupsNames = {const.probeScanGroupSignatures: localization.GetByLabel('UI/Inflight/Scanner/CosmicSignature'), const.probeScanGroupShips: localization.GetByLabel('UI/Inflight/Scanner/Ship'), const.probeScanGroupStructures: localization.GetByLabel('UI/Inflight/Scanner/Structure'), const.probeScanGroupDronesAndProbes: evetypes.GetCategoryNameByCategory(const.categoryDrone)} self.Maximize() self.OnResizeUpdate()
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.pinned = False self.isSelected = False self.canBeModified = attributes.get('canBeModified', True) self.safetyLevel = attributes.get('safetyLevel') self.data = SAFETY_LEVEL_DATA_MAP[self.safetyLevel] self.normalHint = localization.GetByLabel( self.data.safetySelectionHint) self.lockedHint = localization.GetByLabel( self.data.safetySelectionHintLocked) cont = uiprimitives.Container(name='content', parent=self, padding=3) self.text = uicontrols.EveHeaderSmall( name='buttonLabel', parent=cont, color=self.data.color.GetRGBA(), text=localization.GetByLabel(self.data.buttonText), align=uiconst.CENTER, opacity=DESELECTED_BUTTON_OPACITY, bold=True) self.defaultSprite = uiprimitives.Sprite( parent=self, name='default', texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Default.png', align=uiconst.TOALL, state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=DESELECTED_BUTTON_OPACITY) self.highlightSprite = uiprimitives.Sprite( parent=self, name='highlight', texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Highlight.png', align=uiconst.TOALL, state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA()) self.highlightSprite.Hide() self.leftArrowSprite = uiprimitives.Sprite( parent=self, name='leftArrows', texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png', align=uiconst.CENTERLEFT, pos=(-24, 0, 16, 13), state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=0.0) self.rightArrows = uiprimitives.Transform(parent=self, name='rightArrowsTranform', align=uiconst.CENTERRIGHT, pos=(-24, 0, 16, 13), state=uiconst.UI_DISABLED, rotation=pi) self.rightArrowSprite = uiprimitives.Sprite( parent=self.rightArrows, name='rightArrows', texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png', align=uiconst.CENTERRIGHT, pos=(0, 0, 16, 13), state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=0.0)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) shipID = attributes.shipID cargoList = attributes.cargoList bp = sm.GetService('michelle').GetBallpark() if not bp: return slimItem = bp.slimItems[shipID] shipName = uix.GetSlimItemName(slimItem) self.SetCaption( localization.GetByLabel('UI/Ship/ShipScan/ShipNameCargo', shipName=shipName, cargoListLen=len(cargoList))) self.SetMinSize([200, 200]) self.SetWndIcon(self.iconNum, mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.scroll = uicontrols.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicontrols.EveHeaderSmall( text=localization.GetByLabel('UI/Ship/ShipScan/hdrCargoScan'), parent=self.sr.topParent, left=8, state=uiconst.UI_DISABLED, align=uiconst.BOTTOMLEFT)
def AddHint(hint, where): hintobj = uiprimitives.Container(parent=where, name='hint', align=uiconst.TOPLEFT, width=200, height=16, idx=0, state=uiconst.UI_DISABLED) hintobj.hinttext = uicontrols.EveHeaderSmall(text=hint, parent=hintobj, top=4, state=uiconst.UI_DISABLED) border = uicontrols.Frame(parent=hintobj, frameConst=uiconst.FRAME_BORDER1_CORNER5, state=uiconst.UI_DISABLED, color=(1.0, 1.0, 1.0, 0.25)) frame = uicontrols.Frame(parent=hintobj, color=(0.0, 0.0, 0.0, 0.75), frameConst=uiconst.FRAME_FILLED_CORNER4, state=uiconst.UI_DISABLED) if hintobj.hinttext.textwidth > 200: hintobj.hinttext.width = 200 hintobj.hinttext.text = '<center>' + hint + '</center>' hintobj.width = max(56, hintobj.hinttext.textwidth + 16) hintobj.height = max( 16, hintobj.hinttext.textheight + hintobj.hinttext.top * 2) hintobj.left = (where.width - hintobj.width) / 2 hintobj.top = -hintobj.height - 4 hintobj.hinttext.left = (hintobj.width - hintobj.hinttext.textwidth) / 2
def Setup(self, moduleinfo): targetContainer = uiprimitives.Container(name='targetCont', align=uiconst.TOPLEFT, parent=self, top=0, height=64, width=64) slot = DefenceModuleButton(parent=targetContainer, idx=0) self.sr.targetIcon = uiutil.GetChild(targetContainer, 'iconSprite') self.sr.targetContainer = targetContainer self.sr.targetContainer.state = uiconst.UI_DISABLED sourceContainer = uiprimitives.Container(name='sourceCont', align=uiconst.TOPLEFT, parent=self, top=targetContainer.height + 22, height=64, width=64) slot = DefenceModuleButton(parent=sourceContainer, idx=0) self.sr.sourceIcon = uiutil.GetChild(sourceContainer, 'iconSprite') self.sr.sourceIcon.state = uiconst.UI_DISABLED self.sr.glow = uiutil.GetChild(sourceContainer, 'glow') self.sr.busy = uiutil.GetChild(sourceContainer, 'busy') self.sr.quantityParent = uiutil.GetChild(sourceContainer, 'quantityParent') self.sr.quantityParent.left = 8 self.sr.quantityParent.width = 28 idx = self.parent.children.index(self) fill = uiprimitives.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.125), state=uiconst.UI_HIDDEN, idx=idx) self.sr.hilite = fill self.sr.sourceContainer = sourceContainer self.sr.sourceContainer.state = uiconst.UI_DISABLED chargeIcon = uicontrols.Icon(parent=sourceContainer, align=uiconst.RELATIVE, top=32, left=6, size=24, idx=0, state=uiconst.UI_HIDDEN, ignoreSize=True) self.sr.chargeIcon = chargeIcon if not len(self.__cgattrs__): self.__cgattrs__.extend([ a.attributeID for a in cfg.dgmattribs if cgre.match(a.attributeName) is not None ]) self.sr.typeID = moduleinfo.typeID self.moduleinfo = moduleinfo self.locationFlag = moduleinfo.flagID self.sr.sourceID = moduleinfo.itemID self.id = moduleinfo.itemID self.sr.glow.z = 0 self.sr.qtylabel = uicontrols.Label(text='', parent=self.sr.quantityParent, width=30, state=uiconst.UI_DISABLED, idx=0, fontsize=9) self.sr.distancelabel = uicontrols.EveHeaderSmall(text='', parent=self.sr.targetContainer, left=12, top=-16, width=70, state=uiconst.UI_DISABLED, idx=0) if cfg.IsChargeCompatible(moduleinfo): self.invCookie = sm.GetService('inv').Register(self) self.SetCharge(None) for key in moduleinfo.effects.iterkeys(): effect = moduleinfo.effects[key] if self.IsEffectActivatible(effect): self.def_effect = effect if effect.isActive: self.SetActive() if effect.effectName == 'online': if effect.isActive: self.ShowOnline() else: self.ShowOffline() self.state = uiconst.UI_NORMAL currentTarget = self.GetCurrentTarget() if currentTarget is not None: uthread.pool('DefenceMobuleButton::OnTargetAdded::', self.OnTargetAdded, currentTarget) self.sr.sourceUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'source') self.UpdateData('source') self.sr.targetUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'target') self.UpdateData('target') self.UpdateDistance() self.sr.distanceUpdateTimer = base.AutoTimer(random.randint(5000, 6000), self.UpdateDistance) self.EnableDrag() uthread.new(self.BlinkIcon)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) shipID = attributes.shipID self.SetMinSize([200, 200]) self.SetWndIcon(self.iconNum, mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.capacityText = uicontrols.EveHeaderSmall( text=' ', name='capacityText', parent=self.sr.topParent, left=8, top=4, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED) self.sr.gaugeParent = uiprimitives.Container( name='gaugeParent', align=uiconst.TOPRIGHT, parent=self.sr.topParent, left=const.defaultPadding, height=7, width=100, state=uiconst.UI_DISABLED, top=self.sr.capacityText.top + self.sr.capacityText.textheight + 1) uicontrols.Frame(parent=self.sr.gaugeParent, color=(0.5, 0.5, 0.5, 0.3)) self.sr.gauge = uiprimitives.Container(name='gauge', align=uiconst.TOLEFT, parent=self.sr.gaugeParent, state=uiconst.UI_PICKCHILDREN, width=0) uiprimitives.Fill(parent=self.sr.gaugeParent, color=(0.0, 0.521, 0.67, 0.1), align=uiconst.TOALL) uiprimitives.Fill(parent=self.sr.gauge, color=(0.0, 0.521, 0.67, 0.6)) self.sr.scroll = uicontrols.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicontrols.EveHeaderSmall( text=localization.GetByLabel('UI/Ship/ShipScan/hdrModulesFitted'), parent=self.sr.topParent, left=8, state=uiconst.UI_DISABLED, align=uiconst.BOTTOMLEFT) self.LoadResult(*attributes.results)
def StartupWelcomePanel(self, *args): welcomePanel = self.sr.welcomePanel cbCont = uiprimitives.Container(name='cbCont', parent=welcomePanel, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 20)) self.sr.wekcomeToAllCB = uicontrols.Checkbox( text=localization.GetByLabel( 'UI/EVEMail/MailingLists/SendWelcomeMailToAllCheckbox'), parent=cbCont, configName='welcomeToAllCB', retval=self.mailingListID, checked=settings.user.ui.Get( 'welcomeToAllCB_%s' % self.mailingListID, 0), align=uiconst.TOPLEFT, pos=(0, 0, 330, 0), callback=self.OnCheckboxChange) subjectCont = uiprimitives.Container(name='subjectCont', parent=welcomePanel, align=uiconst.TOTOP, pos=(0, 0, 0, 30), padding=(0, 0, 1, 0)) subjectTextCont = uiprimitives.Container(name='subjectCont', parent=subjectCont, align=uiconst.TOLEFT, pos=(0, 0, 40, 0)) subjectLabel = uicontrols.EveHeaderSmall(text=localization.GetByLabel( 'UI/EVEMail/MailingLists/WelcomeMailSubject'), parent=subjectTextCont, align=uiconst.TOPLEFT, top=2, left=0, state=uiconst.UI_NORMAL) subjectTextCont.width = subjectLabel.textwidth + 5 self.sr.subjecField = uicontrols.SinglelineEdit( name='subjecField', parent=subjectCont, maxLength=const.mailMaxSubjectSize, pos=(0, 0, 0, 0), label='', align=uiconst.TOTOP) self.sr.welcomeScrollCont = scrollCont = uiprimitives.Container( name='scrollCont', parent=welcomePanel, align=uiconst.TOALL) self.sr.welcomeEdit = uicls.EditPlainText( setvalue='', parent=self.sr.welcomeScrollCont, align=uiconst.TOALL, showattributepanel=1) uicontrols.ButtonGroup(btns=[[ localization.GetByLabel('UI/Common/Buttons/Save'), self.SaveWelcomeMail, None, None ]], parent=welcomePanel, idx=0, line=False)
def CountDown(self, tid): if self.destroyed: return self.countDown = 1 self.scanAttributeChangeFlag = False slimItem = sm.GetService('michelle').GetBallpark().GetInvItem(tid) source = self.sr.sourceID time = sm.GetService('bracket').GetScanSpeed(source, slimItem) if hasattr(self, 'sr') and self.sr.Get('targetContainer'): par = uiprimitives.Container(parent=self.sr.targetContainer, width=52, height=13, left=6, top=62, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED) t = uicontrols.EveHeaderSmall(text='', parent=par, width=200, left=6, top=1, state=uiconst.UI_NORMAL) p = uiprimitives.Fill(parent=par, align=uiconst.RELATIVE, width=48, height=11, left=1, top=1, color=(1.0, 1.0, 1.0, 0.25)) uicontrols.Frame(parent=par, color=(1.0, 1.0, 1.0, 0.5)) startTime = blue.os.GetSimTime() while not self.destroyed and self.countDown: now = blue.os.GetSimTime() dt = blue.os.TimeDiffInMs(startTime, now) if self.scanAttributeChangeFlag: waitRatio = dt / float(time) self.scanAttributeChangeFlag = False time = sm.GetService('bracket').GetScanSpeed(source, slimItem) startTime = now - long(time * waitRatio * 10000) dt = blue.os.TimeDiffInMs(startTime, now) if t.destroyed: return t.text = localization.formatters.FormatNumeric((time - dt) / 1000.0, decimalPlaces=3) if dt > time: t.text = localization.GetByLabel('UI/Inflight/Brackets/TargetLocked') break p.width = int(48 * ((time - dt) / time)) blue.pyos.synchro.Sleep(51) if self.destroyed: return if not self.countDown: par.Close() p.width = 0 blue.pyos.synchro.SleepWallclock(250) if t.destroyed: return t.text = '' blue.pyos.synchro.SleepWallclock(250) if t.destroyed: return t.text = localization.GetByLabel('UI/Inflight/Brackets/TargetLocked') blue.pyos.synchro.SleepWallclock(250) if t.destroyed: return t.text = '' blue.pyos.synchro.SleepWallclock(250) if t.destroyed: return t.text = localization.GetByLabel('UI/Inflight/Brackets/TargetLocked') blue.pyos.synchro.SleepWallclock(250) par.Close()
def ConstructWarzoneSignupPanel(self): """ Loading the left hand side (happens when the character are not in FW or their faction doesn't own the station) """ textCont = uiprimitives.Container(name='text', parent=self.warzonePanel, align=uiconst.TOTOP, height=128, width=self.warzonePanel.width) enlistInfoLabel = 'UI/Generic/Unknown' if self.factionID == 500001: enlistInfoLabel = 'UI/FactionWarfare/EnlistInfoCaldari' elif self.factionID == 500002: enlistInfoLabel = 'UI/FactionWarfare/EnlistInfoMinmatar' elif self.factionID == 500003: enlistInfoLabel = 'UI/FactionWarfare/EnlistInfoAmarr' elif self.factionID == 500004: enlistInfoLabel = 'UI/FactionWarfare/EnlistInfoGallente' else: log.LogError('Unknown Faction.') text = uicontrols.EveLabelMedium(text=localization.GetByLabel(enlistInfoLabel), parent=textCont, left=8, top=8, width=textCont.width - 16, state=uiconst.UI_NORMAL) textCont.height = text.height + const.defaultPadding isSafe = sm.StartService('facwar').CheckForSafeSystem(eve.stationItem, self.factionID) warntxt = '' if not isSafe: if session.allianceid is not None: warntxt = localization.GetByLabel('UI/FactionWarfare/CantEnlistAllianceHereInfo') else: warntxt = localization.GetByLabel('UI/FactionWarfare/CantEnlistHereInfo') uiprimitives.Container(name='push', parent=self.warzonePanel, align=uiconst.TOTOP, height=8) uiprimitives.Container(name='push', parent=self.warzonePanel, align=uiconst.TOTOP, height=4) buttonCont = uiprimitives.Container(name='signupBtns', parent=self.warzonePanel, align=uiconst.TORIGHT, width=98) buttonCont.state = uiconst.UI_HIDDEN if not buttons else uiconst.UI_NORMAL textCont = uiprimitives.Container(name='text', parent=self.warzonePanel, align=uiconst.TOALL, pos=(2 * const.defaultPadding, const.defaultPadding, 2 * const.defaultPadding, const.defaultPadding)) warnTextCont = None if warntxt: warnTextCont = uiprimitives.Container(name='warntext', parent=textCont, align=uiconst.TOTOP, height=72) uiprimitives.Container(name='push', parent=textCont, align=uiconst.TOTOP, height=4) uicontrols.Frame(parent=warnTextCont, color=(1.0, 1.0, 1.0, 0.125)) uiprimitives.Fill(parent=warnTextCont, color=(32 / 256.0, 41 / 256.0, 46 / 256.0, 168 / 256.0)) infoicon = uicontrols.Icon(parent=warnTextCont, icon='33_3', left=const.defaultPadding, top=const.defaultPadding, idx=0, width=64, height=64, state=uiconst.UI_DISABLED, ignoreSize=True) wrntext = uicontrols.EveHeaderSmall(text=warntxt, parent=warnTextCont, align=uiconst.TOALL, idx=0, top=8, left=72, width=6, state=uiconst.UI_NORMAL) warnTextCont.height = max(72, wrntext.textheight + 16) text = uicontrols.EveLabelMedium(text=infotxt, parent=textCont, align=uiconst.TOALL, state=uiconst.UI_NORMAL)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) itemID = attributes.itemID self.scope = 'all' self.sr.container = sm.GetService('invCache').GetInventoryFromId(itemID) self.sr.itemID = itemID self.sr.logIDmax = None self.sr.logIDmin = None self.SetMinSize([400, 400]) self.SetWndIcon() self.SetTopparentHeight(0) self.SetCaption(localization.GetByLabel('UI/AuditContainerLogViewer/AuditLogTitle')) self.sr.logOptions = uiprimitives.Container(name='logOptions', parent=self.sr.main, align=uiconst.TOTOP, height=36, idx=1) sidepar = uiprimitives.Container(name='sidepar', parent=self.sr.logOptions, align=uiconst.TORIGHT, width=54) btn = uix.GetBigButton(24, sidepar, 0, 12) btn.OnClick = (self.BrowseLog, 0) btn.hint = localization.GetByLabel('UI/Common/Previous') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_1') self.sr.wndBackBtn = btn btn = uix.GetBigButton(24, sidepar, 24, 12) btn.OnClick = (self.BrowseLog, 1) btn.hint = localization.GetByLabel('UI/Common/More') btn.state = uiconst.UI_HIDDEN btn.sr.icon.LoadIcon('ui_23_64_2') self.sr.wndFwdBtn = btn self.sr.fromDate = self.GetNow() inpt = uicontrols.SinglelineEdit(name='fromdate', parent=self.sr.logOptions, setvalue=self.sr.fromDate, align=uiconst.TOPLEFT, pos=(const.defaultPadding, 16, 72, 0), maxLength=16) dateLabel = localization.GetByLabel('UI/Common/Date') uicontrols.EveHeaderSmall(text=dateLabel, parent=inpt, width=200, top=-12, state=uiconst.UI_NORMAL) self.sr.wndFromDate = inpt self.sr.wndFromDate.OnReturn = self.GetDate self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.ViewLogForContainer()
def Startup(self, *args): sub = uiprimitives.Container(name='sub', parent=self) self.sr.inTrainingHilite = uiprimitives.Fill(parent=self, name='inTrainingHilite', padTop=1, padBottom=1, color=self.blueColor, state=uiconst.UI_HIDDEN) self.sr.inTrainingHilite.SetAlpha(0.15) self.sr.icon = uicontrols.Icon(name='skillIcon', parent=sub, align=uiconst.TOPLEFT, top=2, size=32, width=32, height=32, ignoreSize=True) self.sr.icon.state = uiconst.UI_DISABLED self.sr.haveicon = uicontrols.Icon(name='haveIcon', parent=sub, size=16, left=20, align=uiconst.TOPRIGHT, state=uiconst.UI_HIDDEN) self.sr.levelParent = uiprimitives.Container(name='levelParent', parent=sub, align=uiconst.TORIGHT, state=uiconst.UI_DISABLED, padRight=18) self.sr.levelHeaderParent = uiprimitives.Container( name='levelHeaderParent', parent=sub, align=uiconst.TORIGHT, state=uiconst.UI_HIDDEN) self.sr.levels = uiprimitives.Container(name='levels', parent=self.sr.levelParent, align=uiconst.TOPLEFT, left=0, top=5, width=48, height=10) uicontrols.Frame(parent=self.sr.levels, color=self.whiteColor) for i in xrange(5): f = uiprimitives.Fill(parent=self.sr.levels, name='level%d' % i, align=uiconst.RELATIVE, color=(1.0, 1.0, 1.0, 0.5), left=2 + i * 9, top=2, width=8, height=6) setattr(self.sr, 'box_%s' % i, f) self.sr.progressbarparent = uiprimitives.Container( name='progressbarparent', parent=self.sr.levelParent, align=uiconst.TOPLEFT, left=0, top=20, width=48, height=6) self.sr.progressBar = uiprimitives.Fill( parent=self.sr.progressbarparent, name='progressbar', align=uiconst.RELATIVE, color=self.whiteColor, height=4, top=1, left=1, state=uiconst.UI_HIDDEN) uicontrols.Frame(parent=self.sr.progressbarparent) self.sr.levelHeader1 = uicontrols.EveLabelSmall( text='', parent=self.sr.levelHeaderParent, left=10, top=3, state=uiconst.UI_DISABLED, idx=0, align=uiconst.TOPRIGHT) self.sr.levelHeader1.name = 'levelHeader1' textCont = uiprimitives.Container(name='textCont', parent=sub, align=uiconst.TOALL, padLeft=32, clipChildren=1) self.sr.nameLevelLabel = uicontrols.EveLabelMedium( text='', parent=textCont, left=0, top=0, state=uiconst.UI_DISABLED, maxLines=1) self.sr.nameLevelLabel.name = 'nameLevelLabel' self.sr.pointsLabel = uicontrols.EveLabelMedium( text='', parent=textCont, left=0, top=16, state=uiconst.UI_DISABLED, maxLines=1) self.sr.pointsLabel.name = 'pointsLabel' self.sr.timeLeftText = uicontrols.EveHeaderSmall( text='', parent=self.sr.levelHeaderParent, left=10, top=17, state=uiconst.UI_DISABLED, idx=0, align=uiconst.TOPRIGHT) self.sr.timeLeftText.name = 'timeLeftText' uiprimitives.Line(parent=self, align=uiconst.TOBOTTOM, color=uiconst.ENTRY_LINE_COLOR) self.sr.infoicon = uicontrols.InfoIcon(size=16, left=2, parent=sub, idx=0, name='infoicon', align=uiconst.CENTERRIGHT) self.sr.infoicon.OnClick = self.ShowInfo self.endOfTraining = None
def ShowTimer(self, timerID, startTime, duration, label): check = self.GetTimer(timerID) if check: if check.endTime <= startTime + duration: check.Close() else: return timer = uiprimitives.Container(name='%s' % timerID, parent=self.sr.gaugeParent, align=uiconst.TOTOP, height=7, padTop=5, padBottom=1) timer.endTime = startTime + duration timer.timerID = timerID self.ArrangeGauges() t1 = uicontrols.EveHeaderSmall(text=label, parent=timer, left=68, top=-1, state=uiconst.UI_DISABLED) uicontrols.Frame(parent=timer, padding=-1, color=(1.0, 1.0, 1.0, 0.5)) t = uicontrols.EveLabelSmall(text='', parent=timer, left=5, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL) p = uiprimitives.Fill(parent=timer, align=uiconst.TOLEFT) timer.height = max(7, t.textheight - 3, t1.textheight - 3) duration = float(duration) while 1 and not timer.destroyed: now = blue.os.GetSimTime() dt = blue.os.TimeDiffInMs(startTime, now) timeLeft = (duration - dt) / 1000.0 timer.timeLeft = timeLeft if timer.destroyed or dt > duration: t.text = localization.GetByLabel('UI/Common/Done') p.width = 0 break t.text = localization.GetByLabel( 'UI/Inflight/Target/TimerDuration', timeLeft=timeLeft) p.width = int(timer.displayWidth * ((duration - dt) / duration)) timer.height = max(7, t.textheight - 3) blue.pyos.synchro.Yield() blue.pyos.synchro.SleepWallclock(250) if not timer.destroyed and not self.destroyed: t.text = '' blue.pyos.synchro.SleepWallclock(250) if not timer.destroyed and not self.destroyed: t.text = localization.GetByLabel('UI/Common/Done') blue.pyos.synchro.SleepWallclock(250) if not timer.destroyed and not self.destroyed: t.text = '' blue.pyos.synchro.SleepWallclock(250) if not timer.destroyed and not self.destroyed: t.text = localization.GetByLabel('UI/Common/Done') blue.pyos.synchro.SleepWallclock(250) if not timer.destroyed and not self.destroyed: t.text = '' timer.Close() if not self.destroyed: self.ArrangeGauges()