def Load(self, args): if not self.sr.Get('inited', 0): self.sr.inited = 1 self.sr.wndButtonContainer = uicls.Container(name='results', parent=self, align=uiconst.TOTOP, height=16) showHide = uicls.Container(name='filters', parent=self.sr.wndButtonContainer, height=48, align=uiconst.TOTOP) uicls.Line(parent=showHide, align=uiconst.TOTOP, top=15, color=(0.0, 0.0, 0.0, 0.25)) uicls.Line(parent=showHide, align=uiconst.TOTOP) self.sr.showHide = showHide uicls.EveHeaderSmall(text=localization.GetByLabel('UI/Corporations/BaseCorporationUI/Query'), parent=showHide, left=8, top=3, state=uiconst.UI_NORMAL) a = uicls.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 = uicls.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 = uicls.Container(name='form', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.sr.wndForm = wndForm wndOutputTypeArea = uicls.Container(name='output_type', parent=wndForm, align=uiconst.TOTOP, height=24) uicls.Container(name='push', parent=wndOutputTypeArea, align=uiconst.TOTOP, height=6) label = uicls.Container(name='text', parent=wndOutputTypeArea, align=uiconst.TOLEFT, width=150) uicls.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 = uicls.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('07_11', localization.GetByLabel('UI/Corporations/CorporationWindow/Members/FindMemberInRole/FindMemberInRole'))
def ApplyAttributes(self, attributes): uicls.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('ui_3_64_11', mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.scroll = uicls.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicls.EveHeaderSmall( text=localization.GetByLabel('UI/Ship/ShipScan/hdrCargoScan'), parent=self.sr.topParent, left=8, state=uiconst.UI_DISABLED, align=uiconst.BOTTOMLEFT)
def ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self.specialGroups = util.GetNPCGroups() 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 = uicls.Container(name='topParent', parent=self.sr.main, height=64, align=uiconst.TOTOP) topParent.padRight = 6 topParent.padLeft = 6 uicls.EveHeaderSmall( text=localization.GetByLabel('UI/Inflight/Scanner/FilterName'), parent=topParent, state=uiconst.UI_DISABLED, idx=0, top=2) nameEdit = uicls.SinglelineEdit(name='name', parent=topParent, setvalue=None, align=uiconst.TOTOP, maxLength=64) nameEdit.top = 16 self.sr.nameEdit = nameEdit hint = uicls.EveLabelMedium(text=localization.GetByLabel( 'UI/Inflight/Scanner/SelectGroupsToFilter'), parent=topParent, align=uiconst.TOTOP) hint.top = 4 self.sr.topParent = topParent self.sr.scroll = uicls.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.probeScanGroupAnomalies: localization.GetByLabel('UI/Inflight/Scanner/CosmicAnomaly'), 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: localization.GetByLabel('UI/Inflight/Scanner/DroneAndProbe') } self.Maximize() self.OnResizeUpdate()
def ApplyAttributes(self, attributes): uicls.Container.ApplyAttributes(self, attributes) self.pinned = False self.isSelected = False self.safetyLevel = attributes.get('safetyLevel') self.data = SAFETY_LEVEL_DATA_MAP[self.safetyLevel] self.SetHint(localization.GetByLabel(self.data.safetySelectionHint)) cont = uicls.Container(name='content', parent=self, padding=3) self.text = uicls.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 = uicls.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 = uicls.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 = uicls.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 = uicls.Transform(parent=self, name='rightArrowsTranform', align=uiconst.CENTERRIGHT, pos=(-24, 0, 16, 13), state=uiconst.UI_DISABLED, rotation=pi) self.rightArrowSprite = uicls.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): uicls.Window.ApplyAttributes(self, attributes) shipID = attributes.shipID self.SetMinSize([200, 200]) self.SetWndIcon('ui_3_64_10', mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.capacityText = uicls.EveHeaderSmall(text=' ', name='capacityText', parent=self.sr.topParent, left=8, top=4, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED) self.sr.gaugeParent = uicls.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) uicls.Frame(parent=self.sr.gaugeParent, color=(0.5, 0.5, 0.5, 0.3)) self.sr.gauge = uicls.Container(name='gauge', align=uiconst.TOLEFT, parent=self.sr.gaugeParent, state=uiconst.UI_PICKCHILDREN, width=0) uicls.Fill(parent=self.sr.gaugeParent, color=(0.0, 0.521, 0.67, 0.1), align=uiconst.TOALL) uicls.Fill(parent=self.sr.gauge, color=(0.0, 0.521, 0.67, 0.6)) self.sr.scroll = uicls.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicls.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 ShowTimer(self, timerID, startTime, duration, label): check = self.GetTimer(timerID) if check: if check.endTime <= startTime + duration: check.Close() else: return timer = uicls.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 = uicls.EveHeaderSmall(text=label, parent=timer, left=68, top=-1, state=uiconst.UI_DISABLED) uicls.Frame(parent=timer, padding=-1, color=(1.0, 1.0, 1.0, 0.5)) t = uicls.EveLabelSmall(text='', parent=timer, left=5, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL) p = uicls.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()
def ApplyAttributes(self, attributes): uicls.Window.ApplyAttributes(self, attributes) self.typeID = None self.scope = 'all' self.SetCaption(localization.GetByLabel('UI/Preview/PreviewCaption')) self.sr.main = uiutil.GetChild(self, 'main') self.SetWndIcon() self.SetTopparentHeight(0) self.SetMinSize([420, 320]) self.sr.rightSide = rightSide = uicls.Container(name='rightSide', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(6, 6, 6, 6), clipChildren=1) self.loadingWheel = uicls.LoadingWheel(parent=self.sr.rightSide, align=uiconst.CENTER, state=uiconst.UI_NORMAL) listbtn = uicls.MenuIcon(size=24, ignoreSize=True) listbtn.sr.owner = self listbtn.state = uiconst.UI_NORMAL listbtn.align = uiconst.NOALIGN listbtn.left = 2 listbtn.top = 10 listbtn.hint = localization.GetByLabel('UI/Neocom/ListItemsInSystem') listbtn.GetMenu = self.GetShipMenu self.listbtn = listbtn self.sr.title = uicls.EveCaptionMedium(text='', parent=rightSide, align=uiconst.TOTOP, padding=(17, 4, 17, 0), state=uiconst.UI_NORMAL) self.sr.title.GetMenu = self.GetShipMenu self.sr.title.expandOnLeft = 1 self.sr.subtitle = uicls.EveHeaderSmall(text='', parent=rightSide, align=uiconst.TOTOP, padding=(19, 0, 17, 0), state=uiconst.UI_DISABLED) self.textCont = uicls.Container(parent=self.sr.rightSide, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 150)) self.desc = uicls.EditPlainText(parent=self.textCont, readonly=1, padding=6, fontsize=12) self.desc.HideBackground() self.desc.RemoveActiveFrame() sc = form.SceneContainer(parent=self.sr.main, align=uiconst.TOALL, state=uiconst.UI_DISABLED, padding=6) sc.Startup() self.sr.sceneContainer = sc nav = form.SceneContainerBaseNavigation(parent=self.sr.main, state=uiconst.UI_NORMAL, padding=6) nav.Startup(sc) nav.OnClick = self.OnClickNav self.sr.navigation = nav self.mannequin = None self.loadingCharacterThread = None self.previewingWhat = '' self.previewType = attributes.previewType self.previewCharacterInfo = None if attributes.previewCharacter: dna = attributes.dna if dna: self.previewCharacterInfo = (attributes.previewCharacter, dna)
def ConstructWarzoneSignupPanel(self): textCont = uicls.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 = uicls.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') uicls.Container(name='push', parent=self.warzonePanel, align=uiconst.TOTOP, height=8) uicls.Container(name='push', parent=self.warzonePanel, align=uiconst.TOTOP, height=4) buttonCont = uicls.Container(name='signupBtns', parent=self.warzonePanel, align=uiconst.TORIGHT, width=98) buttonCont.state = uiconst.UI_HIDDEN if not buttons else uiconst.UI_NORMAL textCont = uicls.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 = uicls.Container(name='warntext', parent=textCont, align=uiconst.TOTOP, height=72) uicls.Container(name='push', parent=textCont, align=uiconst.TOTOP, height=4) uicls.Frame(parent=warnTextCont, color=(1.0, 1.0, 1.0, 0.125)) uicls.Fill(parent=warnTextCont, color=(32 / 256.0, 41 / 256.0, 46 / 256.0, 168 / 256.0)) infoicon = uicls.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 = uicls.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 = uicls.EveLabelMedium(text=infotxt, parent=textCont, align=uiconst.TOALL, state=uiconst.UI_NORMAL)
def LoadWindowOverlayPage(self, force = 0): mainpar = uiutil.FindChild(self, 'startpage_mainpar') if mainpar and not mainpar.destroyed: return if not self or self.destroyed: return kbContent, overlayPage, suppressed = self.CheckForContextHelp() if overlayPage is None or suppressed and not force: return if getattr(self, 'isToggling', 0): return if self.sr.stack: top = 0 else: headerHeight = self.GetCollapsedHeight() top = headerHeight if not force: tutorialWnd = form.TutorialWindow.GetIfOpen() if tutorialWnd: return m = 2 mainpar = uicls.Container(name='startpage', parent=self.sr.maincontainer, left=m, width=m, height=m, idx=0, top=top, clipChildren=True, state=uiconst.UI_NORMAL) par = uicls.Container(name='startpage_mainpar', parent=mainpar, state=uiconst.UI_HIDDEN) uicls.Line(parent=par, align=uiconst.TOLEFT) uicls.Line(parent=par, align=uiconst.TORIGHT) uicls.Line(parent=par, align=uiconst.TOBOTTOM) uicls.Fill(parent=par, color=(0.0, 0.0, 0.0, 0.8)) contentpar = uicls.Container(name='contentpar', parent=par, idx=0) topPar = uicls.Container(name='topPar', parent=contentpar, align=uiconst.TOTOP, height=64) icon = uicls.Icon(icon='ui_74_64_13', parent=contentpar) caption = uicls.CaptionLabel(text=overlayPage.title, parent=topPar, align=uiconst.CENTERLEFT, left=70) topPar.height = max(topPar.height, caption.textheight) bottomPar = uicls.Container(name='bottomPar', parent=contentpar, align=uiconst.TOBOTTOM) uicls.Line(parent=bottomPar, align=uiconst.TOTOP) btn = uicls.Button(parent=bottomPar, label=localization.GetByLabel('UI/Control/EveWindow/CloseWindowOverlay'), func=self.CloseWindowOverlay, idx=0, left=6, align=uiconst.CENTERRIGHT, alwaysLite=True) self.sr.wpCloseBtn = btn checkboxLabel = localization.GetByLabel('UI/Control/EveWindow/DisableThisWindowOverlay') self.sr.wpSuppress = uicls.Checkbox(text=checkboxLabel, parent=bottomPar, configName='suppress', retval=0, checked=suppressed, groupname=None, align=uiconst.TOPLEFT, pos=(6, 0, 200, 0), callback=self.DoSupress) allSuppressed = not settings.char.ui.Get('showWindowOverlays', 0) checkboxLabel = localization.GetByLabel('UI/Control/EveWindow/DisableAllWindowOverlays') self.sr.wpSuppressAll = uicls.Checkbox(text=checkboxLabel, parent=bottomPar, configName='suppressAll', retval=0, checked=allSuppressed, groupname=None, align=uiconst.TOPLEFT, pos=(6, 0, 200, 0), callback=self.DoSuppressAll) self.sr.wpSuppress.top = self.sr.wpSuppressAll.height bottomPar.height = max(self.sr.wpSuppress.height + 2 + self.sr.wpSuppressAll.height, btn.height + 6) if kbContent: uicls.Container(name='push', parent=contentpar, align=uiconst.TOBOTTOM, height=16) mainBottomPar = uicls.Container(name='mainBottomPar', parent=contentpar, align=uiconst.TOBOTTOM, height=32) kbPar = uicls.Container(name='kbPar', parent=mainBottomPar, align=uiconst.TOLEFT, width=128, left=16) uicls.Line(parent=kbPar, align=uiconst.TORIGHT) t = uicls.EveLabelMedium(text=localization.GetByLabel('UI/Control/EveWindow/KnowledgeBase'), parent=kbPar, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) maxWidth = t.textwidth for each in kbContent: if not each.url: continue entryPar = uicls.Container(name='entryPar', parent=kbPar, align=uiconst.TOTOP) l = uicls.EveHeaderSmall(text='<url=%s>%s</url>' % (each.url, each.description or each.url), parent=entryPar, top=1, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL) entryPar.height = max(14, l.textheight) maxWidth = max(maxWidth, l.textwidth + 18) icon = uicls.Icon(icon='ui_38_16_125', parent=entryPar, align=uiconst.CENTERRIGHT, idx=0, state=uiconst.UI_NORMAL) icon.OnClick = (self.ClickHelp, each.url) kbPar.width = maxWidth kbHeight = sum([ each.height for each in kbPar.children ]) tutorials = sm.GetService('tutorial').GetTutorials() validTutorials = sm.GetService('tutorial').GetValidTutorials() tutorialsPar = uicls.Container(name='tutorialsPar', parent=mainBottomPar, align=uiconst.TOLEFT, width=128, left=16) uicls.Line(parent=tutorialsPar, align=uiconst.TORIGHT) t = uicls.EveLabelMedium(text=localization.GetByLabel('UI/Control/EveWindow/Tutorials'), parent=tutorialsPar, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) maxWidth = t.textwidth for each in kbContent: if each.tutorialID is None: continue tutorialData = tutorials.get(each.tutorialID, None) if tutorialData and each.tutorialID in validTutorials: entryPar = uicls.Container(name='entryPar', parent=tutorialsPar, align=uiconst.TOTOP) tutorialName = localization.GetByMessageID(tutorialData.tutorialNameID) l = uicls.EveHeaderSmall(text='<url=localsvc:service=tutorial&method=OpenTutorialSequence_Check&tutorialID=%s&force=1&click=1>%s</url>' % (each.tutorialID, tutorialName), parent=entryPar, align=uiconst.CENTERLEFT, top=1, state=uiconst.UI_NORMAL) entryPar.height = max(14, l.textheight) maxWidth = max(maxWidth, l.textwidth + 18) icon = uicls.Icon(icon='ui_38_16_125', parent=entryPar, align=uiconst.CENTERRIGHT, idx=0, state=uiconst.UI_NORMAL) icon.OnClick = (self.ClickTutorial, each.tutorialID) if len(tutorialsPar.children) <= 2: tutorialsPar.Flush() tutorialsPar.width = maxWidth tutorialsHeight = sum([ each.height for each in tutorialsPar.children ]) mainBottomPar.height = max(64, kbHeight, tutorialsHeight) browser = uicls.EditPlainText(parent=contentpar, padLeft=const.defaultPadding, padRight=const.defaultPadding, readonly=1, setvalue=overlayPage.text) browser.HideBackground() browser.RemoveActiveFrame() uthread.new(self.ToggleWindowOverlay, 1)
def Startup(self, *args): sub = uicls.Container(name='sub', parent=self) self.sr.inTrainingHilite = uicls.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 = uicls.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 = uicls.Icon(name='haveIcon', parent=sub, size=16, left=20, align=uiconst.TOPRIGHT, state=uiconst.UI_HIDDEN) self.sr.levelParent = uicls.Container(name='levelParent', parent=sub, align=uiconst.TORIGHT, state=uiconst.UI_DISABLED, padRight=18) self.sr.levelHeaderParent = uicls.Container(name='levelHeaderParent', parent=sub, align=uiconst.TORIGHT, state=uiconst.UI_HIDDEN) self.sr.levels = uicls.Container(name='levels', parent=self.sr.levelParent, align=uiconst.TOPLEFT, left=0, top=5, width=48, height=10) uicls.Frame(parent=self.sr.levels, color=self.whiteColor) for i in xrange(5): f = uicls.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 = uicls.Container(name='progressbarparent', parent=self.sr.levelParent, align=uiconst.TOPLEFT, left=0, top=20, width=48, height=6) self.sr.progressBar = uicls.Fill(parent=self.sr.progressbarparent, name='progressbar', align=uiconst.RELATIVE, color=self.whiteColor, height=4, top=1, left=1, state=uiconst.UI_HIDDEN) uicls.Frame(parent=self.sr.progressbarparent) self.sr.levelHeader1 = uicls.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 = uicls.Container(name='textCont', parent=sub, align=uiconst.TOALL, padLeft=32, clipChildren=1) self.sr.nameLevelLabel = uicls.EveLabelMedium( text='', parent=textCont, left=0, top=0, state=uiconst.UI_DISABLED, maxLines=1) self.sr.nameLevelLabel.name = 'nameLevelLabel' self.sr.pointsLabel = uicls.EveLabelMedium(text='', parent=textCont, left=0, top=16, state=uiconst.UI_DISABLED, maxLines=1) self.sr.pointsLabel.name = 'pointsLabel' self.sr.selection = uicls.Fill(parent=self, padTop=1, padBottom=1, color=(1.0, 1.0, 1.0, 0.25)) self.sr.selection.name = 'selection' self.sr.selection.state = uiconst.UI_HIDDEN self.sr.timeLeftText = uicls.EveHeaderSmall( text='', parent=self.sr.levelHeaderParent, left=10, top=17, state=uiconst.UI_DISABLED, idx=0, align=uiconst.TOPRIGHT) self.sr.timeLeftText.name = 'timeLeftText' uicls.Line(parent=self, align=uiconst.TOBOTTOM) self.sr.hilite = uicls.Fill(parent=self, name='hilite', padTop=1, padBottom=1, color=(1.0, 1.0, 1.0, 0.25)) self.sr.infoicon = uicls.InfoIcon(size=16, left=2, top=2, parent=sub, idx=0, name='infoicon', align=uiconst.TOPRIGHT) self.sr.infoicon.OnClick = self.ShowInfo self.endOfTraining = None
def Setup(self, moduleinfo): targetContainer = uicls.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 = uicls.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 = uicls.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 = uicls.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 invType = cfg.invtypes.Get(moduleinfo.typeID) group = cfg.invtypes.Get(moduleinfo.typeID).Group() self.sr.moduleInfo = moduleinfo self.locationFlag = moduleinfo.flagID self.sr.sourceID = moduleinfo.itemID self.id = moduleinfo.itemID self.sr.glow.z = 0 self.sr.qtylabel = uicls.Label(text='', parent=self.sr.quantityParent, width=30, state=uiconst.UI_DISABLED, idx=0, fontsize=9) self.sr.distancelabel = uicls.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 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 = uicls.Container(parent=self.sr.targetContainer, width=52, height=13, left=6, top=62, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED) t = uicls.EveHeaderSmall(text='', parent=par, width=200, left=6, top=1, state=uiconst.UI_NORMAL) p = uicls.Fill(parent=par, align=uiconst.RELATIVE, width=48, height=11, left=1, top=1, color=(1.0, 1.0, 1.0, 0.25)) uicls.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 = localizationUtil.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 ApplyAttributes(self, attributes): self.openTime = blue.os.GetWallclockTime() uicls.Window.ApplyAttributes(self, attributes) self.storeSvc = sm.GetService('store') self.scope = 'station' self.SetMinSize([700, 360]) self.SetCaption( localization.GetByLabel('UI/VirtualGoodsStore/StoreNameCaption')) self.SetTopparentHeight(0) self.lastWidth = self.width self.stationID = session.stationid2 cornerSize = 7 imageHeight = 160 imageWidth = 215 color, bgColor, comp, compsub = sm.GetService( 'window').GetWindowColors() defaultTopButtonContWidth = 210 self.frames = [] self.unresizablePadding = 320 topCont = uicls.Container( parent=self.sr.main, name='topCont', align=uiconst.TOTOP, pos=(0, 0, 0, imageHeight + 2 * const.defaultPadding), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) topButtonCont = uicls.Container(parent=topCont, name='topButtonCont', align=uiconst.TORIGHT, pos=(0, 0, defaultTopButtonContWidth, 0)) bannerCont = uicls.Container(parent=topCont, name='bannerCont', align=uiconst.TOALL, clipChildren=1) fallbackImagePath = 'res:/UI/Texture/Store_MarketingBox_03.png' contWidth = imageWidth + 2 * cornerSize containerInfo = [['topLeftCont', 1], ['topMiddleCont', 2], ['topRightCont', 3]] for contName, adSlotID in containerInfo: cont = uicls.Container( parent=bannerCont, name=contName, align=uiconst.TOLEFT, pos=(0, 0, contWidth, 0), padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding), state=uiconst.UI_NORMAL) sprite = uicls.Sprite(parent=cont, pos=(cornerSize, cornerSize, imageWidth, imageHeight), align=uiconst.BOTTOMLEFT, idx=0) sprite.texturePath = sm.GetService('photo').GetStorebanner( adSlotID, prefs.languageID, sprite) if not sprite.texturePath: sprite.texturePath = sm.GetService('photo').GetStorebanner( adSlotID, 'EN', sprite) if not sprite.texturePath: sprite.texturePath = fallbackImagePath fPadding = 2 fHeight = imageHeight - cornerSize - fPadding frame = uicls.Frame(parent=cont, color=bgColor, align=uiconst.TOBOTTOM, pos=(0, 0, 0, fHeight - 1), spriteEffect=trinity.TR2_SFX_FILL, padding=(fPadding, fPadding, fPadding, fPadding)) self.frames.append(frame) setattr(self, contName, cont) btnPadding = 6 redeemPlexBtn = uicls.Button( parent=topButtonCont, name='redeemPlexBtn', label=localization.GetByLabel('UI/VirtualGoodsStore/RedeemPLEX'), func=self.RedeemPlex, pos=(0, const.defaultPadding + cornerSize, 0, 0), align=uiconst.BOTTOMRIGHT) top = redeemPlexBtn.top + redeemPlexBtn.height + btnPadding buyPlexOnlineBtn = uicls.Button( parent=topButtonCont, name='buyPlexOnline', label=localization.GetByLabel( 'UI/VirtualGoodsStore/BuyPlexOnline'), func=self.BuyPlexOnline, pos=(0, top, 0, 0), align=uiconst.BOTTOMRIGHT) top = buyPlexOnlineBtn.top + buyPlexOnlineBtn.height + btnPadding buyPlexMarketBtn = uicls.Button( parent=topButtonCont, name='buyPlexMarket', label=localization.GetByLabel( 'UI/VirtualGoodsStore/BuyPLEXOnMarket'), func=self.BuyPlexFromMarket, pos=(0, top, 0, 0), align=uiconst.BOTTOMRIGHT) top = buyPlexMarketBtn.top + buyPlexMarketBtn.height + btnPadding sellPlexBtn = uicls.Button( parent=topButtonCont, name='sellPlexBtn', label=localization.GetByLabel( 'UI/VirtualGoodsStore/Buttons/ExchangePLEXForAUR'), func=self.SellPlex, pos=(0, top, 0, 50), align=uiconst.BOTTOMRIGHT) top = sellPlexBtn.top + sellPlexBtn.height + btnPadding self.aurWealthLabel = uicls.EveLabelLarge(text='<right>%s' % util.FmtAUR(0), parent=topButtonCont, name='aurWealth', align=uiconst.BOTTOMRIGHT, state=uiconst.UI_DISABLED, left=16, top=top, width=300) self.aurWealthLabel.amount = 0 b = uicls.EveHeaderSmall( text=localization.GetByLabel('UI/VirtualGoodsStore/Balance'), parent=topButtonCont, align=uiconst.BOTTOMRIGHT, left=16, top=self.aurWealthLabel.top + self.aurWealthLabel.height, state=uiconst.UI_DISABLED) maxWidth = max(160, redeemPlexBtn.width, sellPlexBtn.width, buyPlexMarketBtn.width, buyPlexOnlineBtn.width) left = int((defaultTopButtonContWidth - maxWidth) / 2.0) redeemPlexBtn.width = sellPlexBtn.width = buyPlexMarketBtn.width = buyPlexOnlineBtn.width = maxWidth redeemPlexBtn.left = sellPlexBtn.left = buyPlexMarketBtn.left = left buyPlexOnlineBtn.left = b.left = self.aurWealthLabel.left = left scrollParent = uicls.Container(parent=self.sr.main, name='scrollParent', align=uiconst.TOALL) self.scroll = uicls.Scroll( parent=scrollParent, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding + 2)) uthread.new(self.DisplayAurWealth) self.scroll.sr.id = 'vsgScroll' self.scroll.sr.fixedColumns = { ' ': 72, localization.GetByLabel('UI/VirtualGoodsStore/Gender'): 100, localization.GetByLabel('UI/VirtualGoodsStore/Price'): 100 } self.scroll.sr.defaultColumnWidth = { localization.GetByLabel('UI/VirtualGoodsStore/ItemName'): 350 } self.scroll.sr.minColumnWidth = { localization.GetByLabel('UI/VirtualGoodsStore/ItemName'): 100 } self.scroll.sr.notSortableColumns = [' '] self.scroll.ScalingCol = self.StoreScalingCol self.scroll.showColumnLines = False self.PopulateOfferScroll()