def Setup(self, template=None, readonly=False): self.typeID = None self.readonly = readonly self.boven = uiprimitives.Container(name='ccip_top', parent=self, height=ICONSIZE, align=uiconst.TOTOP) self.toolbar = uiprimitives.Container(name='ccip_bar', parent=self.boven, left=ICONSIZE + 2, top=ICONSIZE - TOOLSIZE, height=TOOLSIZE, align=uiconst.TOPLEFT, width=240) uiprimitives.Container(name='ccip_push', parent=self, height=3, align=uiconst.TOTOP) cont = uiprimitives.Container(name='mainicon', parent=self.boven, width=ICONSIZE, align=uiconst.TOLEFT) self.infoframe = uicontrols.Frame(parent=cont) self.infoicon = infoicon = InfoIcon(left=1, top=1, parent=cont, idx=0, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED) infoicon.OnClick = lambda *x: self.ShowInfo() self.icon = uicontrols.Icon(parent=cont) self.icon.OnClick = self.ShowInfo self.icon.LoadTexture('res:/UI/Texture/notavailable.dds') self.icon.width = self.icon.height = ICONSIZE uiprimitives.Container(name='ccip_push', parent=self.boven, width=6, align=uiconst.TOLEFT) cont = uiprimitives.Container(name='ccip_icon', parent=self.boven, align=uiconst.TOTOP, height=24) self.capt = uicontrols.CaptionLabel(text='', parent=cont) cont = uiprimitives.Container(name='ccip_textcont', parent=self.boven, align=uiconst.TOALL, pos=(0, 0, 0, 0)) self.text = uicontrols.Label(text='', parent=cont, align=uiconst.TOTOP, height=self.boven.height, state=uiconst.UI_NORMAL) self.scroll = uicontrols.Scroll(name='ccip_top', parent=self) if template: self.Load(template) else: self.typeID = None self.capt.text = 'Copycat' self.text.text = 'Select a ship setup from the list to display details in this panel' self.scroll.Load(contentList=[], headers=['qty', 'name'])
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) fileList = attributes.fileList self.selected = fileList[0][0] + '.pos' self.SetCaption('Assemble Starbase') self.MakeUnResizeable() self.SetMinSize([256, 256], 1) self.SetWndIcon(None) self.SetTopparentHeight(0) guts = uiprimitives.Container( parent=self.sr.main, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding), align=uiconst.TOALL) uicontrols.Combo(label='Select POS file', parent=guts, options=fileList, name='fileselect', select=0, align=uiconst.TOTOP, pos=(0, 20, 0, 0), width=200, callback=self.OnComboChange) scroll = uicontrols.Scroll(parent=guts, padding=(0, const.defaultPadding, 0, const.defaultPadding)) scrolllist = [] for cfgname, var, label, group in [ ['posTowerAnchor', 'TowerAnchor', 'Anchor Control Tower', None], [ 'posTowerFuel', 'TowerFuel', 'Fuel Control Tower (for onlining)', None ], ['posTowerOnline', 'TowerOnline', 'Online Control Tower', None], ['posStructAnchor', 'StructAnchor', 'Anchor All Structures', None], [ 'posStructFuel', 'StructFuel', 'Fuel Control Tower (for structures)', None ], ['posStructOnline', 'StructOnline', 'Online All Structures', None], ['posArmWeapons', 'ArmWeapons', 'Arm Weapon Batteries', None] ]: data = util.KeyVal() data.label = label data.checked = True data.cfgname = cfgname data.retval = var data.group = group data.OnChange = self.CheckBoxChange le = listentry.Get('Checkbox', data=data) scrolllist.append(le) setattr(self, var, True) setattr(self, var + 'LE', le) scroll.Load(contentList=scrolllist) buttons = [['Execute', self.Execute, None, 81], ['Cancel', self.Cancel, None, 81]] self.sr.main.children.insert(0, uicontrols.ButtonGroup(btns=buttons))
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) LineThemeColored(parent=self, align=uiconst.TOBOTTOM, opacity=uiconst.OPACITY_FRAME) self.headerContainer = uiprimitives.Container(parent=self) self.settingsID = attributes.settingsID self.customSortIcon = None self.columnIDs = [] self.fixedColumns = None self.defaultColumn = None
def AddColorSliders(self, name, valueName): c = uiprimitives.Container(parent=self.cont, align=uiconst.TOTOP, height=36) uicontrols.Label(text=name + ':', parent=c, align=uiconst.TOPLEFT) colorCont = uiprimitives.Container(parent=c, align=uiconst.BOTTOMLEFT, left=440, width=40, height=20) colorFill = uiprimitives.Fill(parent=colorCont, color=(1, 0, 1, 1)) def SetColorValue(slider, valueIndex): colorList = list(globals()[valueName]) colorList[valueIndex] = slider.GetValue() globals()[valueName] = tuple(colorList) colorFill.color = tuple(colorList) colorVal = globals()[valueName] self.ColorSlider(c, SetColorValue, 0, 0, colorVal[0]) self.ColorSlider(c, SetColorValue, 1, 110, colorVal[1]) self.ColorSlider(c, SetColorValue, 2, 220, colorVal[2]) self.ColorSlider(c, SetColorValue, 3, 330, colorVal[3]) self.sliders[c] = (valueName, name)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) shipID = attributes.shipID self.SetMinSize([200, 200]) self.SetWndIcon(self.iconNum, mainTop=-13) self.DefineButtons(uiconst.CLOSE) self.sr.capacityText = uicontrols.EveHeaderSmall(text=' ', name='capacityText', parent=self.sr.topParent, left=8, top=4, align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED) self.sr.gaugeParent = uiprimitives.Container(name='gaugeParent', align=uiconst.TOPRIGHT, parent=self.sr.topParent, left=const.defaultPadding, height=7, width=100, state=uiconst.UI_DISABLED, top=self.sr.capacityText.top + self.sr.capacityText.textheight + 1) uicontrols.Frame(parent=self.sr.gaugeParent, color=(0.5, 0.5, 0.5, 0.3)) self.sr.gauge = uiprimitives.Container(name='gauge', align=uiconst.TOLEFT, parent=self.sr.gaugeParent, state=uiconst.UI_PICKCHILDREN, width=0) uiprimitives.Fill(parent=self.sr.gaugeParent, color=(0.0, 0.521, 0.67, 0.1), align=uiconst.TOALL) uiprimitives.Fill(parent=self.sr.gauge, color=(0.0, 0.521, 0.67, 0.6)) self.sr.scroll = uicontrols.Scroll(parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) t = uicontrols.EveHeaderSmall(text=localization.GetByLabel('UI/Ship/ShipScan/hdrModulesFitted'), parent=self.sr.topParent, left=8, state=uiconst.UI_DISABLED, align=uiconst.BOTTOMLEFT) self.LoadResult(*attributes.results)
def ConstructLayout(self): uicontrols.EveLabelLargeBold(name='caption', parent=self.sr.topParent, text=localization.GetByLabel('UI/SecurityOffice/HeaderCaption'), top=20, left=98) uicontrols.EveLabelSmall(name='subcaption', parent=self.sr.topParent, text=localization.GetByLabel('UI/SecurityOffice/WindowSubheaderDescription'), top=40, left=98) self.securityTagBar = uicls.SecurityTagBar(parent=self.sr.main) bottomContainer = uiprimitives.Container(name='bottomContainer', parent=self.sr.main, align=uiconst.TOBOTTOM, height=40) self.iskCostText = uicontrols.EveLabelMediumBold(parent=bottomContainer, align=uiconst.CENTERLEFT, left=8) self.submitButton = uicontrols.Button(parent=bottomContainer, align=uiconst.CENTERRIGHT, left=8, label=localization.GetByLabel('UI/SecurityOffice/ExchangeTags'), func=self.Submit) self.CreateTextFeedback() uicontrols.GradientSprite(parent=bottomContainer, align=uiconst.TOALL, rotation=-math.pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.5), (0.9, 0.15)], state=uiconst.UI_DISABLED)
def ConstructSpriteEffectColumn(self): spriteEffectCont = uiprimitives.Container(parent=self.bottomCont, align=uiconst.TOLEFT, width=self.COLUMN_WIDTH) uiprimitives.Line(parent=spriteEffectCont, align=uiconst.TORIGHT) uicontrols.Label(parent=spriteEffectCont, text='spriteEffect', align=uiconst.TOTOP) for constName in dir(trinity): if not constName.startswith('TR2_SFX_'): continue constVal = getattr(trinity, constName) uicontrols.Checkbox(parent=spriteEffectCont, text=constName, align=uiconst.TOTOP, configName='spriteEffectGroup', groupname='spriteEffectGroup', checked=constVal == uiprimitives.Sprite.default_spriteEffect, callback=self.OnSpriteEffectRadioChanged, retval=constVal)
def AddColumn(self, columnWidth, name='column'): column = uiprimitives.Container(name=name, align=uiconst.TOLEFT, width=columnWidth, padLeft=8, parent=self.parent) column.isTabOrderGroup = 1 BumpedUnderlay(isInFocus=True, parent=column) return column
def AddSlider(self, where, config, minval, maxval, header, hint = '', startVal = 0): h = 10 _par = uiprimitives.Container(name=config + '_slider', parent=where, align=uiconst.TOTOP, pos=(0, 0, 124, 10), padding=(0, 0, 0, 0)) par = uiprimitives.Container(name=config + '_slider_sub', parent=_par, align=uiconst.TOPLEFT, pos=(0, 0, 124, 10), padding=(0, 0, 0, 0)) slider = uicontrols.Slider(parent=par) lbl = uicontrols.EveLabelSmall(text='bla', parent=par, align=uiconst.TOPLEFT, width=200, left=-34, top=0) setattr(self.sr, '%sLabel' % config, lbl) lbl.name = 'label' slider.SetSliderLabel = self.SetSliderLabel lbl.state = uiconst.UI_HIDDEN slider.Startup(config, minval, maxval, None, header, startVal=startVal) if startVal < minval: startVal = minval slider.value = startVal slider.name = config slider.hint = hint slider.OnSetValue = self.OnSetValue return slider
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.invCookie = None self.invReady = 0 self.optionsByItemType = {} self.itemToRepairDescription = '' self.repairSvc = util.Moniker('repairSvc', session.stationid2) self.invCache = sm.GetService('invCache') self.SetMinSize([350, 270]) self.SetWndIcon(self.iconNum, mainTop=-4) uicontrols.WndCaptionLabel( text=localization.GetByLabel('UI/Station/Repair/RepairFacilities'), parent=self.sr.topParent, align=uiconst.RELATIVE) self.scope = 'station' btns = uicontrols.ButtonGroup( btns=[(localization.GetByLabel('UI/Commands/PickNewItem'), self.DisplayItems, (), 84), (localization.GetByLabel('UI/Commands/RepairItem'), self.QuoteItems, (), 84), (localization.GetByLabel('UI/Commands/RepairAll'), self.DoNothing, (), 84)]) self.sr.main.children.append(btns) self.sr.pickSelect = btns self.sr.pickBtn = self.sr.pickSelect.GetBtnByLabel( localization.GetByLabel('UI/Commands/PickNewItem')) self.sr.selBtn = self.sr.pickSelect.GetBtnByLabel( localization.GetByLabel('UI/Commands/RepairItem')) self.sr.repairAllBtn = self.sr.pickSelect.GetBtnByLabel( localization.GetByLabel('UI/Commands/RepairAll')) cont = uiprimitives.Container(name='scroll', align=uiconst.TORIGHT, parent=self.sr.topParent, left=const.defaultPadding, width=200) self.sr.scroll = uicontrols.Scroll( parent=self.sr.main, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.scroll.sr.minColumnWidth = { localization.GetByLabel('UI/Common/Type'): 30 } self.sr.avgDamage = uicontrols.EveLabelSmall(text='', parent=cont, name='avgDamage', left=8, top=0, state=uiconst.UI_NORMAL, align=uiconst.BOTTOMRIGHT) self.sr.totalCost = uicontrols.EveLabelSmall(text='', parent=cont, name='totalCost', left=8, top=12, state=uiconst.UI_NORMAL, align=uiconst.BOTTOMRIGHT) uthread.new(self.DisplayItems)
def ConstructFlagsCont(self): if self.sr.flags is None: if self.sr.node.viewMode == 'details': self.sr.flags = uiprimitives.Container( parent=self, idx=0, name='flags', pos=(5, 20, 32, 16), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN) elif self.sr.node.viewMode == 'icons': self.sr.flags = uiprimitives.Container( parent=self, idx=0, name='flags', pos=(0, 37, 32, 16), align=uiconst.TOPRIGHT, state=uiconst.UI_PICKCHILDREN)
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 CreateBanElement(typeID, parent, teamIdx): def RemoveBan(*args): self.matchMoniker.UnBanShipType(self.matchDetails[0], typeID, teamIdx) banContainer = uiprimitives.Container(name='banEle', parent=parent, align=uiconst.TOTOP, height=16) uicontrols.Button(label='X', parent=banContainer, func=RemoveBan, align=uiconst.TOLEFT) uicontrols.Label(text=cfg.invtypes[typeID].typeName, parent=banContainer, align=uiconst.TOLEFT) return banContainer
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.tradeSession = attributes.tradeSession self.tradedShips = [] self.SetWndIcon() buttonParent = FlowContainer(name='buttonParent', parent=self.sr.main, align=uiconst.TOBOTTOM, padding=6, autoHeight=True, centerContent=True, contentSpacing=(6, 6)) Button(parent=buttonParent, label=localization.GetByLabel('UI/PVPTrade/Accept'), func=self.OnClickAccept, align=uiconst.NOALIGN) Button(parent=buttonParent, label=localization.GetByLabel('UI/Common/Buttons/Cancel'), func=self.Cancel, align=uiconst.NOALIGN) sessionData = self.tradeSession.List() herID = sessionData.traders[not sessionData.traders.index(session. charid)] self.sr.herinfo = cfg.eveowners.Get(herID) mainCont = uiprimitives.Container(name='mainCont', parent=self.sr.main) self.sr.my = my = invCont.PlayerTrade( parent=mainCont, align=uiconst.TOTOP_PROP, height=0.5, itemID=sessionData.tradeContainerID, ownerID=session.charid, tradeSession=self.tradeSession, state=uiconst.UI_PICKCHILDREN) self.sr.myAccept = my.acceptIcon self.sr.myMoney = my.moneyLabel self.sr.her = her = invCont.PlayerTrade( parent=mainCont, align=uiconst.TOTOP_PROP, height=0.5, itemID=sessionData.tradeContainerID, ownerID=herID, tradeSession=self.tradeSession, state=uiconst.UI_PICKCHILDREN) self.sr.herAccept = her.acceptIcon self.sr.herMoney = her.moneyLabel offerBtn = Button( parent=my.topCont, label=localization.GetByLabel('UI/PVPTrade/OfferMoney'), func=self.OnClickOfferMoney, args=None, idx=0, pos=(2, 2, 0, 0), align=uiconst.TOPRIGHT) self.sr.myIx = sessionData.traders.index(eve.session.charid) self.sr.herIx = sessionData.traders.index(herID) self.OnMoneyOffer([0, 0]) self.SetCaption(self.GetWindowCaptionText())
def Startup(self): self.sr.preview = preview = uiprimitives.Container( parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_NORMAL) self.sr.preview.OnClick = self.OnPickColor self.sr.colorfill = uiprimitives.Fill(parent=preview, color=(0.0, 1.0, 0.0, 1.0))
def ConstructWarzonePanel(self): self.warzonePanel.Flush() self.warzoneControl = uicls.FWWarzoneControl(parent=self.warzonePanel, align=uiconst.TOTOP, padding=(0, 10, 0, 10)) bottomCont = uiprimitives.Container(parent=self.warzonePanel, align=uiconst.TOALL, height=0.3) systemStatsCont = uicontrols.DragResizeCont(name='systemStatsCont', settingsID='FWsystemStatsCont', parent=bottomCont, align=uiconst.TORIGHT_PROP, minSize=0.1, maxSize=0.5, defaultSize=0.45) mapCont = uiprimitives.Container(parent=bottomCont, align=uiconst.TOALL) uicontrols.GradientSprite(bgParent=mapCont, rotation=-pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.1), (0.9, 0.0)]) self.bracketParent = uiprimitives.Container(name='bracketCont', parent=mapCont, clipChildren=True) from eve.client.script.ui.control.scenecontainer import SceneContainerBaseNavigation self.sceneContainerNav = SceneContainerBaseNavigation(parent=mapCont, state=uiconst.UI_NORMAL) from eve.client.script.ui.control.scenecontainer import SceneContainerBrackets self.sceneContainerNav.cursor = uiconst.UICURSOR_DRAGGABLE self.sceneContainer = SceneContainerBrackets(parent=mapCont, align=uiconst.TOALL) self.sceneContainerNav.Startup(self.sceneContainer) self.ConstructMap() self.systemsScroll = uicontrols.Scroll(name='systemsScroll', parent=systemStatsCont) self.systemsScroll.sr.id = 'FWSystemsScroll' self.UpdateSystemsScroll()
def ApplyAttributes(self, attributes): super(uicls.AIDebugWindow, self).ApplyAttributes(attributes) self.SetMinSize([self.default_width, self.default_height]) self.SetCaption('AI Debug Window') self.sr.content.padding = 5 self.perceptionClient = sm.GetService('perceptionClient') self.aimingClient = sm.GetService('aimingClient') clientContainer = uiprimitives.Container(parent=self.sr.content, align=uiconst.TOLEFT_PROP, width=0.5) uiprimitives.Line(parent=clientContainer, align=uiconst.TORIGHT) uicontrols.Label(parent=clientContainer, align=uiconst.TOTOP, text='----- CLIENT -----', pos=(0, 0, 0, 0), padding=(5, 5, 5, 5)) uicontrols.Checkbox(parent=clientContainer, text='Perception', checked=self.perceptionClient.GetPerceptionManager(session.worldspaceid).IsDebugRendering(), callback=self.OnTogglePerception) uicontrols.Checkbox(parent=clientContainer, text='Aiming', checked=self.aimingClient.GetAimingManager(session.worldspaceid).IsDebugRendering(), callback=self.OnToggleAiming) uicontrols.Button(parent=clientContainer, align=uiconst.CENTERBOTTOM, label='Gaze at Nearest', func=self.GazeNearest, top=6) serverContainer = uiprimitives.Container(parent=self.sr.content, align=uiconst.TORIGHT_PROP, width=0.5) uicontrols.Label(parent=serverContainer, align=uiconst.TOTOP, text='----- SERVER -----', padding=(5, 5, 5, 5)) uicontrols.Checkbox(parent=serverContainer, text='Perception', checked=self.perceptionClient.GetPerceptionManager(session.worldspaceid).IsDebugRenderingServer(), callback=self.OnTogglePerceptionServer) uicontrols.Checkbox(parent=serverContainer, text='Aiming', checked=self.aimingClient.GetAimingManager(session.worldspaceid).IsDebugRenderingServer(), callback=self.OnToggleAimingServer) uicontrols.Button(parent=serverContainer, align=uiconst.CENTERBOTTOM, label='Gaze at Nearest', func=self.GazeNearestServer, top=6)
def AddLayout(self): self.sr.main = uiprimitives.Container(name='main', parent=self, align=uiconst.TOPLEFT, height=ICONHEIGHT, width=ICONWIDTH) self.sr.background = uiprimitives.Container(name='background', parent=self.sr.main, align=uiconst.TOTOP, height=88) self.sr.backgroundFrame = uicontrols.BumpedUnderlay(name='backgroundUnderlay', parent=self.sr.background) self.sr.iconContainer = uiprimitives.Container(name='iconContainer', parent=self.sr.main, align=uiconst.CENTERTOP, pos=(0, 10, 54, 54), idx=0) invTypeIcon = inventorycommon.typeHelpers.GetIcon(self.typeID) self.sr.icon = icon = uicontrols.Icon(parent=self.sr.iconContainer, align=uiconst.TOALL, state=uiconst.UI_DISABLED) if invTypeIcon is None: icon.ChangeIcon(typeID=self.typeID) else: icon.LoadIcon(invTypeIcon.iconFile) self.sr.quantityContainer = uiprimitives.Container(name='quantityContainer', parent=self.sr.background, align=uiconst.CENTERBOTTOM, height=20, width=ICONWIDTH - 1, idx=0, bgColor=(0, 0, 0, 0.5)) self.sr.quantityLabel = uicontrols.EveLabelMedium(text='', parent=self.sr.quantityContainer, align=uiconst.CENTERBOTTOM, left=3, bold=True) self.barContainer = uiprimitives.Fill(name='barContainer', parent=self.sr.quantityContainer, align=uiconst.TOPLEFT, color=(1, 1, 1, 0.25), height=20, width=0) self.sr.typeNameContainer = uiprimitives.Container(name='typeNameContainer', parent=self.sr.main, align=uiconst.TOALL) self.sr.typeName = uicls.LabelLink(text=localization.GetByLabel('UI/UpgradeWindow/CenteredTypeText', type=self.typeID), parent=self.sr.typeNameContainer, align=uiconst.CENTERTOP, maxLines=3, width=ICONWIDTH, func=(sm.GetService('info').ShowInfo, self.typeID), hint=localization.GetByLabel('UI/Commands/ShowInfo'), top=3) self.sr.typeName.maxLines = None self.sr.frame = uicontrols.Frame(parent=self, state=uiconst.UI_HIDDEN)
def CreateEditModeContainer(self): uicontrols.EveHeaderLarge(parent=self.editModeContent, text=localization.GetByLabel('UI/PI/Common/EditsPending'), align=uiconst.RELATIVE) self.powerGauge = uicls.Gauge(parent=self.editModeContent, pos=(0, 22, 115, 34), color=planetCommon.PLANET_COLOR_POWER, label=localization.GetByLabel('UI/PI/Common/PowerUsage')) self.cpuGauge = uicls.Gauge(parent=self.editModeContent, pos=(130, 22, 115, 34), color=planetCommon.PLANET_COLOR_CPU, label=localization.GetByLabel('UI/PI/Common/CpuUsage')) self.UpdatePowerAndCPUGauges() btns = [[localization.GetByLabel('UI/Common/Submit'), self.Submit, ()], [localization.GetByLabel('UI/Common/Cancel'), self.Cancel, ()]] bottom = uiprimitives.Container(parent=self.editModeContent, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 40)) btns = uicontrols.ButtonGroup(btns=btns, subalign=uiconst.CENTERRIGHT, parent=bottom, line=False, alwaysLite=True) self.costText = CaptionAndSubtext(parent=bottom, align=uiconst.TOPLEFT, top=13, caption=localization.GetByLabel('UI/Common/Cost'), subtext='')
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.cycling = False self.cyclingThread = None self.numCellRows = attributes.get('numCellRows', 5) maxCellsPerRow = attributes.get('maxCellsPerRow', 5) cellForegroundColor = attributes.get('cellForegroundColor', None) cellBackgroundColor = attributes.get('cellBackgroundColor', None) self.cellHeight = attributes.get('cellHeight', 20) self.cellWidth = attributes.get('cellWidth', 20) self.cellTextSize = attributes.get('cellTextSize', 16) self.cellsPerRow = attributes.get('cellsPerRow', 5) self.deadCells = [] self.liveCells = [] self.doneCells = [] self.cellGlyphs = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'] self.cellRows = [] self.cellRowContainers = [] self.cellPaddingVertical = 0 self.cellPaddingHorizontal = 0 if cellForegroundColor is None: cellForegroundColor = (0.75, 0.0, 0.0, 0.75) if cellBackgroundColor is None: cellBackgroundColor = (0.5, 0.5, 0.5, 0.25) self.cellBackgroundColor = cellBackgroundColor self.progressColor = cellForegroundColor self.doneColor = (0.0, 0.5, 0.0, 0.5) self.flashColor = (0.75, 0.75, 0.75, 0.75) uicontrols.Frame(parent=self, color=(0.7, 0.7, 0.7, 0.5), idx=0) for x in xrange(0, self.numCellRows): newRow = [] newRowContainer = uiprimitives.Container(parent=self, name='hackingCellRow', align=uiconst.TOTOP, state=uiconst.UI_DISABLED, pos=(0, 0, self.width, self.cellHeight)) for y in xrange(0, self.cellsPerRow): newRow.append(self.CreateCell(newRowContainer, self.cellHeight, self.cellWidth, cellBackgroundColor, cellForegroundColor)) self.cellRows.append(newRow) self.cellRowContainers.append(newRowContainer) self.cellRowSemaphore = uthread.Semaphore()
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) text = attributes.get('text', '') self.pointDirections = attributes.get('pointDirections', (0, 0, 0)) self.arrowPositionModifier = attributes.get('arrowPositionModifier', 0) pointUp, pointDown, pointLeft = self.pointDirections self.innerCont = uiprimitives.Container(parent=self, align=uiconst.TOALL, name='innerCont') self.blinkSprite = uiprimitives.Sprite(bgParent=self.innerCont, name='blinkSprite', texturePath='res:/UI/Texture/classes/Neocom/buttonDown.png', state=uiconst.UI_DISABLED) bgColor = (0.0, 0.0, 0.0, 0.8) backgroundFill = uiprimitives.Fill(name='UIPointerImg', bgParent=self.innerCont, color=bgColor) self.arrowSprite = uiprimitives.Sprite(name='arrow', parent=self, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, color=bgColor) maxTextWidth = UIPOINTER_WIDTH - 23 self.pointerLabel = uicontrols.EveCaptionSmall(text=text, parent=self.innerCont, align=uiconst.CENTER, width=maxTextWidth, state=uiconst.UI_DISABLED, idx=0) if self.pointerLabel.textwidth < maxTextWidth: self.pointerLabel.left = (maxTextWidth - self.pointerLabel.textwidth) / 2 self.headerButtons = uiprimitives.Container(name='headerButtons', state=uiconst.UI_PICKCHILDREN, align=uiconst.TOPRIGHT, parent=self.innerCont, pos=(5, 0, 15, 15), idx=0, display=False) uicls.ImageButton(name='close', parent=self.headerButtons, align=uiconst.TOPRIGHT, state=uiconst.UI_NORMAL, pos=(0, 0, 16, 16), idleIcon='ui_38_16_220', mouseoverIcon='ui_38_16_220', mousedownIcon='ui_38_16_220', onclick=lambda : getattr(self, 'OnClosePointer')(), expandonleft=True, hint=localization.GetByLabel('UI/Common/Buttons/Close')) self.headerButtons.Hide()
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.scope = 'all' self.SetCaption(localization.GetByLabel('UI/Fleet/FleetComposition/FleetComposition')) self.SetMinSize([390, 200]) self.SetWndIcon() self.SetTopparentHeight(0) self.sr.main.left = self.sr.main.width = self.sr.main.top = self.sr.main.height = const.defaultPadding self.sr.top = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, height=34) self.sr.bottom = uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0)) refreshButtCont = uiprimitives.Container(name='refreshButtCont', parent=self.sr.top, align=uiconst.TORIGHT, width=80) uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetComposition/FleetCompositionHelp'), parent=self.sr.top, align=uiconst.TOALL, left=3) self.counterLabel = uicontrols.EveLabelMedium(text='', parent=self.sr.bottom, align=uiconst.TOBOTTOM, padRight=4, padTop=4) self.sr.refreshBtn = uicontrols.Button(parent=refreshButtCont, label=localization.GetByLabel('UI/Commands/Refresh'), left=2, func=self.RefreshClick, align=uiconst.TOPRIGHT) self.sr.scrollBroadcasts = uicontrols.Scroll(name='scrollComposition', parent=self.sr.bottom) self.sr.scrollBroadcasts.OnSelectionChange = self.OnScrollSelectionChange self.LoadComposition() uicore.registry.SetFocus(self.sr.scrollBroadcasts)
def Load(self, args): toparea = sm.GetService('corpui').LoadTop( 'res:/ui/Texture/WindowIcons/corporationmembers.png', localization.GetByLabel( 'UI/Corporations/BaseCorporationUI/MemberList'), localization.GetByLabel('UI/Corporations/Common/UpdateDelay')) if not self.sr.Get('inited', 0): self.sr.inited = 1 toppar = uiprimitives.Container(name='options', parent=self, align=uiconst.TOTOP, height=18, top=10) viewOptionsList2 = [(localization.GetByLabel('UI/Common/All'), None)] self.sr.roleGroupings = sm.GetService('corp').GetRoleGroupings() for grp in self.sr.roleGroupings.itervalues(): if grp.roleGroupID in (1, 2): for c in grp.columns: role = c[1][0][1] viewOptionsList2.append( [role.shortDescription, role.roleID]) i = 0 self.sr.fltRole = uicontrols.Combo( label=localization.GetByLabel('UI/Corporations/Common/Role'), parent=toppar, options=viewOptionsList2, name='rolegroup', callback=self.OnFilterChange, width=146, pos=(5, 0, 0, 0)) i += 1 self.sr.fltOnline = c = uicontrols.Checkbox( text=localization.GetByLabel( 'UI/Corporations/CorporationWindow/Members/Tracking/OnlineOnly' ), parent=toppar, configName='online', retval=1, checked=0, align=uiconst.TOPLEFT, callback=self.OnFilterChange, pos=(self.sr.fltRole.width + 16, 0, 250, 0)) self.quickFilter = QuickFilterEdit(name='filterMembers', parent=toppar, align=uiconst.TORIGHT, left=4) self.quickFilter.ReloadFunction = lambda: self.ShowMemberTracking() memberIDs = sm.GetService('corp').GetMemberIDs() cfg.eveowners.Prime(memberIDs) self.sr.scroll = uicontrols.Scroll( name='member_tracking', parent=self, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.ShowMemberTracking()
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.alertText = None self.fullScreen = uiprimitives.Container(name='shipAlerts', parent=uicore.layer.inflight, align=uiconst.TOALL, state=uiconst.UI_DISABLED) self.labelCont = uiprimitives.Container(name='fakeTextCont', parent=self, align=uiconst.CENTER, state=uiconst.UI_DISABLED, width=400) self.warningLabelCont = uiprimitives.Container(name='warningLabelCont', parent=self.labelCont, align=uiconst.TOBOTTOM, height=40, top=100) self.warningLabel = uicontrols.EveCaptionLarge( name='warningLabel', parent=self.warningLabelCont, align=uiconst.CENTER, bold=True, color=(1, 1, 1, 1.0), idx=0) self.warningLabel.uppercase = True self.warningLabel.opacity = 0.0 self.exceptionLabel = uicontrols.Label( name='fakeException', parent=self.labelCont, align=uiconst.TOBOTTOM, fontsize=fontConst.EVE_SMALL_FONTSIZE, color=(1, 0, 0, 0.4)) self.damageElements = self.AddSideElements() self.oldDamageState = [1, 1, 1, 1, 1] self.alertStartTimes = [None, None, None, None, None] self.isActuallyDamaged = [False, False, False, False, False] self.lastRTPCLevels = [None, None, None, None, None] self.animMethods = [ self.DoShieldAnimation, self.DoArmorAnimation, self.DoHullAnimation ] self.animDuration = 2.0 self.UpdatePosition() sm.RegisterNotify(self) self.enteringCapsule = False
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) itemID = attributes.itemID typeID = attributes.typeID self.itemID = itemID self.typeID = typeID self.stateManager = sm.GetService('godma').GetStateManager() self.SetCaption('Attribute Inspector') self.SetWndIcon(None) self.SetTopparentHeight(0) main = uiprimitives.Container( name='main', parent=uiutil.GetChild(self, 'main'), pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) top = uiprimitives.Container(name='top', parent=main, height=20, align=uiconst.TOTOP) btn = uicontrols.Button(parent=top, label='Refresh', align=uiconst.TORIGHT, func=self.Refresh) def _OnChange(text): ntext = filter('0123456789'.__contains__, text) if ntext != text: self.input.SetValue(ntext) self.input = uicontrols.SinglelineEdit(name='itemID', parent=top, width=-1, height=-1, align=uiconst.TOALL) self.input.readonly = not eve.session.role & ROLE_GMH self.input.OnReturn = self.Refresh self.input.OnChange = _OnChange self.input.SetValue(str(self.itemID)) uiprimitives.Container(name='div', parent=main, height=5, align=uiconst.TOTOP) self.scroll = uicontrols.Scroll(parent=main) self.Refresh()
def setup_layout(self): self.SetTopparentHeight(0) main = self.GetMainArea() main.padding = 5 main_container = uiprimitives.Container(parent=main) text_container = uiprimitives.Container(parent=main_container, height=120, width=250, align=uiconst.TOPRIGHT) uicontrols.EditPlainTextCore( parent=text_container, readonly=True, height=128, setvalue=localization.GetByLabel( 'UI/ProjectDiscovery/IntroductionText')) avatar_container = uiprimitives.Container(parent=main_container, height=128, width=128, align=uiconst.TOPLEFT) uiprimitives.Sprite(parent=avatar_container, name='SOE_Logo', align=uiconst.TOTOP, height=128, texturePath='res:/ui/texture/corps/14_128_1.png', ignoreSize=True) bottom_container = uiprimitives.Container(parent=main_container, height=35, align=uiconst.TOBOTTOM) self.close_button = uicontrols.Button( parent=bottom_container, label=localization.GetByLabel( 'UI/ProjectDiscovery/IntroductionTextContinueButton'), align=uiconst.CENTER, padLeft=20, fixedwidth=100, fixedheight=25, func=lambda x: self.continue_and_check_preference()) self.checkbox = uicontrols.Checkbox(parent=bottom_container, align=uiconst.CENTERLEFT, padLeft=10) self.checkbox.SetLabelText( localization.GetByLabel( 'UI/ProjectDiscovery/IntroductionScreenCheckboxText')) self.checkbox.SetSize(140, 20)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self._fixedFromProportion = None self._fixedToProportion = None self._minRange = None rangeParent = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=attributes.barHeight or 9, padding=(MAINSIDEMARGIN, 8, MAINSIDEMARGIN, 0), state=uiconst.UI_NORMAL) rangeParent.OnMouseDown = (self.StartMoveRange, rangeParent) rangeParent.OnMouseUp = (self.StopMoveRange, rangeParent) rangeParent.OnMouseMove = (self.MoveRange, rangeParent) for name in ('from', 'to'): parent = uiprimitives.Container(parent=rangeParent) rangeContainer = SizeCappedContainer(parent=parent, align=uiconst.TOLEFT_PROP) rangeContainer._background = FillThemeColored(bgParent=rangeContainer, opacity=0.8) rangeContainer._pointer = SpriteThemeColored(parent=rangeContainer, align=uiconst.TOPRIGHT, pos=(-8, -7, 16, 16)) setattr(self, '_' + name + 'Range', rangeContainer) configName = '_' + name + 'Handle' handle = uiprimitives.Container(parent=self, name=configName, align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL, pos=(0, 0, MAINSIDEMARGIN * 2, 32), idx=0) handle.OnMouseDown = (self.StartMoveHandle, handle) handle.OnMouseUp = (self.StopMoveHandle, handle) handle.OnMouseMove = (self.MoveHandle, handle) setattr(self, configName, handle) self._background = FillThemeColored(bgParent=rangeParent, opacity=0.8) self._incrementsParent = uiprimitives.Container(parent=self, align=uiconst.TOTOP, height=16, padding=(MAINSIDEMARGIN, 2, MAINSIDEMARGIN, 0), name='_incrementsParent') self._increments = None self._callbackData = None self._fromProportion = attributes.fromProportion or 0.0 self._toProportion = attributes.toProportion or 1.0 self._canInvert = bool(attributes.canInvert) self.height = 48 self.UpdateRanges() self.UpdateHandles() self.OnIncrementChange = attributes.OnIncrementChange self.OnChange = attributes.OnChange self.OnEndDragChange = attributes.OnEndDragChange
def LoadView(self, change=None, **kwargs): """ Called when the view is loaded """ self.activeShip = None self.activeshipmodel = None self.hangarScene = None self.stationID = None self.loadingBackground = uiprimitives.Container( name='loadingBackground', bgColor=util.Color.BLACK, state=uiconst.UI_HIDDEN) height = uicore.desktop.height width = 1.6 * height uiprimitives.Sprite( name='aura', parent=self.loadingBackground, texturePath= 'res:/UI/Texture/Classes/CQLoadingScreen/IncarnaDisabled.png', align=uiconst.CENTER, width=width, height=height) self.loadingBackground.Show() self.loadingBackground.opacity = 1.0 oldWorldSpaceID = newWorldSpaceID = session.worldspaceid if 'worldspaceid' in change: oldWorldSpaceID, newWorldSpaceID = change['worldspaceid'] changes = change.copy() if 'stationid' not in changes: changes['stationid'] = (None, newWorldSpaceID) factory = sm.GetService('paperDollClient').dollFactory factory.compressTextures = True factory.allowTextureCache = True clothSimulation = sm.GetService('device').GetAppFeatureState( 'Interior.clothSimulation', False) factory.clothSimulationActive = clothSimulation scene = self.entityClient.LoadEntitySceneAndBlock(newWorldSpaceID) scene.WaitOnStartupEntities() if self.entityClient.IsClientSideOnly(newWorldSpaceID): if self.cachedPlayerPos is None or self.cachedPlayerRot is None: self.entitySpawnClient.SpawnClientOnlyPlayer(scene, changes) else: self.clientOnlyPlayerSpawnClient.SpawnClientSidePlayer( scene, self.cachedPlayerPos, self.cachedPlayerRot) if self.cachedCameraYaw is not None and self.cachedCameraPitch is not None and self.cachedCameraZoom is not None: self.cameraClient.RegisterCameraStartupInfo( self.cachedCameraYaw, self.cachedCameraPitch, self.cachedCameraZoom) self.cachedPlayerPos = None self.cachedPlayerRot = None self.cachedPlayerYaw = None self.cachedPlayerPitch = None self.cachedPlayerZoom = None self.loading.ProgressWnd() self.loadingBackground.Hide() self.loadingBackground.Flush()
def Load(self, args): if not self.sr.Get('inited', False): self.sr.inited = 1 btns = None self.toolbarContainer = uiprimitives.Container( name='toolbarContainer', align=uiconst.TOBOTTOM, parent=self) if btns is not None: self.toolbarContainer.height = btns.height else: self.toolbarContainer.state = uiconst.UI_HIDDEN self.sr.contacts = form.ContactsForm(name='corpcontactsform', parent=self, pos=(0, 0, 0, 0)) self.sr.contacts.Setup('corpcontact') self.sr.scroll = uicontrols.Scroll( name='standings', parent=self, padding=(const.defaultPadding, const.defaultPadding, const.defaultPadding, const.defaultPadding)) self.sr.tabs = uicontrols.TabGroup(name='tabparent', parent=self, idx=0) self.sr.tabs.Startup([ [ localization.GetByLabel( 'UI/Corporations/CorporationWindow/Standings/CorpContacts' ), self.sr.contacts, self, 'corpcontact' ], [ localization.GetByLabel( 'UI/Corporations/CorporationWindow/Standings/LikedBy'), self.sr.scroll, self, 'mystandings_to_positive' ], [ localization.GetByLabel( 'UI/Corporations/CorporationWindow/Standings/DislikedBy' ), self.sr.scroll, self, 'mystandings_to_negative' ] ], 'corporationstandings', autoselecttab=1) return sm.GetService('corpui').LoadTop( 'res:/ui/Texture/WindowIcons/corporationstandings.png', localization.GetByLabel( 'UI/Corporations/CorporationWindow/Standings/CorpStandings')) self.SetHint() if type(args) == types.StringType and args.startswith('mystandings_'): self.sr.standingtype = args if args == 'mystandings_to_positive': positive = True else: positive = False self.ShowStandings(positive) else: self.sr.contacts.LoadContactsForm('corpcontact')
def ApplyAttributes(self, attributes): uiprimitives.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 = uiprimitives.Container(name='content', parent=self, padding=3) self.text = uicontrols.EveHeaderSmall( name='buttonLabel', parent=cont, color=self.data.color.GetRGBA(), text=localization.GetByLabel(self.data.buttonText), align=uiconst.CENTER, opacity=DESELECTED_BUTTON_OPACITY, bold=True) self.defaultSprite = uiprimitives.Sprite( parent=self, name='default', texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Default.png', align=uiconst.TOALL, state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=DESELECTED_BUTTON_OPACITY) self.highlightSprite = uiprimitives.Sprite( parent=self, name='highlight', texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Highlight.png', align=uiconst.TOALL, state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA()) self.highlightSprite.Hide() self.leftArrowSprite = uiprimitives.Sprite( parent=self, name='leftArrows', texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png', align=uiconst.CENTERLEFT, pos=(-24, 0, 16, 13), state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=0.0) self.rightArrows = uiprimitives.Transform(parent=self, name='rightArrowsTranform', align=uiconst.CENTERRIGHT, pos=(-24, 0, 16, 13), state=uiconst.UI_DISABLED, rotation=pi) self.rightArrowSprite = uiprimitives.Sprite( parent=self.rightArrows, name='rightArrows', texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png', align=uiconst.CENTERRIGHT, pos=(0, 0, 16, 13), state=uiconst.UI_DISABLED, color=self.data.color.GetRGBA(), opacity=0.0)