def _BeginDrag(self, *args, **kwds): if not self.IsFloating(): initMouseX, initMouseY = self.dragMousePosition left, top, width, height = self.toolbarContainer.GetAbsolute() propLeft = (initMouseX - left) / float(width) self.UnDock(setPosition=False, registerSettings=False) self.left = uicore.uilib.x - int(self.width * propLeft) self.top = 0 self.snapPositions = self.GetSnapPositions() Window._BeginDrag(self, *args, **kwds) self.state = uiconst.UI_PICKCHILDREN
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetWndIcon(None) self.SetCaption('Window manager') self.SetTopparentHeight(10) self.SetMinSize([360, 220]) options = [] for wndCls in Window.__subclasses__(): options.append((wndCls.__name__, wndCls)) options.sort() topCont = Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pad=(5, 5, 5, 5), pos=(0, 10, 0, 30)) self.mainCont = Container(name='params', parent=self.sr.main, align=uiconst.TOTOP, pos=(0, 0, 0, 50), padding=(5, 15, 5, 5)) self.extrasCont = Container(name='params', parent=self.sr.main, align=uiconst.TOALL, padding=(5, 15, 5, 5)) self.combo = Combo(parent=topCont, label='Select window', options=options, name='', select=settings.user.ui.Get('windowManagerOpenWindow'), callback=self.OnComboChanged, pos=(5, 0, 0, 0), width=150, align=uiconst.TOPLEFT) self.startupArgs = SinglelineEdit(name='', label='attributes', parent=topCont, setvalue='', align=uiconst.TOPLEFT, left=165, width=100) Button(parent=topCont, label='Load', align=uiconst.RELATIVE, func=self.OpenWindow, pos=(300, 0, 0, 0)) self.filenameEdit = SinglelineEdit(name='', label='Location', parent=self.mainCont, setvalue='', align=uiconst.TOTOP, top=15, readonly=True) Label(text='RELOAD', parent=self.extrasCont, top=10, state=uiconst.UI_NORMAL) Line(parent=self.extrasCont, align=uiconst.TOTOP) buttonCont = Container(name='buttonCont', parent=self.extrasCont, align=uiconst.TOTOP, pos=(0, 30, 0, 30)) Button(parent=buttonCont, label='ShipUI', align=uiconst.TOLEFT, func=self.ReloadShipUI) Button(parent=buttonCont, label='NEOCOM', align=uiconst.TOLEFT, func=self.ReloadNeocom, padLeft=1) Button(parent=buttonCont, label='Info Panels', align=uiconst.TOLEFT, func=self.ReloadInfoPanels, padLeft=1) Button(parent=buttonCont, label='Lobby', align=uiconst.TOLEFT, func=self.ReloadLobby, padLeft=1) Button(parent=buttonCont, label='Overview', align=uiconst.TOLEFT, func=self.ReloadOverview, padLeft=1) Button(parent=buttonCont, label='Mapbrowser', align=uiconst.TOLEFT, func=self.ReloadMapBrowser, padLeft=1) self.UpdateInfo(self.combo.GetKey(), self.combo.GetValue())
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetWndIcon('res:/ui/Texture/WindowIcons/Settings.png', mainTop=-6) self.SetMainIconSize(64) self.width = 350 self.height = 400 self.MakeUnResizeable() self.currentComboValue = localization.settings.bilingualSettings.GetValue( 'localizationImportantNames') WndCaptionLabel( text=GetByLabel('UI/LanguageWindow/BilingualFunctionalityHeader'), parent=self.sr.topParent, align=uiconst.RELATIVE) self.autoSizeMain = ContainerAutoSize( parent=self.sr.main, name='autoSizeMain', align=uiconst.TOTOP, callback=self.OnAutoSizeMainResize, padLeft=2, padRight=2) text = GetByLabel('UI/LanguageWindow/BodyText') EveLabelMedium(text=text, parent=self.autoSizeMain, align=uiconst.TOTOP, padding=(10, 4, 10, 0)) self.btnGroup = ButtonGroup(parent=self.sr.main, idx=0) self.btnGroup.AddButton(GetByLabel('UI/Commands/Apply'), self.Save) self.btnGroup.AddButton(GetByLabel('UI/Common/Close'), self.Cancel) grid = LayoutGrid(parent=self.autoSizeMain, align=uiconst.TOTOP, columns=2, name='grid', padTop=10, padLeft=20, cellSpacing=4) languageID = ConvertLanguageIDToMLS(session.languageID) self.currentLanguageString = GetByLabel( mlsToDisplayNamePaths[languageID]) text = GetByLabel('UI/SystemMenu/Language/Display') comboLabel = EveLabelMedium(text=text, parent=grid, align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) comboLabel.hint = GetByLabel( 'UI/SystemMenu/Language/ImportantNamesExplanation') options = [(self.currentLanguageString, 0), (GetByLabel('UI/SystemMenu/Language/EnglishReplacement'), IMPORTANT_EN_OVERRIDE)] self.displayCombo = Combo( label='', parent=grid, options=options, name='displayCombo', select=self.currentComboValue, width=115, pos=(10, 0, 0, 0), align=uiconst.TOPLEFT, callback=self.OnComboChanged, hint=GetByLabel( 'UI/SystemMenu/Language/ImportantNamesExplanation')) tooltipText = self.GetTooltipCheckboxText() checked = localization.settings.bilingualSettings.GetValue( 'languageTooltip') self.tooltipCB = Checkbox(text=tooltipText, parent=None, configName='tooltipsCB', checked=checked, align=uiconst.TOPLEFT, width=300) grid.AddCell(cellObject=self.tooltipCB, colSpan=grid.columns) hiliteImportantText = GetByLabel( 'UI/SystemMenu/Language/HighlightImportantNames') checked = localization.settings.bilingualSettings.GetValue( 'localizationHighlightImportant') self.importantCB = Checkbox(text=hiliteImportantText, parent=None, configName='importantNamesCB', checked=checked, align=uiconst.TOPLEFT, width=300) grid.AddCell(cellObject=self.importantCB, colSpan=grid.columns) text = localization.GetByLabel('UI/LanguageWindow/ChangeSettingsInEsc') EveLabelMedium(text=text, parent=self.autoSizeMain, align=uiconst.TOTOP, padding=(10, 10, 10, 0)) Line(parent=self.autoSizeMain, align=uiconst.TOTOP, color=(1, 1, 1, 0.1), padTop=4, padBottom=2) text = GetByLabel('UI/Messages/TxtSuppress2Body') self.suppressCb = Checkbox(text=text, parent=self.autoSizeMain, configName='importantNamesCB', retval=0, checked=0, align=uiconst.TOTOP, padLeft=6)
def Close(self, *args): Window.Close(self, *args) if self.toolbarContainer and not self.toolbarContainer.destroyed: self.toolbarContainer.Close() self.monitorMouseOver = None uicore.dockablePanelManager.UnregisterPanel(self)
def Close(self, *args, **kwargs): try: self.ChangeSignalConnection(connect=False) finally: Window.Close(self, *args, **kwargs)
def Close(self, *args, **kwargs): blue.pyos.SetLogEchoFunction(0, None) self.logSaveHandle = None Window.Close(self, *args, **kwargs)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.homeStationID = GetHomeStation() self.jumpCloneID = GetJumpClone() self.Layout() uthread.new(self.Reload)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetCaption(GetByLabel('UI/Inventory/ItemActions/MultiSell')) self.scope = 'station_inflight' self.SetTopparentHeight(0) mainCont = Container(parent=self.sr.main, name='mainCont', padding=4) infoCont = Container(parent=mainCont, name='bottomCont', align=uiconst.TOBOTTOM, height=88, padTop=4) Line(parent=infoCont, align=uiconst.TOTOP) self.bottomLeft = Container(parent=infoCont, name='bottomLeft', padLeft=6, padTop=6) self.bottomRight = Container(parent=infoCont, name='bottomRight', align=uiconst.TORIGHT, width=250, padRight=6, padTop=6) dropCont = Container(parent=mainCont, name='dropCont', align=uiconst.TOTOP, height=28, state=uiconst.UI_NORMAL, padBottom=4) dropCont.OnDropData = self.DropItems self.dropLabel = EveCaptionSmall( text=GetByLabel('UI/Market/Marketbase/DropItemsToAdd'), parent=dropCont, align=uiconst.CENTER) self.dropLabel.opacity = 0.6 self.fakeItemsCont = Container(parent=dropCont, align=uiconst.TOALL, clipChildren=True) self.itemList = [] self.preItems = attributes.preItems self.itemDict = {} self.sellItemList = [] self.cannotSellItemList = [] self.itemsNeedRepackaging = [] self.itemAlreadyInList = [] self.hasDrawn = False self.baseStationID = None self.useCorp = None self.addItemsThread = None scrollCont = Container(parent=mainCont, name='scrollCont') self.itemsScroll = ScrollContainer(parent=scrollCont, id='MultiSellScroll') self.DefineButtons( uiconst.OKCANCEL, okLabel=GetByLabel('UI/Market/MarketQuote/CommandSell'), okFunc=self.SellItems, cancelFunc=self.Cancel) self.DrawNumbers() self.DrawCombos() durationValue = settings.user.ui.Get('multiSellDuration', 0) self.durationCombo.SetValue(durationValue) top = 30 corpAcctName = self._CanSellForCorp() if corpAcctName is not None: self.DrawCheckBox(corpAcctName) top += 18 self.orderCountLabel = EveLabelSmall(parent=self.bottomLeft, top=top, left=2) self.maxCount, self.myOrderCount = self.GetOrderCount() if len(self.preItems): self.addItemsThread = uthread.new(self.AddPreItems, self.preItems) self.UpdateOrderCount() self.globalDragHover = uicore.event.RegisterForTriuiEvents( uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetTopparentHeight(0) uthread.new(self.LoadOptions)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) blueprintID = attributes.Get('blueprintID', None) blueprintTypeID = attributes.Get('blueprintTypeID', None) bpData = attributes.Get('bpData', None) self.history = HistoryBuffer() self.jobData = None self.pendingBlueprint = None self.loadBlueprintThread = None self.topCont = Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, height=TOP_HEIGHT, clipChildren=True) self.currView = BaseView(parent=self.topCont, align=uiconst.TOTOP, height=VIEW_HEIGHT) self.jobsStrip = JobsStrip(parent=self.topCont, align=uiconst.TOTOP, padding=(5, -1, 7, 2), callback=self.OnBlueprintsSelected) self.bottomCont = Container(name='bottomCont', parent=self.sr.main, controller=self, height=0.4, padding=(4, 0, 4, 0), callback=self.OnBlueprintsSelected) cont = ContainerAutoSize(name='historyArrowCont', parent=self.sr.main, align=uiconst.TOPRIGHT, height=16, left=3, top=1) self.expandViewBtn = ButtonIcon( name='expandViewBtn', parent=cont, align=uiconst.TORIGHT, width=16, iconSize=7, texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png', func=self.OnExpandViewBtn) self.goForwardBtn = ButtonIcon( name='goForwardBtn', parent=cont, align=uiconst.TORIGHT, width=16, iconSize=16, padRight=5, texturePath='res:/UI/Texture/icons/38_16_224.png', func=self.OnForward, hint=localization.GetByLabel('UI/Control/EveWindow/Next')) self.goBackBtn = ButtonIcon( name='goBackBtn', parent=cont, align=uiconst.TORIGHT, width=16, iconSize=16, texturePath='res:/UI/Texture/icons/38_16_223.png', func=self.OnBack, hint=localization.GetByLabel('UI/Control/EveWindow/Previous')) self.browserCont = Container(name='browserCont', parent=self.bottomCont, padding=(0, 2, 0, 2)) self.browserBlueprints = BrowserBlueprints( parent=self.browserCont, callback=self.OnBlueprintsSelected) self.browserFacilities = BrowserFacilities( parent=self.browserCont, callback=self.OnFacilitySelected) self.browserJobs = BrowserJobs(parent=self.browserCont, callback=self.OnJobSelected) tabs = ((localization.GetByLabel('UI/Industry/Blueprints'), self.browserBlueprints, None, 'blueprints', None, GetByLabel('UI/Industry/TabBlueprints')), (localization.GetByLabel('UI/Industry/Facilities'), self.browserFacilities, None, 'facilities', None, GetByLabel('UI/Industry/TabFacilities')), (localization.GetByLabel('UI/Industry/Jobs'), self.browserJobs, None, 'jobs', None, GetByLabel('UI/Industry/TabJobs'))) self.tabs = TabGroup(parent=self.browserCont, tabs=tabs, height=26, labelPadding=12, idx=0, padLeft=0, groupID='IndustryWindowBrowsers', autoselecttab=not self.IsBrowserCollapsed()) self.expandBottomBtn = ButtonIcon( name='expandBottomBtn', parent=self.bottomCont, align=uiconst.TOPRIGHT, pos=(2, -3, 16, 16), iconSize=7, texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png', func=self.OnExpandBottomBtn) if blueprintID or blueprintTypeID: self.ShowBlueprint(blueprintID, blueprintTypeID, bpData=bpData) if self.IsViewCollapsed(): self.CollapseView(animate=False) else: self.expandViewBtn.SetRotation(-pi) if self.IsBrowserCollapsed(): self.CollapseBrowser(animate=False) else: self.expandBottomBtn.SetRotation(-pi) sm.GetService('audio').SendUIEvent('ind_windowOpened')
def CloseByUser(self, *args): sm.GetService('audio').SendUIEvent('ind_windowClosed') Window.CloseByUser(self, *args)
def Close(self, *args, **kwargs): Window.Close(self, *args, **kwargs) if self.jobData: sm.GetService('industrySvc').DisconnectJob(self.jobData)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) developerMode = sm.GetService('notificationUIService').IsDeveloperMode() self.mainContainer = NotificationSettingsMainContainer(name='mainContainer', align=uiconst.TOALL, parent=self.GetMainArea(), parentwidth=self.default_width, developerMode=developerMode)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.SetTopparentHeight(0) self.bountyEscrow = attributes.bountyEscrow self.bountyAmount = attributes.bountyAmount self.component = attributes.component factionResPath = FACTIONPATHBYESSTYPEID[attributes.ESSTypeID] navyID = CORPIDBYFACTIONID[attributes.ESSTypeID] self.SetCaption(GetByLabel(CAPTIONBYESSTYPEID[attributes.ESSTypeID])) self.myContribution = 0 self.amountInTags = 0 mainCont = Container(name='mainCont', parent=self.sr.main, padding=const.defaultPadding) iconCont = Container(name='iconCont', parent=mainCont, align=uiconst.TOTOP, height=64) headerCont = Container(name='headerCont', parent=mainCont, align=uiconst.TOTOP, height=54, padBottom=6) buttonsCont = Container(name='buttonsCont', parent=mainCont, align=uiconst.TOBOTTOM, height=80, padTop=4, padBottom=4) listCont = Container(name='listCont', parent=mainCont, align=uiconst.TOALL, padBottom=14) factionLogo = Sprite(parent=iconCont, align=uiconst.CENTERTOP, width=64, height=64, texturePath=factionResPath) factionLogo.hint = cfg.eveowners.Get(navyID).name factionLogo.OnClick = (self.OpenNavyInfo, navyID) EveLabelLarge(text=GetByLabel('UI/Inflight/Brackets/TotalBounty'), parent=headerCont, maxLines=1, align=uiconst.CENTERTOP) EveCaptionMedium(text=FmtISK(self.bountyAmount, 0), parent=headerCont, maxLines=1, align=uiconst.CENTERTOP, state=uiconst.UI_NORMAL, top=16) contributorsCont = Container(name='contributorsCont', parent=listCont, align=uiconst.TOLEFT_PROP, width=0.45) self.tagsCont = Container(name='tagsCont', parent=listCont, align=uiconst.TORIGHT_PROP, width=0.45) topSpaceCont = Container(name='topSpaceCont', parent=listCont, align=uiconst.TOALL) self.contributersList = ScrollContainer(name='contributersList', parent=contributorsCont, align=uiconst.TOALL) shareCont = Container(name='shareCont', parent=buttonsCont, align=uiconst.TOLEFT_PROP, width=0.45) takeCont = Container(name='takeCont', parent=buttonsCont, align=uiconst.TORIGHT_PROP, width=0.45) spaceCont = Container(name='spaceCont', parent=buttonsCont, align=uiconst.TOALL) youGetLabel = EveLabelMedium( text=GetByLabel('UI/Inflight/Brackets/YouGet'), parent=shareCont, align=uiconst.CENTERTOP, top=1) myContribLabel = EveLabelLargeBold(text='', parent=shareCont, align=uiconst.CENTERTOP, top=16) shareLabel = EveLabelSmall( text=GetByLabel('UI/Inflight/Brackets/EveryoneGetsTheirShare'), parent=shareCont, align=uiconst.CENTERBOTTOM) shareBtn = Button(parent=shareCont, label=GetByLabel('UI/Inflight/Brackets/Share'), align=uiconst.TOBOTTOM, top=20, func=self.ShareContribution) orLabel = EveLabelLargeBold(text=GetByLabel('UI/Inflight/Brackets/Or'), parent=spaceCont, align=uiconst.CENTER, top=10) amountInTagsLabel = EveLabelLarge(text=GetByLabel( 'UI/Inflight/Brackets/AmountInTags', amount=FmtISK(0, 0)), parent=takeCont, align=uiconst.CENTERTOP, top=16) takeLabel = EveLabelSmall( text=GetByLabel('UI/Inflight/Brackets/OthersGetNothing'), parent=takeCont, align=uiconst.CENTERBOTTOM) takeAllBtn = Button(parent=takeCont, label=GetByLabel('UI/Inflight/Brackets/TakeAll'), align=uiconst.TOBOTTOM, top=20, func=self.TakeAll) self.LoadContributions(attributes.contributions) myContribLabel.SetText(FmtISK(self.myContribution, 0)) self.LoadTags() amountInTagsLabel.SetText( GetByLabel('UI/Inflight/Brackets/AmountInTags', amount=FmtISK(self.amountInTags, 0)))
def _OnSizeChange_NoBlock(self, *args, **kwds): Window._OnSizeChange_NoBlock(self, *args, **kwds) self.attributeScroll.height = min(self.height / 2, max(72, settings.user.ui.Get('uitree_attributeScroll_height', 200))) settings.user.ui.Set('uitree_attributeScroll_height', self.attributeScroll.height)
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) self.bottomContainer = 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, state=uiconst.UI_DISABLED) 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)) GradientThemeColored(bgParent=btnCont) self.reprocessButton = Button( parent=btnCont, label=GetByLabel( 'UI/Reprocessing/ReprocessingWindow/ReprocessButton'), func=self.ReprocessItems, align=uiconst.CENTERRIGHT, fixedheight=28, left=8) left = self.reprocessButton.left + self.reprocessButton.width self.totalIskCostLabel = EveLabelMedium(parent=btnCont, text='', align=uiconst.CENTERRIGHT, left=left + 8, color=COL_RED) self.cancelButton = Button( parent=btnCont, label=GetByLabel('UI/Common/Buttons/Cancel'), func=self.Cancel, align=uiconst.CENTERLEFT, fixedheight=28, left=8) self.DisableReprocessButton(disable=True) if self.preSelectedItems: start_tasklet(self.AddPreselectedItems, self.preSelectedItems)
def Close(self, setClosed=False, *args, **kwds): Window.Close(self, *args, **kwds) if self.addItemsThread: self.addItemsThread.kill() uicore.event.UnregisterForTriuiEvents(self.globalDragHover)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.MakeUnstackable() self._ConstructUI() sm.RegisterNotify(self)
def ApplyAttributes(self, attributes): self._ready = False Window.ApplyAttributes(self, attributes) self.SetTopparentHeight(4) self.scroll = Scroll(parent=self.sr.main, id='outstandingscroll', align=uiconst.TOALL) uthread2.StartTasklet(self.Refresh)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.taskMap = {} self.nodeCount = 0 self.controller = None self.mainScroll = ScrollContainer(name='myScrollCont', parent=self.sr.main, align=uiconst.TOALL, padding=(4, 4, 4, 4))
def Close(self, setClosed=False, *args, **kwds): Window.Close(self, setClosed, *args, **kwds) if self.controller: self.controller.Close()
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.updateChatFiltersFunc = attributes.get('updateChatFiltersFunc') bannedWordsList = attributes.get('bannedWords', []) highlightWordsList = attributes.get('highlightWords', []) blinkOnHighlightWords = attributes.get('blinkOnHighlightWords', False) self.SetTopparentHeight(0) self.SetCaption( localization.GetByLabel('UI/Chat/ChannelWindow/ChatWordFilters')) self.SetMinSize([self.default_width, self.default_height]) btnGroup = ButtonGroup(btns=[], parent=self.sr.main, idx=0, line=True) btnGroup.AddButton( label=localization.GetByLabel('UI/Common/Buttons/Save'), func=self.Save, args=(), isDefault=True) btnGroup.AddButton( label=localization.GetByLabel('UI/Common/Buttons/Cancel'), func=self.Cancel, isDefault=False) padding = 4 bannedWordsCont = DragResizeCont(name='bannedWordsCont', parent=self.sr.main, align=uiconst.TOTOP_PROP, minSize=0.3, maxSize=0.7, defaultSize=0.45, padding=padding) Line(parent=bannedWordsCont.dragArea, align=uiconst.TOTOP, padLeft=-3, padRight=-3, color=(1, 1, 1, 0.15)) Line(parent=bannedWordsCont.dragArea, align=uiconst.TOBOTTOM, padLeft=-3, padRight=-3, color=(1, 1, 1, 0.15)) self.bannedWordsLabel = EveLabelMedium( parent=bannedWordsCont, name='bannedWordsLabel', align=uiconst.TOTOP, state=uiconst.UI_DISABLED, text=localization.GetByLabel( 'UI/Chat/ChannelWindow/BannedWordText'), padTop=2, padLeft=2) bannedWords = SPLITTER.join(bannedWordsList) self.bannedWordsField = EditPlainText( name='bannedWordsField', parent=bannedWordsCont, align=uiconst.TOALL, ignoreTags=True, setvalue=bannedWords, padBottom=8, hintText=localization.GetByLabel( 'UI/Chat/ChannelWindow/WordSeparatorText')) lowerCont = Container(parent=self.sr.main, name='lowerCont', align=uiconst.TOALL, padLeft=padding, padRight=padding, padTop=8, padBottom=6) self.highlightWordsLabel = EveLabelMedium( parent=lowerCont, name='highlightWordsLabel', align=uiconst.TOTOP, state=uiconst.UI_DISABLED, text=localization.GetByLabel( 'UI/Chat/ChannelWindow/HighlightWordText'), padLeft=2) self.blinkOnHighlightWordsCb = Checkbox( parent=lowerCont, name='blinkCb', checked=blinkOnHighlightWords, align=uiconst.TOBOTTOM, text=localization.GetByLabel('UI/Chat/ChannelWindow/AlwaysBlink')) highlightWords = SPLITTER.join(highlightWordsList) self.highlightWordsField = EditPlainText( name='highlightWordsField', parent=lowerCont, align=uiconst.TOALL, ignoreTags=True, setvalue=highlightWords, hintText=localization.GetByLabel( 'UI/Chat/ChannelWindow/WordSeparatorText'))
def SetOrder(self, idx): if not self.IsFloating(): return return Window.SetOrder(self, idx)
def Close(self, setClosed=False, *args, **kwds): self.scroll = None self.classDetailsContainer = None gc.collect() Window.Close(self, setClosed, *args, **kwds)
def Close(self, *args): Window.Close(self, *args) if self.snapIndicator and not self.snapIndicator.destroyed: self.snapIndicator.Close() self.snapIndicator = None uicore.dockablePanelManager.UnregisterPanel(self)
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) LineUnderlay(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 ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.yaw = 0.0 self.pitch = 0.0 def GetModel(): selectedID = sm.GetService('state').GetExclState(state.selected) ball = sm.GetService('michelle').GetBall(selectedID) return getattr(ball, 'model', None) def Start(): self.scene = sm.GetService('space').GetScene() self.sunBallCache = self.scene.sunBall self.scene.sunBall = None self.scene.sunDirection = (0.0, 0.0, -1.0) model = GetModel() GoToX(model, 10000000000.0) Label(name='goLabel', parent=self.sr.main, align=uiconst.TOTOP, text='Fly') def GoToX(model, offset): print 'GoToX', offset model.translationCurve.gotoX = model.translationCurve.x + offset model.translationCurve.gotoY = model.translationCurve.y model.translationCurve.gotoZ = model.translationCurve.z print model.translationCurve.gotoX def FlyLeft(_): model = GetModel() GoToX(model, -10000000000.0) def FlyRight(_): model = GetModel() GoToX(model, +10000000000.0) buttonGroup = ButtonGroup(name='flyButtons', parent=self.sr.main, align=uiconst.TOTOP) buttonGroup.AddButton('Left', FlyLeft) buttonGroup.AddButton('Right', FlyRight) def Orbit(): camera = sm.GetService('camera').spaceCamera camera.SetOrbit(self.yaw, self.pitch) Label(name='cameraLabel', parent=self.sr.main, align=uiconst.TOTOP, text='Camera Yaw') def Yaw(button): yawDeg = float(button.name.split('_')[0]) self.yaw = DegToRad(yawDeg) Orbit() buttonGroup = ButtonGroup(name='yawButtons', parent=self.sr.main, align=uiconst.TOTOP) buttonGroup.AddButton('-135', Yaw) buttonGroup.AddButton('-90', Yaw) buttonGroup.AddButton('-45', Yaw) buttonGroup.AddButton('0', Yaw) buttonGroup.AddButton('45', Yaw) buttonGroup.AddButton('90', Yaw) buttonGroup.AddButton('135', Yaw) buttonGroup.AddButton('180', Yaw) Label(name='cameraLabel', parent=self.sr.main, align=uiconst.TOTOP, text='Camera Pitch') def Pitch(button): yawDeg = float(button.name.split('_')[0]) self.pitch = -DegToRad(yawDeg) Orbit() buttonGroup = ButtonGroup(name='pitchButtons', parent=self.sr.main, align=uiconst.TOTOP) buttonGroup.AddButton('-89', Pitch) buttonGroup.AddButton('-45', Pitch) buttonGroup.AddButton('0', Pitch) buttonGroup.AddButton('45', Pitch) buttonGroup.AddButton('89', Pitch) Label(name='controlLabel', parent=self.sr.main, align=uiconst.TOTOP, text='Sunlight') def SunDirection(button): angle = float(button.name.split('_')[0]) angleRad = DegToRad(-angle) - math.pi / 2.0 self.scene.sunDirection = (math.cos(angleRad), 0.0, math.sin(angleRad)) buttonGroup = ButtonGroup(name='sunlightButtons', parent=self.sr.main, align=uiconst.TOTOP) buttonGroup.AddButton('-135', SunDirection) buttonGroup.AddButton('-90', SunDirection) buttonGroup.AddButton('-45', SunDirection) buttonGroup.AddButton('0', SunDirection) buttonGroup.AddButton('45', SunDirection) buttonGroup.AddButton('90', SunDirection) buttonGroup.AddButton('135', SunDirection) buttonGroup.AddButton('180', SunDirection) Start()
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes)
def CloseByUser(self, *args): browserController = sm.GetService('structureControllers').GetStructureBrowserController() if not browserController.PlayerWantsToLeaveProfile(): return browserController.SetProfileChangedValue(False) Window.CloseByUser(self, *args)
def Prepare_HeaderButtons_(self, *args, **kwds): Window.Prepare_HeaderButtons_(self, *args, **kwds)
def ApplyAttributes(self, attributes): Window.ApplyAttributes(self, attributes) self.isTesting = False self.startBtn = Button(name='self.startBtn', parent=self.sr.main, align=uiconst.CENTER, label='Start Test', func=self.OnStartBtn)