def ApplyAttributes(self, attributes): self.uiEffects = uicls.UIEffects() uiprimitives.Container.ApplyAttributes(self, attributes) self.value = attributes.Get('value', 0.0) self.left = attributes.Get('left', 0) self.top = attributes.Get('top', 0) self.typeID = iconTypeID = attributes.Get('iconTypeID', 6) color = planetCommon.PLANET_COLOR_USED_PROCESSOR bgColor = (255 / 255.0, 128 / 255.0, 0 / 255.0, 0.15) self.icon = uicontrols.Icon(parent=self, pos=(2, 2, 16, 16), state=uiconst.UI_DISABLED, typeID=iconTypeID, size=16, ignoreSize=True) gaugeCont = uiprimitives.Container(parent=self, pos=(0, 0, self.width, self.width), align=uiconst.TOPLEFT) self.gauge = uiprimitives.Fill(parent=gaugeCont, align=uiconst.TOLEFT, width=0, color=color, state=uiconst.UI_DISABLED) uiprimitives.Fill(parent=gaugeCont, color=bgColor, state=uiconst.UI_DISABLED) self.subText = uicontrols.Label(text='', parent=self, top=22, state=uiconst.UI_DISABLED, fontsize=10) self.busy = False self.SetValue(self.value)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) l, t, w, h = self.GetAbsolute() self.influence = attributes.get('influence', 0.0) self.targetInfluence = self.influence self.blueBar = uiprimitives.Container(parent=self, name='blueBar', align=uiconst.TOLEFT_PROP, width=0, clipChildren=True) uiprimitives.Fill(name='blueBase', parent=self.blueBar, color=(0, 0, 1, 0.25)) self.blueArrows = uicls.BarFill(name='blueFill', pos=(0, 0, w, h), parent=self.blueBar, color=(0, 0, 1, 0.75)) self.knob = uiprimitives.Line(parent=self, name='sliderKnob', color=self.FRAME_COLOR, align=uiconst.TOLEFT) self.redBar = uiprimitives.Container(parent=self, name='redBar', align=uiconst.TOALL, clipChildren=True) uiprimitives.Fill(name='redBase', parent=self.redBar, color=(1, 0, 0, 0.25)) self.redArrows = uicls.BarFill(pos=(0, 0, w, h), name='redFill', parent=self.redBar, color=(1, 0, 0, 0.75))
def InitGauges(self, loc): if getattr(self, '%sGaugesInited' % loc, None): gaugeParent = self.sr.Get('%sGaugeParent' % loc) gaugeParent.state = uiconst.UI_NORMAL return container = self.sr.Get('%sContainer' % loc) par = uiprimitives.Container(name='gauges', parent=container, align=uiconst.TOPLEFT, width=52, height=32, top=59, left=6) for each in ('SHIELD', 'ARMOR', 'STRUCTURE'): g = uiprimitives.Container(name=each, align=uiconst.TOTOP, width=52, height=8, left=-2) uiprimitives.Container(name='push', parent=g, align=uiconst.TOBOTTOM, height=1) g.name = '%sGauge_%s' % (loc, each.lower()) g.height = 9 uiprimitives.Line(parent=g, align=uiconst.TOTOP, color=(1.0, 1.0, 1.0, 0.5)) uiprimitives.Line(parent=g, align=uiconst.TOBOTTOM, color=(1.0, 1.0, 1.0, 0.5)) uiprimitives.Line(parent=g, align=uiconst.TOLEFT, color=(1.0, 1.0, 1.0, 0.5)) uiprimitives.Line(parent=g, align=uiconst.TORIGHT, color=(1.0, 1.0, 1.0, 0.5)) g.sr.bar = uiprimitives.Fill(parent=g, align=uiconst.TOLEFT) uiprimitives.Fill(parent=g, color=(158 / 256.0, 11 / 256.0, 14 / 256.0, 1.0)) par.children.append(g) setattr(self.sr, '%sGauge_%s' % (loc, each.lower()), g) uiprimitives.Container(name='push', parent=par, align=uiconst.TOTOP, height=2) self.sr.gaugeParent = par setattr(self.sr, '%sGaugeParent' % loc, par) setattr(self, '%sGaugesInited' % loc, 1)
def InitGauges(self): if getattr(self, 'gaugesInited', False): self.sr.gaugeParent.state = uiconst.UI_DISABLED return parent = self.sr.gaugesContainer uiprimitives.Line(parent=parent, align=uiconst.TOLEFT) barw, barh = (24, 6) borderw = 2 barsw = (barw + borderw) * 3 + borderw par = uiprimitives.Container(name='gauges', parent=parent, align=uiconst.TORIGHT, width=barsw + 2, height=0, left=0, top=0, idx=10) self.sr.gauges = [] l = 2 for each in ('SHIELD', 'ARMOR', 'STRUCT'): g = uiprimitives.Container(parent=par, name='gauge_%s' % each.lower(), align=uiconst.CENTERLEFT, width=barw, height=barh, left=l) uicontrols.Frame(parent=g) g.sr.bar = uiprimitives.Fill(parent=g, name='droneGaugeBar', align=uiconst.TOLEFT) uiprimitives.Fill(parent=g, name='droneGaugeBarDmg', color=(158 / 256.0, 11 / 256.0, 14 / 256.0, 1.0)) self.sr.gauges.append(g) setattr(self.sr, 'gauge_%s' % each.lower(), g) l += barw + borderw self.sr.gaugeParent = par self.gaugesInited = True
def CheckIfSlotLoaded(self, slotParent): if getattr(slotParent, '_loaded', False): return slotParent._loaded = True slot = slotParent.children[0] resPath, data, hiliteResPath = slot.imageData if not resPath or not blue.paths.exists(resPath): resPath = 'res:/UI/Asset/missingThumbnail.dds' slot.sr.thumbnail.LoadTexture(resPath) if len(data) > 2 and data[ 2] is not None and session.role & service.ROLE_CONTENT: flag = uiprimitives.Container(parent=slot, align=uiconst.TOPLEFT, padding=(2, 2, 2, 2), pos=(0, 0, 20, 20), state=uiconst.UI_DISABLED, idx=0) fill = uiprimitives.Fill(parent=flag, color=(0, 1.0, 0, 0.5)) if data[2] not in self._availableTypeIDs: fill.SetRGB(1.0, 0, 0) slot.GetMenu = (self.GetRightClickMenu, data[2]) if getattr(uicore.layer.charactercreation, 'mode', -1) == ccConst.MODE_FULLINITIAL_CUSTOMIZATION: uiprimitives.Fill(parent=flag, color=(0, 0.0, 0, 1.0), padding=5, idx=0) if self._activeData == slot.imageData: slot.sr.hilite.state = uiconst.UI_DISABLED slot.sr.hilite.SetAlpha(1.0) elif slot.sr.hilite: slot.sr.hilite.state = uiconst.UI_HIDDEN slot.sr.mouseOverTimer = base.AutoTimer(33, self.CheckMouseOver, slot)
def Startup(self, *args): node = self.sr.node self.corpSvc = sm.GetService('corp') self.lscSvc = sm.GetService('LSC') self.viewButton = None self.removeButton = None self.rejectButton = None self.acceptButton = None self.ownerID = None if node.myView: self.ownerID = node.application.corporationID else: self.ownerID = node.application.characterID self.entryContainer = uiprimitives.Container(parent=self) self.headerContainer = uiprimitives.Container(parent=self.entryContainer, align=uiconst.TOTOP, name='applicationHeaderContainer', height=self.APPHEADERHEIGHT) self.expander = uiprimitives.Sprite(parent=self.headerContainer, state=uiconst.UI_DISABLED, name='expander', pos=(0, 0, 16, 16), texturePath='res:/UI/Texture/Shared/getMenuIcon.png', align=uiconst.CENTERLEFT) if node.isExpanded: self.expander.rotation = -pi * 0.5 logoParent = uiprimitives.Container(parent=self.headerContainer, align=uiconst.TOPLEFT, pos=(16, 2, 48, 48)) uiutil.GetOwnerLogo(logoParent, self.ownerID, size=48, noServerCall=True) logoParent.children[0].OnMouseEnter = self.OnMouseEnter logoParent.children[0].OnClick = self.ShowOwnerInfo self.nameLabel = self.CORPNAMECLASS(parent=self.headerContainer, name='nameLabel', state=uiconst.UI_DISABLED, align=uiconst.CENTERLEFT, padding=self.CORPNAMEPAD) self.expandedParent = uiprimitives.Container(parent=self.entryContainer, name='expandedParent', height=0) self.expandedLabel = self.EXTENDEDCLASS(parent=self.expandedParent, name='applicationText', text=node.application.applicationText, padding=self.EXTENDEDPAD, align=uiconst.TOALL) self.hilite = uiprimitives.Fill(bgParent=self.headerContainer, color=(1, 1, 1, 0)) uiprimitives.Fill(bgParent=self.expandedParent, color=(0, 0, 0, 0.2))
def InitGauges(self): if self.gaugesInited: self.sr.gaugeParent.state = uiconst.UI_NORMAL return par = uiprimitives.Container(name='gauges', parent=self, align=uiconst.TOPLEFT, width=66, height=32, top=66, left=0, state=uiconst.UI_NORMAL) gauges = ['shield', 'armor', 'structure'] for gaugeName in gauges: g = uiprimitives.Container(name='gauge_%s' % gaugeName, parent=par, align=uiconst.TOTOP, height=7, padTop=5, padBottom=1) g.damageBar = uiprimitives.Fill(parent=g, align=uiconst.NOALIGN, color=(158 / 256.0, 11 / 256.0, 14 / 256.0, 1.0)) uicontrols.Frame(parent=g, color=(1.0, 1.0, 1.0, 0.5), padding=-1) uiprimitives.Fill(parent=g, padding=-1) setattr(self.sr, 'gauge_%s' % gaugeName, g) self.sr.gaugeParent = par self.gaugesInited = 1 self.ArrangeGauges()
def Startup(self, *etc): uiprimitives.Line(parent=self, align=uiconst.TOBOTTOM, color=uiconst.ENTRY_LINE_COLOR) self.container = uiprimitives.Container(name='container', parent=self) self.system = uiprimitives.Container(name='solarsystem', parent=self) self.industry = uiprimitives.Container(name='industry', parent=self, align=uiconst.TORIGHT, pos=(0, 0, 88, 10), padding=(0, 3, 8, 4)) self.military = uiprimitives.Container(name='military', parent=self, align=uiconst.TORIGHT, pos=(0, 0, 88, 10), padding=(0, 3, 8, 4)) self.claimTime = uiprimitives.Container(name='claimTime', parent=self, align=uiconst.TORIGHT, pos=(0, 0, 88, 10), padding=(0, 3, 8, 4)) self.location = uicontrols.EveLabelMedium(text='', parent=self.system, left=6, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, idx=0, maxLines=1) uicontrols.Frame(parent=self.claimTime, color=COLOR) self.claimTimeBars = [] for i in xrange(5): f = uiprimitives.Fill(parent=self.claimTime, name='claimTime%d' % i, align=uiconst.TOPLEFT, color=COLOR, pos=(2 + i * 17, 2, 16, 6)) self.claimTimeBars.append(f) uicontrols.Frame(parent=self.military, color=COLOR) self.militaryBars = [] for i in xrange(5): f = uiprimitives.Fill(parent=self.military, name='military%d' % i, align=uiconst.TOPLEFT, color=COLOR, pos=(2 + i * 17, 2, 16, 6)) self.militaryBars.append(f) uicontrols.Frame(parent=self.industry, color=COLOR) self.industryBars = [] for i in xrange(5): f = uiprimitives.Fill(parent=self.industry, name='industry%d' % i, align=uiconst.TOPLEFT, color=COLOR, pos=(2 + i * 17, 2, 16, 6)) self.industryBars.append(f)
def Prepare_(self): self.sr.label = uicontrols.Label(parent=self, state=uiconst.UI_DISABLED, align=uiconst.CENTER, bold=1, uppercase=0, idx=0, fontsize=self.default_fontsize, color=ccConst.COLOR + (TEXT_NORMAL,), letterspace=1) self.sr.hilite = uicontrols.Frame(parent=self, name='hilite', state=uiconst.UI_HIDDEN, color=ccConst.COLOR + (0.2,), frameConst=ccConst.FILL_BEVEL) self.sr.hilite.padLeft = self.sr.hilite.padTop = self.sr.hilite.padRight = self.sr.hilite.padBottom = 3 fill = uiprimitives.Fill(parent=self, name='fill', state=uiconst.UI_DISABLED, color=(0.35, 0.35, 0.35, 0.3), padding=(2, 2, 2, 2)) self.sr.activeframe = uiprimitives.Fill(parent=self, name='activeframe', state=uiconst.UI_HIDDEN, color=ccConst.COLOR + (FILL_SELECTION,), padding=(2, 2, 2, 2)) hiliteFrame = uicontrols.Frame(name='hiliteFrame', parent=self, frameConst=('ui_105_32_10', 8, -2), color=(1.0, 1.0, 1.0, 0.4)) shadow = uicontrols.Frame(name='shadow', parent=self, frameConst=ccConst.FRAME_SOFTSHADE) shadow.padding = (-9, -6, -9, -11)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self._caption = self.name = 'CtrlTabWindow' self.HideHeader() self.SetWndIcon(None) self.SetTopparentHeight(0) self.SetMainIconSize(0) self.MakeUncollapseable() self.MakeUnpinable() self.MakeUnMinimizable() self.MakeUnResizeable() self.MakeUnKillable() self.HideUnderlay() self.MakeUnstackable() uicore.event.RegisterForTriuiEvents(uiconst.UI_MOUSEDOWN, self.OnGlobalMouseDown) uicontrols.Frame(parent=self, color=FRAMECOLOR) uiprimitives.Fill(parent=self, color=FILLCOLOR) self.currOpenWindows = uicore.registry.GetWindows()[:] self.showOrHide = self.AllWindowsMinimized() self.selectionBoxIndex = None self.windowIcons = [] self.showOrHideMessage = [ localization.GetByLabel('UI/Common/Windows/HideWindows'), localization.GetByLabel('UI/Common/Windows/ShowWindows') ][self.showOrHide] self.InitializeWindowIcons() self.numIcons = len(self.windowIcons) self.numRows = int(math.ceil(float(self.numIcons) / float(NUMCOLS))) if self.numRows > 1: self.xShift = 0 else: self.xShift = (NUMCOLS - self.numIcons) * BLOCKSIZE / 2 uthread.new(self.SetWindowSize) self.RenderIcons() self.sr.selectionBox = uiprimitives.Container( name='selectionBox', parent=self.sr.main, align=uiconst.RELATIVE, pos=(SPACINGWIDTH, SPACINGWIDTH, ICONWIDTH, ICONWIDTH)) uiprimitives.Fill(parent=self.sr.selectionBox, color=SELECTCOLOR) self.sr.selectionBoxMouse = uiprimitives.Container( name='selectionBox', parent=self.sr.main, align=uiconst.RELATIVE, pos=(SPACINGWIDTH, SPACINGWIDTH, ICONWIDTH, ICONWIDTH), state=uiconst.UI_HIDDEN) uiprimitives.Fill(parent=self.sr.selectionBoxMouse, color=SELECTCOLOR) self.sr.windowText = uicontrols.EveLabelLarge( parent=self.sr.main, align=uiconst.TOBOTTOM, color=(1, 1, 1, 1), state=uiconst.UI_DISABLED, padding=BORDER)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) color = attributes.Get('color', util.Color.WHITE) backgroundColor = attributes.Get('backgroundColor', None) self.value = attributes.Get('value', 0.0) self.uiEffects = uicls.UIEffects() self.busy = False self.queuedSetValue = None self.gaugeCont = uiprimitives.Container(parent=self, name='gaugeCont', pos=(0, 0, self.width, self.height), align=uiconst.TOPLEFT) uicontrols.Frame(parent=self.gaugeCont, color=(1.0, 1.0, 1.0, 0.2)) self.gauge = uiprimitives.Fill(parent=self.gaugeCont, name='gauge', align=uiconst.TOLEFT, width=0, color=color) if backgroundColor is None: backgroundColor = util.Color(*color).SetAlpha(0.2).GetRGBA() uiprimitives.Fill(parent=self.gaugeCont, name='background', color=backgroundColor) testString = ''.join(self.HEXDIGITS) fontSize = 1 textHeight = uix.GetTextHeight(testString, fontsize=fontSize) while textHeight < self.height: fontSize += 1 textHeight = uix.GetTextHeight(testString, fontsize=fontSize) else: fontSize -= 1 textHeight = uix.GetTextHeight(testString, fontsize=fontSize) self.textCont = uiprimitives.Container(parent=self, name='textCont', pos=(0, 0, self.width, textHeight), align=uiconst.CENTER, clipChildren=True, idx=0) self.text = uicontrols.Label(parent=self.textCont, name='hackText', align=uiconst.TOALL, fontsize=fontSize, text='') hackText = random.choice(self.HEXDIGITS) while uix.GetTextWidth(hackText[1:], fontsize=fontSize) < self.width: hackText += random.choice(self.HEXDIGITS) self.text.text = hackText self.SetValueInstantly(self.value) self.hackStrings = ['Hacking Gibson...', 'Cracking Codes...', 'Inserting Rootkit...', 'Defeating ICE...', 'Circumventing Firewall...', 'Polymorphing Virii...', 'Erasing Logs...', 'Reticulating Splines...', 'Twisting Mersenne...', 'Curving Ellipses...', 'Analyzing Ciphers...', 'Factoring Primes...'] self.hackText = uicontrols.EveHeaderMedium(text='', parent=self, align=uiconst.CENTERBOTTOM, height=20, state=uiconst.UI_HIDDEN, top=-24) self.active = True uthread.new(self._CycleText)
def ConstructLayout(self): contName = 'group_%d' % self.groupID self.sr.selected = uiprimitives.Fill(bgParent=self, color=(1.0, 1.0, 1.0, 0.15), state=uiconst.UI_HIDDEN) self.sr.hilite = uiprimitives.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.1), state=uiconst.UI_HIDDEN) self.OnMouseEnter = self.BarOnMouseEnter self.OnMouseExit = self.BarOnMouseExit attackerName = cfg.eveowners.Get(self.attackerID).name defenderName = cfg.eveowners.Get(self.defenderID).name hintText = localization.GetByLabel( 'UI/Corporations/Wars/AggressorDefenderKillsHint', aggressorName=attackerName, aggressorKillsIsk=util.FmtISK(self.attackerKillsIsk, 0), aggressorKills=util.FmtAmt(self.attackerKills), defenderName=defenderName, defenderKillsIsk=util.FmtISK(self.defenderKillsIsk, 0), defenderKills=util.FmtAmt(self.defenderKills)) self.hint = hintText topbar = uiprimitives.Container(name='topbar', parent=self, align=uiconst.TOTOP, height=5, padTop=4) try: redwith = float(self.attackerKillsIsk) / float(self.maxKills) except: redwith = 0.0 redbar = uiprimitives.Container(parent=topbar, align=uiconst.TOLEFT_PROP, width=redwith, height=5, bgColor=ATTACKER_COLOR) bottombar = uiprimitives.Container(name='bluebar', parent=self, align=uiconst.TOBOTTOM, height=5, padBottom=4) try: bluewith = float(self.defenderKillsIsk) / float(self.maxKills) except: bluewith = 0.0 bluebar = uiprimitives.Container(parent=bottombar, align=uiconst.TOLEFT_PROP, width=bluewith, height=5, bgColor=DEFENDER_COLOR)
def Layout(self): """ Setup UI controls for this window. """ self.HideHeader() self.MakeUnResizeable() self.container = uicontrols.ContainerAutoSize(parent=self.GetMainArea(), align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, padding=(15, 15, 15, 0), callback=self.OnContainerResized, opacity=0.0) uicontrols.EveLabelLargeBold(parent=self.container, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/ActivateHeading')) uicontrols.EveLabelMedium(parent=self.container, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/ActivateDescription'), color=self.GRAY_COLOR, padding=(0, 5, 0, 10)) uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR) slot1 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3)) self.slot1Background = uiprimitives.Fill(parent=slot1, color=self.BLUE_COLOR, opacity=0.0) self.slot1Title = uicontrols.EveLabelMediumBold(parent=slot1, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/GameTime'), padding=(60, 12, 140, 0), color=self.BLUE_COLOR) self.slot1Expiry = uicontrols.EveLabelMediumBold(parent=slot1, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR) self.slot1Button = uicontrols.Button(parent=slot1, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0)) self.slot1Icon = Sprite(parent=slot1, texturePath='res:/UI/Texture/classes/CharacterSelection/plex_timer.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32)) uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR) slot2 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3)) self.slot2Background = uiprimitives.Fill(parent=slot2, color=self.BLUE_COLOR, opacity=0.0) self.slot2Title = uicontrols.EveLabelMediumBold(parent=slot2, align=uiconst.TOTOP, text='', padding=(60, 12, 140, 0), color=self.WHITE_COLOR) self.slot2Expiry = uicontrols.EveLabelMediumBold(parent=slot2, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR) self.slot2Button = uicontrols.Button(parent=slot2, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0)) self.slot2Icon = Sprite(parent=slot2, texturePath='res:/UI/Texture/Icons/add_training_queue.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32)) uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR) slot3 = uicontrols.ContainerAutoSize(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3)) self.slot3Background = uiprimitives.Fill(parent=slot3, color=self.BLUE_COLOR, opacity=0.0) self.slot3Title = uicontrols.EveLabelMediumBold(parent=slot3, align=uiconst.TOTOP, text='', padding=(60, 12, 140, 0), color=self.WHITE_COLOR) self.slot3Expiry = uicontrols.EveLabelMediumBold(parent=slot3, align=uiconst.TOTOP, text='', padding=(60, 0, 140, 10), color=self.GRAY_COLOR) self.slot3Button = uicontrols.Button(parent=slot3, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0)) self.slot3Icon = Sprite(parent=slot3, texturePath='res:/UI/Texture/Icons/add_training_queue.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32)) uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR) slot4 = Container(parent=self.container, align=uiconst.TOTOP, alignMode=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, bgColor=(0, 0, 0, 0.3), height=70) self.slot4Background = uiprimitives.Fill(parent=slot4, color=self.BLUE_COLOR, opacity=0.0) self.slot4Title = uicontrols.EveLabelMediumBold(parent=slot4, align=uiconst.TOTOP, text=localization.GetByLabel('UI/ActivatePlex/Donate'), padding=(60, 12, 140, 0), color=self.BLUE_COLOR) self.slot4Edit = SearchInput(parent=slot4, align=uiconst.TOTOP, padding=(60, 0, 140, 10), height=18, color=self.GRAY_COLOR, GetSearchEntries=self.Search, OnSearchEntrySelected=self.OnSearchEntrySelected, hinttext=localization.GetByLabel('UI/ActivatePlex/SearchHint')) self.slot4Edit.SetHistoryVisibility(False) self.entryContainer = Container(parent=slot4, align=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, padding=(60, 0, 140, 10), height=32, bgColor=(0, 0, 0, 0.3)) self.entryContainer.display = False self.slot4Button = uicontrols.Button(parent=slot4, label='', align=uiconst.CENTERRIGHT, fontsize=13, fixedwidth=120, fixedheight=30, pos=(10, 0, 0, 0)) self.slot4Button.Disable() self.slot4Icon = Sprite(parent=slot4, texturePath='res:/UI/Texture/classes/CharacterSelection/plex_timer.png', align=uiconst.CENTERLEFT, pos=(15, 0, 32, 32)) self.entryContainerIcon = Sprite(parent=self.entryContainer, texturePath='', align=uiconst.CENTERLEFT, pos=(0, 0, 32, 32)) clipContainer = Container(parent=self.entryContainer, clipChildren=True, padding=(40, 0, 36, 0)) self.entryContainerTitle = uicontrols.EveLabelMediumBold(parent=clipContainer, align=uiconst.CENTERLEFT, text='', width=150) self.entryContainerButton = uicontrols.ButtonIcon(parent=self.entryContainer, texturePath='res:/UI/Texture/Icons/73_16_210.png', align=uiconst.TOPRIGHT, func=self.ResetSearch, width=16, height=16, iconSize=16) uiprimitives.Line(parent=self.container, align=uiconst.TOTOP, color=self.LINE_COLOR) self.closeButton = uicontrols.Button(parent=self.container, label='', func=self.Close, align=uiconst.TOTOP, fontsize=13, padding=(120, 10, 120, 30)) uicore.animations.FadeTo(self.container, startVal=0.0, endVal=1.0, duration=0.5)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) text = attributes.get('text', self.default_text) appear = attributes.get('appear', False) self.hasBargraph = attributes.get('hasBargraph', self.default_hasBargraph) rightCont = uiprimitives.Container(name='rightCont', parent=self, align=uiconst.TORIGHT, width=446, padBottom=5) uiprimitives.Sprite( name='rightGraphics', parent=rightCont, align=uiconst.TOBOTTOM, texturePath='res:/UI/Texture/classes/CQMainScreen/heading2.png', height=14) uiprimitives.Fill(name='thickLine', parent=self, align=uiconst.TOBOTTOM, height=6, padBottom=9, color=util.Color.WHITE) self.label = uicontrols.Label(parent=self, text=text, top=10, fontsize=30, color=util.Color.WHITE) self.movingFill = uiprimitives.Fill(name='movingFill', parent=self, align=uiconst.BOTTOMRIGHT, pos=(0, 0, 100, 3), color=util.Color.WHITE) if self.hasBargraph: barGraphCont = uiprimitives.Container(name='bargraphCont', parent=self, align=uiconst.TOPRIGHT, pos=(10, 8, 332, 31)) self.barGraph = uiprimitives.Sprite( name='barGraph', parent=barGraphCont, texturePath='res:/UI/Texture/classes/CQMainScreen/barGraph.png', align=uiconst.CENTER, width=barGraphCont.width, height=31) self.barGraph.color.a = 0.6 if appear: uthread.new(self.AnimAppear)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.headID = attributes.headID self.ecuID = attributes.ecuID self.value = attributes.get('value', None) self.pin = attributes.pin self.overlapValue = None self.fill = uiprimitives.Fill( parent=self, align=uiconst.TOTOP, height=self.default_height, color=util.Color(*util.Color.WHITE).SetAlpha(0.1).GetRGBA(), state=uiconst.UI_HIDDEN, idx=0) self.icon = uicontrols.Icon(parent=self, icon='ui_77_32_38', size=self.default_height, ignoreSize=True, state=uiconst.UI_DISABLED, left=-2) self.label = SubTextLabel(parent=self, text='', left=self.default_height, top=4) self.SetValue(self.value)
def Startup(self, *args): listentry.Generic.Startup(self, *args) self.sr.selectedEntry = uiprimitives.Fill(parent=self, padTop=1, padBottom=1, color=(0.0, 1.0, 0.0, 0.25)) self.sr.selectedEntry.state = uiconst.UI_HIDDEN
def GetEulaConfirmation(self): self.waitingForEula = 1 self.eulaclosex.state = uiconst.UI_HIDDEN self.eulaBlock = uiprimitives.Fill( parent=self.eulaParent.parent, idx=self.eulaParent.parent.children.index(self.eulaParent) + 1, state=uiconst.UI_NORMAL, color=(0.0, 0.0, 0.0, 0.75)) par = uiprimitives.Container(name='btnpar', parent=self.eulaBrowser, align=uiconst.TOBOTTOM, height=40, idx=0) self.scrollText = uicontrols.EveLabelMedium( text=localization.GetByLabel('UI/Login/ScrollToBottom'), parent=par, align=uiconst.CENTER, idx=0, state=uiconst.UI_NORMAL) btns = uicontrols.ButtonGroup( btns=[[ localization.GetByLabel('UI/Login/Accept'), self.AcceptEula, 2, 81, uiconst.ID_OK, 0, 0 ], [ localization.GetByLabel('UI/Login/Decline'), self.ClickExit, (), 81, uiconst.ID_CANCEL, 0, 1 ]], line=0) btns.state = uiconst.UI_HIDDEN par.children.insert(0, btns) self.acceptbtns = btns self.pushButtons.SelectByID('eula') self.eulaBrowser.OnUpdatePosition = self.ScrollingEula self.waitingForEula = 1
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) endTime = attributes.endTime iconPath = attributes.iconPath addButton = attributes.get('addButton', False) self.callback = attributes.get('callback', None) hintMessage = attributes.get('hintMessage', None) if hintMessage: self.hint = localization.GetByLabel(hintMessage, endTime=endTime) self.highlight = uiprimitives.Fill(bgParent=self, color=(0.8, 0.8, 0.8, 0.2)) self.highlight.display = False icon = uiprimitives.Sprite(parent=self, pos=(0, 0, 32, 32), align=uiconst.CENTERLEFT, texturePath=iconPath, state=uiconst.UI_DISABLED) now = blue.os.GetWallclockTime() timeLeft = max(0L, endTime - now) timeLeftText = localization.formatters.FormatTimeIntervalWritten( long(timeLeft), showFrom='day', showTo='day') self.label = uicontrols.EveLabelLarge(parent=self, pos=(8, 0, 0, 0), align=uiconst.CENTERRIGHT, text=timeLeftText, state=uiconst.UI_DISABLED) if timeLeft < csUtil.WARNING_TIME: self.label.SetRGB(1, 0, 0, 1) self.width = icon.width + self.label.textwidth + self.label.left + 4 if self.callback: self.OnClick = self.callback if addButton: btnText = attributes.get('btnText', '') self.AddButton(btnText=btnText)
def SetupLogo(self, shapes=[None, None, None], colors=[None, None, None]): i = 0 self.sr.layerpics = [] for each in ['layerPic1', 'layerPic2', 'layerPic3']: btn = uiprimitives.Sprite(parent=getattr(self.logopicker, each), pos=(0, 0, 0, 0), align=uiconst.TOALL, color=(1.0, 0.0, 1.0, 0.0)) btn.OnClick = (self.ClickPic, i) self.sr.layerpics.append(btn) texturePath = self.GetLogoLibShape(shapes[i]) btn.LoadTexture(texturePath) btn.SetRGB(1.0, 1.0, 1.0, 1.0) self.corpLogo.SetLayerShapeAndColor(layerNum=i, shapeID=shapes[i], colorID=colors[i]) self.sr.prefs[i] = shapes[i] i += 1 i = 0 self.sr.layercols = [] for each in ['layerStyle1', 'layerStyle2', 'layerStyle3']: btn = uiprimitives.Fill(parent=getattr(self.logopicker, each), pos=(0, 0, 0, 0), align=uiconst.TOALL, color=(1.0, 1.0, 1.0, 0.0), state=uiconst.UI_NORMAL) btn.OnClick = (self.ClickCol, i, btn) self.sr.layercols.append(btn) if colors[i]: newshader = blue.resMan.LoadObject(util.GraphicFile(colors[i])) color, blendMode = self.GetLogoLibColor(colors[i]) btn.SetRGB(*color) self.sr.prefs[i + 3] = colors[i] i = i + 1
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.frequency = attributes.Get('frequency', self.default_frequency) self.dampRatio = attributes.Get('dampRatio', self.default_dampRatio) self.color = attributes.Get('color', self.default_color) self.disturbance = attributes.Get('disturbance', self.default_disturbance) self.barNum = attributes.Get('barNum', 0) self.value = 0.0 self.rawValue = 0.0 self.maxRawValue = 1.0 self.morphThread = None self.graphHeight = None self.backgroundFill = uiprimitives.Fill(parent=self, color=util.Color.GetGrayRGBA( 0.0, 0.5), state=uiconst.UI_HIDDEN) self.bar = uiprimitives.Sprite( parent=self, align=uiconst.BOTTOMLEFT, color=self.color, texturePath='res:/UI/Texture/Bargraph/%s.dds' % self.BARHEIGHT, pos=(0, -self.BARHEIGHT, self.width, self.BARHEIGHT), state=uiconst.UI_DISABLED, padLeft=1)
def _ConstructBaseLayout(self): self.charCont = uicontrols.ContainerAutoSize(parent=self.mainCont, name='charCont', align=uiconst.TOTOP) self.clockCont = neocom.WrapperButton(parent=self.mainCont, name='clockCont', align=uiconst.TOBOTTOM, height=20, cmdName='OpenCalendar') self.fixedButtonCont = uicontrols.ContainerAutoSize( parent=self.mainCont, name='fixedButtonCont', align=uiconst.TOBOTTOM) uiprimitives.Fill(bgParent=self.fixedButtonCont, color=self.COLOR_CORNERFILL, blendMode=trinity.TR2_SBM_ADD) self.overflowBtn = neocom.OverflowButton(parent=self.mainCont, align=uiconst.TOBOTTOM, state=uiconst.UI_HIDDEN, height=20) self.buttonCont = uiprimitives.Container(parent=self.mainCont, name='buttonCont', align=uiconst.TOALL) self.dropIndicatorLine = uiprimitives.Line( parent=self.mainCont, name='dropIndicatorLine', align=uiconst.TOPLEFT, color=util.Color.GetGrayRGBA(0.7, 0.3), pos=(0, 0, 0, 1))
def ApplyAttributes(self, attributes): uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes) uiprimitives.Line(parent=self, align=uiconst.TOBOTTOM, color=uiconst.ENTRY_LINE_COLOR) self.container = uiprimitives.Container(name='container', parent=self) self.system = uiprimitives.Container(name='solarsystem', parent=self) self.upgrades = uiprimitives.Container(name='upgrades', parent=self, align=uiconst.TORIGHT, pos=(0, 0, 280, 10), padding=(0, 3, 8, 4)) self.location = uicontrols.EveLabelMedium(text='', parent=self.system, left=6, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, idx=0, maxLines=1) self.upgradeBars = [] uicontrols.Frame(bgParent=self.upgrades, color=COLOR) barCont = uiprimitives.Container(parent=self.upgrades, padding=1) for i in xrange(5): f = uiprimitives.Fill(parent=barCont, name='upgrades%d' % i, align=uiconst.TOLEFT_PROP, color=COLOR, width=0.2, padding=1) self.upgradeBars.append(f)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) fillColor = attributes.get('fillColor', self.default_fillColor) gradientColor = attributes.get('gradientColor', self.default_gradientColor) leftContWidth = attributes.get('leftContWidth', self.default_leftContWidth) appear = attributes.get('appear', False) self.leftCont = uiprimitives.Container(name='leftCont', parent=self, align=uiconst.TOLEFT, width=leftContWidth) uiprimitives.Fill(name='leftBg', bgParent=self.leftCont, color=fillColor) self.mainCont = uiprimitives.Container(name='mainCont', parent=self, padLeft=0, padRight=0) gradient = uiprimitives.Sprite( name='rightGradient', bgParent=self.mainCont, color=gradientColor, texturePath='res:/UI/Texture/classes/CQMainScreen/gradientHoriz.png' ) if appear: uthread.new(self.AnimAppear) else: self.opacity = 0.0
def LoadHistory(self, historyLength): uiutil.FlushList(self.sr.bitParent.children[1:]) litBit = None for i in xrange(historyLength): bit = uiprimitives.Container( parent=self.sr.bitParent, name='bit_%s' % i, align=uiconst.TOPLEFT, pos=(i * (self.BITWIDTH + self.BITGAP), 0, self.BITWIDTH + self.BITGAP, self.SIZE), state=uiconst.UI_NORMAL) uiprimitives.Fill(parent=bit, color=(1.0, 1.0, 1.0, 0.75), padding=(self.BITGAP, 4, 0, 4)) bit.OnClick = (self.OnClickBit, bit) bit.idx = i if i == self._lastLoadIndex: litBit = bit self._lastLoadIndex = None self.UpdateContentWidth() if litBit is None: self.ScrollTo(1.0, initing=True) else: self._lastLit = litBit self.SettleScrollHandle(initing=True) self.UpdateBitsState()
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.minSec = attributes.minSec self.maxSec = attributes.maxSec self.secRange = self.maxSec - self.minSec self.typeID = attributes.typeID self.numSecSections = int(self.secRange / 0.5) sectionWidth = self.width / self.numSecSections uiprimitives.Line(parent=self, align=uiconst.TORIGHT, color=(0, 0, 0, 0.5)) icon = uicontrols.Icon(parent=self, typeID=self.typeID, size=48, align=uiconst.CENTER, ignoreSize=True, OnClick=self.OnIconClick, state=uiconst.UI_NORMAL) icon.GetMenu = lambda : sm.GetService('menu').GetMenuFormItemIDTypeID(None, self.typeID, ignoreMarketDetails=False) secMeter = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=SEC_METER_HEIGHT) for n in xrange(self.numSecSections): sec = self.minSec + n * const.securityGainPerTag for data in SEC_BAND_DATA: if sec < data.maxSec: break if data.altColor is not None and n % 2 == 1: color = data.altColor else: color = data.color uiprimitives.Fill(parent=secMeter, align=uiconst.TOLEFT, width=sectionWidth, color=color.GetRGBA(), hint=localization.GetByLabel(data.pveHintLable) + '<br>' + localization.GetByLabel(data.pvpHintLabel), state=uiconst.UI_NORMAL) self.quantitySpentText = uicontrols.EveLabelSmallBold(parent=self, align=uiconst.CENTER, top=30, color=(1, 1, 1, 1)) self.SetQuantity(0)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self._spinning = False self._lastAngle = 0.0 self._tickGap = 0.0 self._options = None self._value = None self._lastRotationDelta = None self._didSpin = False self._wheelbuffer = 0 self._wheeling = False for each in uicore.layer.main.children[:]: if each.name == self.default_name: each.Close() if attributes.parent is None: uicore.layer.main.children.append(self) transform = uiprimitives.Transform(parent=self, pos=(0, 0, self.TEXTURESIZE, self.TEXTURESIZE), align=uiconst.CENTER, state=uiconst.UI_DISABLED, name='mainTransform') self.sr.mainTransform = transform sprite = uiprimitives.Sprite(parent=transform, align=uiconst.TOALL, texturePath='res:/UI/Texture/spinWheelPicker_main.dds') self.sr.mainTransform = transform self.sr.marker = uiprimitives.Fill(parent=self, align=uiconst.CENTER, pos=(0, -64, 2, 16), color=(1.0, 1.0, 1.0, 1.0), idx=0) options = attributes.Get('options', [(True, None)] + [ (False, i) for i in xrange(60) ]) activeOptionIndex = attributes.Get('activeOptionIndex', 4) self.LoadOptions(options, activeOptionIndex) setvalueCallback = attributes.Get('OnSetValue', None) if setvalueCallback: self.OnSetValue = setvalueCallback
def MapScaler(self, where): parent = uiprimitives.Container(parent=where, align=uiconst.TOBOTTOM, height=14) uicontrols.EveLabelSmall( text=localization.GetByLabel('UI/Map/MapBrowser/ZoomLevel'), parent=parent, left=0, top=-12, width=100, color=(1.0, 1.0, 1.0, 0.5), state=uiconst.UI_NORMAL) for level in (1, 2, 4): sub = uiprimitives.Container(parent=parent, align=uiconst.TOLEFT, width=24, state=uiconst.UI_NORMAL) sub.OnClick = (self.ChangeZoomLevel, sub, level) parent.width += sub.width uicontrols.Frame(parent=sub) txt = uicontrols.EveLabelSmall(text='%sx' % level, parent=sub, align=uiconst.TOALL, left=6, top=2, state=uiconst.UI_DISABLED) if settings.user.ui.Get('mapbrowserzoomlevel', 1) == level: uiprimitives.Fill(parent=sub, padding=(1, 1, 1, 1))
def ApplyAttributes(self, attributes): uicls.InfoPanelBase.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.inEditMode = False self.editModeContainer = uiprimitives.Container(parent=self.mainCont, name='buttonContainer', align=uiconst.TOTOP, state=uiconst.UI_HIDDEN, padding=(0, 0, 0, 5)) self.editModeContent = uiprimitives.Container(parent=self.editModeContainer, name='editModeContent', align=uiconst.TOALL, padding=(10, 6, 10, 6)) uiprimitives.Fill(parent=self.editModeContainer, color=util.Color.GetGrayRGBA(0.0, 0.3)) uicontrols.Frame(parent=self.editModeContainer, color=util.Color.GetGrayRGBA(0.0, 0.2)) self.tabPanelContainer = uicontrols.ContainerAutoSize(parent=self.mainCont, name='tabPanelContainer', align=uiconst.TOTOP) self.planetName = self.headerCls(parent=self.headerCont, state=uiconst.UI_NORMAL, align=uiconst.CENTERLEFT) self.resourceControllerTab = ResourceController(parent=self.tabPanelContainer) self.editModeTab = PlanetEditModeContainer(parent=self.tabPanelContainer) self.modeButtonGroup = uicls.ToggleButtonGroup(parent=self.mainCont, align=uiconst.TOTOP, callback=self.OnButtonSelected, padBottom=4) for btnID, label, panel in (('editModeTab', localization.GetByLabel('UI/Common/Build'), self.editModeTab), ('resourceControllerTab', localization.GetByLabel('UI/PI/Common/Scan'), self.resourceControllerTab)): self.modeButtonGroup.AddButton(btnID, label, panel) self.modeButtonGroup.SelectByID('editModeTab') BTNSIZE = 24 exitBtn = uicontrols.Button(parent=self.headerCont, align=uiconst.CENTERRIGHT, pos=(0, 0, BTNSIZE, BTNSIZE), icon='res:/UI/Texture/Icons/73_16_45.png', iconSize=16, func=self.ExitPlanetMode, alwaysLite=True, hint=localization.GetByLabel('UI/PI/Common/ExitPlanetMode')) homeBtn = uicontrols.Button(parent=self.headerCont, align=uiconst.CENTERRIGHT, pos=(exitBtn.left + exitBtn.width + 2, 0, BTNSIZE, BTNSIZE), icon='res:/UI/Texture/Icons/73_16_46.png', iconSize=16, func=self.ViewCommandCenter, alwaysLite=True, hint=localization.GetByLabel('UI/PI/Common/ViewPlanetaryCommandCenter')) self.sr.homeBtn = homeBtn self.UpdatePlanetText() self.UpdateHomeButton() self.CreateEditModeContainer() planetUISvc = sm.GetService('planetUI') planetUISvc.SetModeController(self) uthread.new(self.OnEditModeChanged, planetUISvc.inEditMode)
def ConstructFriendSquares(self, proportion): self.topCont.Flush() for i in xrange(5): cont = uiprimitives.Container(parent=self.topCont, align=uiconst.TOLEFT_PROP, state=uiconst.UI_NORMAL, width=0.2, padding=(0, 20, 0, 2), hint=localization.GetByLabel( self.TIERHINTS[i])) subCont = uiprimitives.Container(parent=cont, padding=(2, 0, 2, 0)) uiprimitives.Sprite( bgParent=subCont, texturePath='res:/UI/Texture/Classes/FWWindow/TierBlock.png', opacity=0.5) uiprimitives.Fill(bgParent=subCont, color=facwarCommon.COLOR_FRIEND) if proportion * 5 < i: cont.opacity = 0.2 uicontrols.EveHeaderLarge(parent=subCont, align=uiconst.CENTERTOP, top=-22, text=localization.GetByLabel( 'UI/FactionWarfare/TierNum', tierNum=i + 1), color=facwarCommon.COLOR_FRIEND_LIGHT)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) corpID = attributes.corpID self.entityID = attributes.entityID self.cursor = uiconst.UICURSOR_SELECT self.hoverFill = uiprimitives.Fill(parent=self, name='hoverFill', padding=-50, color=(1.0, 1.0, 1.0, 0.0)) self.frame = uicls.ScreenFrame5(parent=self, align=uiconst.TOALL, padding=10) self.ConstructCorpLogo(corpID) self.hoverLabel = uicontrols.Label( name='hoverLabel', parent=self, text=localization.GetByLabel('UI/Station/Holoscreen/Corporation'), align=uiconst.CENTERBOTTOM, top=60, uppercase=True, fontsize=35, state=uiconst.UI_DISABLED, color=util.Color.WHITE) self.hoverLabel.opacity = 0.0 self.bgSprite = uiprimitives.Sprite( parent=self, texturePath= 'res:/UI/Texture/Classes/CQSideScreens/corpRecruitmentScreenBG.png', align=uiconst.TOALL, state=uiconst.UI_DISABLED, padding=-50) uthread.new(self.AnimBackground)