def ApplyAttributes(self, attributes): uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes) self.sr.contractParent = uiprimitives.Container( parent=self, name='contractParent', align=uiconst.TOLEFT, state=uiconst.UI_PICKCHILDREN, padTop=2) self.sr.contractIconParent = uiprimitives.Container( parent=self.sr.contractParent, name='contractIconParent', align=uiconst.TOLEFT, width=self.iconSize + 5) self.sr.techIcon = uicontrols.Icon(parent=self.sr.contractIconParent, pos=(2, 2, 16, 16), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) self.sr.icon = uicontrols.Icon(parent=self.sr.contractIconParent, pos=(2, 2, 32, 32), ignoreSize=True, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED) subPar = uiprimitives.Container(parent=self.sr.contractParent, name='contractLabelClipper', state=uiconst.UI_DISABLED, align=uiconst.TOALL, clipChildren=True, padLeft=2) self.sr.contractLabel = uicontrols.EveLabelMedium( parent=subPar, left=self.labelMargin, align=uiconst.TOTOP, padRight=const.defaultPadding)
def Startup(self, *etc): self.sr.infoIcon = uicontrols.Icon(hint=localization.GetByLabel('UI/Common/ShowInfo'), parent=self, name='infoIcon', icon='ui_38_16_208', size=16) self.sr.icon = uicontrols.Icon(parent=self, name='icon', size=96, top=40) self.sr.upgradeLevelHeader = uicontrols.EveHeaderLarge(parent=self, name='upgradeLevelHeader', state=uiconst.UI_DISABLED, text=localization.GetByLabel('UI/Station/StationManagment/OutpostUpgradeLevel'), bold=True, left=20, top=10) self.sr.upgradeLevelLabel = uicontrols.Label(parent=self, name='upgradeLevelLabel', state=uiconst.UI_DISABLED, text=localization.GetByLabel('UI/Station/StationManagment/OutpostUpgradeLevel'), bold=True, fontsize=60, top=25) self.sr.trunk = uiprimitives.Fill(parent=self, align=uiconst.RELATIVE, name='trunk') self.sr.trunk.width = ImprovementsMetrics.trunkThickness self.sr.trunk.color.a = ImprovementsMetrics.lineAlpha
def Startup(self): self.state = uiconst.UI_NORMAL self.shouldKill = False sub = uiprimitives.Container(name='sub', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_DISABLED) uicontrols.Frame(parent=self) uiprimitives.Fill(parent=self, color=(0, 0, 0, 1), idx=-1, state=uiconst.UI_DISABLED) closex = uicontrols.Icon(icon='ui_38_16_220', parent=self, idx=0, state=uiconst.UI_NORMAL, align=uiconst.TOPRIGHT) closex.OnClick = self.CloseNotification closex.sr.hint = localization.GetByLabel('UI/Common/CloseNotification') iconCont = uiprimitives.Container(name='iconCont', parent=sub, align=uiconst.TOLEFT, pos=(0, 0, 60, 0)) textCont = uiprimitives.Container(name='textCont', parent=sub, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_NORMAL) self.sr.icon = uicontrols.Icon(parent=iconCont, icon='50_11', pos=(-2, 2, 64, 64), align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED) self.sr.headerText = uicontrols.EveLabelSmall( text='', parent=textCont, padTop=12, align=uiconst.TOTOP, state=uiconst.UI_DISABLED, bold=True) self.sr.text1 = uicontrols.EveLabelMedium(text='', parent=textCont, state=uiconst.UI_DISABLED, align=uiconst.TOTOP, padding=(0, -2, 4, 0)) self.sr.text2 = uicontrols.EveLabelMedium(text='', parent=textCont, state=uiconst.UI_HIDDEN, align=uiconst.TOTOP, padding=(0, -2, 4, 0)) self.sr.text3 = uicontrols.EveLabelMedium(text='', parent=textCont, state=uiconst.UI_HIDDEN, align=uiconst.TOTOP, padding=(0, -2, 4, 0))
def Startup(self, *args): listentry.Generic.Startup(self, *args) props = {'parent': self, 'align': uiconst.CENTERRIGHT, 'idx': 0} pos = (18, 0, 0, 0) eye = uicontrols.Icon(icon='ui_38_16_110', pos=pos, name='eye', hint=localization.GetByLabel('UI/Map/MapPallet/hintShow'), **props) eye.OnClick = self.ToggleVisibility self.sr.eyeoff = uicontrols.Icon(icon='ui_38_16_111', pos=pos, **props) hint = uicontrols.Icon(icon='ui_38_16_109', name='hint', hint=localization.GetByLabel('UI/Map/MapPallet/hintShowHint'), **props) hint.OnClick = self.ToggleBubbleHint self.sr.hintoff = uicontrols.Icon(icon='ui_38_16_111', **props)
def LoadTypeIcon(self, *args): attrs = self.attrs src = attrs.src typeID = None try: typeID = int(src[9:]) except: log.LogInfo("couldn't convert string to typeID, looking up constvalue, Img::Load", src) typeID = util.LookupConstValue('type%s' % attrs.src[9:].strip().capitalize(), None) bumped = getattr(attrs, 'bumped', 0) showFitting = getattr(attrs, 'showfitting', 0) showTechLevel = getattr(attrs, 'showtechlevel', 0) isCopy = getattr(attrs, 'iscopy', 0) if not typeID: kw = htmlwriter.PythonizeArgs(src[9:]) typeID = kw.get('typeID', None) bumped = kw.get('bumped', 0) isCopy = kw.get('isCopy', 0) showFitting = kw.get('showFitting', 0) showTechLevel = kw.get('showTechLevel', 0) if typeID: if bumped: if hasattr(self, 'icon') and self.icon: self.icon.Close() self.icon = DraggableIcon(parent=self, typeID=typeID, isCopy=True if isCopy == 1 else False, state=uiconst.UI_DISABLED) if showFitting: powerEffect = None powerIcon = None powerEffects = [const.effectHiPower, const.effectMedPower, const.effectLoPower] for effect in cfg.dgmtypeeffects.get(typeID, []): if effect.effectID in powerEffects: powerEffect = cfg.dgmeffects.Get(effect.effectID, None) powerIcon = {const.effectHiPower: 11, const.effectMedPower: 10, const.effectLoPower: 9}.get(powerEffect.effectID, None) break if powerIcon: c = uiprimitives.Container(name='powericon', align=uiconst.BOTTOMRIGHT, parent=self.icon, width=attrs.width / 4, height=attrs.width / 4, idx=0) uiprimitives.Line(parent=c, align=uiconst.TOLEFT, color=(1.0, 1.0, 1.0, 0.5)) uiprimitives.Line(parent=c, align=uiconst.TOTOP, color=(1.0, 1.0, 1.0, 0.5)) uiprimitives.Fill(parent=c, padRight=2, padBottom=2, color=(0.0, 0.0, 0.0, 1.0)) pwrIcon = uicontrols.Icon(icon='ui_8_64_%s' % powerIcon, parent=c, align=uiconst.TOALL, idx=0, hint=localization.GetByLabel('UI/Common/FitsToSlot', slotType=powerEffect.displayName), ignoreSize=True) if showTechLevel: techSprite = uix.GetTechLevelIcon(None, 0, typeID) if techSprite: c = uiprimitives.Container(name='techIcon', align=uiconst.TOPLEFT, parent=self.icon, width=16, height=16, idx=0) c.children.append(techSprite) else: uicontrols.Icon(parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED, pos=(0, 0, 0, 0), typeID=typeID, size=attrs.width, isCopy=isCopy) else: log.LogInfo('Couldnt convert', attrs.src[9:], 'to typeID')
def AssureInited(self, data): if self.sr.Get('icons', False): return self.sr.icons = [] im = ImprovementsMetrics for blah in data.improvements: uiprimitives.Container(parent=self, align=uiconst.TOLEFT, width=im.iconMargin, name='blank', state=uiconst.UI_DISABLED) icon = uiprimitives.Container(parent=self, name='iconParent', align=uiconst.TOLEFT, width=im.iconSize) icon.sr.tier = uicontrols.Icon(parent=icon, name='tier', icon='ui_38_16_161', size=16, align=uiconst.TOPRIGHT, left=2, top=-2) icon.sr.icon = uicontrols.Icon(parent=icon, name='icon', align=uiconst.TOALL, hint=localization.GetByLabel('UI/Common/ShowInfo'), state=uiconst.UI_NORMAL) self.sr.icons.append(icon) self.children[0].width = im.LeftMargin(len(self.sr.icons))
def ApplyAttributes(self, attributes): FittingSlotBase.ApplyAttributes(self, attributes) self.flagIcon = uicontrols.Icon(parent=self, name='flagIcon', align=uiconst.CENTER, state=uiconst.UI_DISABLED, width=self.width, height=self.height) self.sr.underlay = Sprite( bgParent=self, name='underlay', state=uiconst.UI_DISABLED, padding=(-10, -5, -10, -5), texturePath='res:/UI/Texture/Icons/81_64_1.png') self.dontHaveLine = None self.moduleSlotFill = None self.skillSprite = None self.groupMark = None self.chargeIndicator = None sm.RegisterNotify(self) self.radCosSin = attributes.radCosSin self.invReady = 1 self.UpdateFitting() self.controller.on_simulation_mode_changed.connect( self.UpdateSimulationMode)
def ApplyAttributes(self, attributes): BaseCharacterCreationStep.ApplyAttributes(self, attributes) self.isSerenity = boot.region == 'optic' self.namesChecked = {} self.schoolInfo = {} self.ancestryInfo = {} self.ancestryConts = {} self.schoolConts = {} self.checkingName = 0 self.startAncestryHeight = 180 self.startEducationHeight = 180 self.padValue = 16 self.SetupAncestrySection() self.SetupEducationSection() self.SetupNameSection() self.sr.portraitCont = uiprimitives.Container(name='portraitCont', parent=self.sr.leftSide, align=uiconst.CENTERTOP, pos=(0, 128, 128, 128)) uicontrols.Frame(parent=self.sr.portraitCont, color=ccConst.COLOR + (0.3, )) self.sr.facePortrait = uicontrols.Icon(parent=self.sr.portraitCont, idx=1, align=uiconst.TOALL) photo = uicore.layer.charactercreation.GetActivePortrait() if photo is not None: self.sr.facePortrait.texture.atlasTexture = photo self.sr.facePortrait.texture.atlasTexture.Reload() self.UpdateLayout()
def Load(self, data): iconsize = 48 self.factionParent.Flush() if data.factionID: owner = cfg.eveowners.Get(data.factionID) uiutil.GetLogoIcon(parent=self.factionParent, align=uiconst.RELATIVE, size=64, itemID=data.factionID, ignoreSize=True, hint=localization.GetByLabel('UI/Incursion/Journal/FactionStagingRuler', faction=owner.ownerName)) else: uicontrols.Icon(parent=self.factionParent, size=64, icon='ui_94_64_16', ignoreSize=True, hint=localization.GetByLabel('UI/Incursion/Journal/StagingSystemUnclaimed'), align=uiconst.RELATIVE) rowHeader = localization.GetByLabel('UI/Incursion/Journal/ReportRowHeader', constellation=data.constellationID, constellationInfo=('showinfo', const.typeConstellation, data.constellationID)) self.constellationLabel.SetText(rowHeader) incursionStateMessages = [localization.GetByLabel('UI/Incursion/Journal/Withdrawing'), localization.GetByLabel('UI/Incursion/Journal/Mobilizing'), localization.GetByLabel('UI/Incursion/Journal/Established')] self.statusText.SetText(incursionStateMessages[data.state]) if data.jumps is not None: distanceAwayText = localization.GetByLabel('UI/Incursion/Journal/ReportRowNumJumps', jumps=data.jumps) else: distanceAwayText = localization.GetByLabel('UI/Incursion/Journal/ReportRowSystemUnreachable') bodyText = localization.GetByLabel('UI/Incursion/Journal/ReportRowBody', color='<color=' + sm.GetService('map').GetSystemColorString(data.stagingSolarSystemID) + '>', security=data.security, securityColor=sm.GetService('map').GetSystemColorString(data.stagingSolarSystemID), system=data.stagingSolarSystemID, systemInfo=('showinfo', const.typeSolarSystem, data.stagingSolarSystemID), distanceAway=distanceAwayText) self.stagingText.SetText(bodyText) self.statusBar.SetInfluence(taleCommon.CalculateDecayedInfluence(data.influenceData), None, animate=False) self.bossIcon.SetBossSpawned(data.hasBoss) self.corpMapButton.OnClick = lambda : sm.GetService('viewState').ActivateView('starmap', interestID=data.constellationID, starColorMode=STARMODE_FRIENDS_CORP) self.mapButton.OnClick = lambda : sm.GetService('viewState').ActivateView('starmap', interestID=data.constellationID, starColorMode=STARMODE_INCURSION) self.autopilotButton.OnClick = lambda : sm.GetService('starmap').SetWaypoint(data.stagingSolarSystemID, clearOtherWaypoints=True) self.lpButton.OnClick = lambda : sm.GetService('journal').ShowIncursionTab(flag=IncursionTab.LPLog, taleID=data.taleID, constellationID=data.constellationID) self.loyaltyPoints.number.SetText(localization.GetByLabel('UI/Incursion/Journal/NumberLoyaltyPointsAcronym', points=util.FmtAmt(data.loyaltyPoints)))
def ApplyAttributes(self, attributes): attributes.parent = uicore.layer.sidePanels uicontrols.Window.ApplyAttributes(self, attributes) locationID = attributes.locationID self.Reset_() self.scope = 'station_inflight' self.MakeUnMinimizable() self.SetWndIcon() self.SetTopparentHeight(0) self.HideHeader() self.MakeUnResizeable() closeX = uicontrols.Icon(parent=self.sr.main, icon='ui_38_16_220', align=uiconst.TOPRIGHT, top=-1, idx=0) closeX.OnClick = self.CloseByUser closeX.hint = localization.GetByLabel( 'UI/Map/MapBrowser/CloseMapBrowser') self.isDockWnd = 0 from eve.client.script.ui.shared.maps.browser import MapBrowser self.sr.browser = MapBrowser(name='browserX', parent=self.sr.main, pos=(3, 0, 3, 0)) self.sr.browser.GetMenu = self.GetMenu self.initLocationID = locationID
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) self.tokenSize = attributes.get('tokenSize', self.default_tokenSize) self.closeCallback = attributes.get('closeCallback', None) self.textColor = attributes.get('textColor', redeemColors.TEXT_COLOR) self.padLeft = attributes.get('itemPadding', self.default_itemPadding) self.padRight = attributes.get('itemPadding', self.default_itemPadding) self.minimized = attributes.get('minimized', False) self.redeemTokenData = attributes.redeemTokenData self.isDragObject = attributes.dragEnabled self.typeID = self.redeemTokenData.typeID quantity = self.redeemTokenData.quantity portionSize = self.redeemTokenData.portionSize totalQuantity = quantity * portionSize self.desc = attributes.desc self.expireDateTime = self.redeemTokenData.expireDateTime self.width = self.tokenSize self.height = self.GetTokenHeight() self.itemCont = Container(parent=self, name='itemCont', align=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN, height=self.tokenSize, width=self.tokenSize, padTop=REDEEM_TOKEN_TOP_PADDING) self.iconCont = Container(parent=self.itemCont, name='iconCont', align=uiconst.TOTOP, state=uiconst.UI_DISABLED, width=self.tokenSize, height=self.tokenSize) if not self.minimized: self.CreateAdditionalInformation() self.highlightOverlay = uiprimitives.Sprite(name='hilite', align=uiconst.TOALL, state=uiconst.UI_DISABLED, parent=self.iconCont, texturePath='res:/UI/Texture/classes/InvItem/bgHover.png', blendMode=trinity.TR2_SBM_ADD, opacity=0.0, idx=0) uiprimitives.Sprite(bgParent=self.iconCont, name='background', texturePath='res:/UI/Texture/classes/InvItem/bgNormal.png') self.icon = uicontrols.Icon(parent=self.iconCont, name='icon', align=uiconst.CENTER, state=uiconst.UI_DISABLED, typeID=self.typeID, size=self.tokenSize) self.quantityContainer = Container(parent=self.iconCont, name='quantityContainer', idx=0, pos=(0, 53, 32, 11), align=uiconst.TOPRIGHT, state=uiconst.UI_DISABLED, bgColor=(0, 0, 0, 0.95)) self.quantityLabel = uicontrols.Label(parent=self.quantityContainer, left=2, maxLines=1, fontsize=9, color=self.textColor, text=totalQuantity) self.isNew = False self.tooltipPanelClassInfo = TooltipHeaderDescriptionWrapper(header=self.redeemTokenData.typeName, description=self.GenerateHintText()) self.scale = (0.0, 0.0)
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 _DrawStoredCommoditiesIcons(self): self.iconCont.Flush() i = 0 maxNumIcons = 8 if self.pin.contents: for typeID, amount in self.pin.contents.iteritems(): iconLeft, iconTop = self._GetIconPos(i) icon = uicontrols.Icon( parent=self.iconCont, pos=(iconLeft, iconTop, 25, 25), hint=localization.GetByLabel( 'UI/PI/Common/ItemAmount', itemName=cfg.invtypes.Get(typeID).name, amount=int(amount)), typeID=typeID, size=32, ignoreSize=True) i += 1 if i >= maxNumIcons: break self.itemsTxt.SetSubtext('') else: self.itemsTxt.SetSubtext( localization.GetByLabel('UI/PI/Common/NothingStored'))
def OnSpeakingEvent_Local(self, data): if self.destroyed: return caption = localization.GetByLabel( 'UI/Fleet/FleetBroadcast/BroadcastEventSpeaking', charID=data.charID, channelName=data.channelName) iconName = '73_35' roleIcon = fleetbr.GetRoleIconFromCharID(data.charID) uix.Flush(self.sr.lastVoiceEventCont) t = uicontrols.EveLabelMedium(text=caption, parent=self.sr.lastVoiceEventCont, align=uiconst.TOALL, left=25, maxLines=1) lt = t lt.GetMenu = lambda: fleetbr.GetVoiceMenu(None, data.charID, data. channelID) lt.hint = localization.GetByLabel( 'UI/Fleet/FleetBroadcast/VoiceBroadcastReceivedAt', time=data.time) icon = uicontrols.Icon(align=uiconst.RELATIVE, left=6, top=0, icon=iconName, width=16, height=16) icon.state = uiconst.UI_DISABLED self.sr.lastVoiceEventCont.children.append(icon)
def OnFleetBroadcast_Local(self, broadcast): caption = broadcast.broadcastLabel iconName = fleetbr.defaultIcon[1] t = fleetbr.types.get(broadcast.name, None) if t: iconName = t['smallIcon'] self.sr.lastBroadcastCont.Flush() uicontrols.EveLabelMedium(text=caption, parent=self.sr.lastBroadcastCont, align=uiconst.TOALL, left=25, maxLines=1, state=uiconst.UI_DISABLED) self.sr.lastBroadcastCont.GetMenu = lambda: self.GetLastBroadcastMenu( broadcast) self.sr.lastBroadcastCont.OnClick = lambda: self.OnLastBroadcastClick( broadcast) self.sr.lastBroadcastCont.hint = localization.GetByLabel( 'UI/Fleet/FleetBroadcast/BroadcastNotificationHint', eventLabel=broadcast.broadcastLabel, time=broadcast.time, charID=broadcast.charID, range=fleetbr.GetBroadcastScopeName(broadcast.scope, broadcast.where), role=fleetbr.GetRankName( sm.GetService('fleet').GetMemberInfo(int(broadcast.charID)))) icon = uicontrols.Icon(icon=iconName, parent=self.sr.lastBroadcastCont, align=uiconst.RELATIVE, pos=(6, 0, 16, 16), state=uiconst.UI_DISABLED) uthread.worker('fleet::flash', self.Flash, icon)
def ApplyAttributes(self, attributes): uicontrols.Window.ApplyAttributes(self, attributes) self.shipid = util.GetActiveShip() self.shipItem = self.GetShipItem() self.SetTopparentHeight(72) self.SetWndIcon() self.SetMinSize([300, 200]) self.sr.top = uiprimitives.Container(name='top', align=uiconst.TOTOP, parent=self.sr.topParent, pos=(const.defaultPadding, const.defaultPadding, const.defaultPadding, 64)) icon = uicontrols.Icon(parent=self.sr.top, align=uiconst.TOLEFT, left=const.defaultPadding, size=64, state=uiconst.UI_NORMAL, typeID=self.shipItem.typeID) icon.GetMenu = self.ShipMenu uiprimitives.Container(name='push', align=uiconst.TOLEFT, pos=(5, 0, 5, 0), parent=self.sr.top) uicontrols.EveHeaderMedium(name='label', text=cfg.evelocations.Get(self.shipItem.itemID).name, parent=self.sr.top, align=uiconst.TOTOP, bold=True, state=uiconst.UI_NORMAL) uicontrols.EveLabelMedium(name='label', text=evetypes.GetName(self.shipItem.typeID), parent=self.sr.top, align=uiconst.TOTOP, state=uiconst.UI_NORMAL) self.ship = moniker.GetShipAccess() self.conf = self.ship.GetShipConfiguration(self.shipid) modules = self.GetShipModules() for module in modules: self.sr.Set('%sPanel' % module.lower(), uiprimitives.Container(name=module, align=uiconst.TOALL, state=uiconst.UI_HIDDEN, parent=self.sr.main, pos=(0, 0, 0, 0))) tabs = [ [name, self.sr.Get('%sPanel' % module.lower(), None), self, module] for module, name in modules.iteritems() if self.sr.Get('%sPanel' % module.lower()) ] if tabs: self.sr.maintabs = uicontrols.TabGroup(name='tabparent', align=uiconst.TOTOP, height=18, parent=self.sr.main, idx=0, tabs=tabs, groupID='pospanel') else: uicontrols.CaptionLabel(text=localization.GetByLabel('UI/Ship/ShipConfig/ShipConfig'), parent=self.sr.main, size=18, uppercase=0, left=const.defaultPadding, width=const.defaultPadding, top=const.defaultPadding)
def UpdateActiveState(self): currentActive, currentDirection = self.GetCurrentActive() for each in self.headerContainer.children: if hasattr(each, 'columnID'): if each.columnID == currentActive: if not each.sortTriangle: each.sortTriangle = uicontrols.Icon(align=uiconst.CENTERRIGHT, pos=(3, -1, 16, 16), parent=each, name='directionIcon', idx=0) if self.customSortIcon: each.sortTriangle.LoadTexture(self.customSortIcon) elif currentDirection: each.sortTriangle.LoadIcon('ui_1_16_16') else: each.sortTriangle.LoadIcon('ui_1_16_15') each.sortTriangle.state = uiconst.UI_DISABLED each.fill.Show() rightMargin = 20 else: each.fill.Hide() if each.sortTriangle: each.sortTriangle.Hide() rightMargin = 6 each.label.width = each.width - each.label.left - 4 if each.sortTriangle and each.sortTriangle.display: each.label.SetRightAlphaFade(each.width - rightMargin - each.label.left, uiconst.SCROLL_COLUMN_FADEWIDTH) else: each.label.SetRightAlphaFade() if each.width <= 32 or each.width - each.label.left - rightMargin - 6 < each.label.textwidth: each.hint = each.label.text else: each.hint = None
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 AddLayout(self): pad = const.defaultPadding uicontrols.WndCaptionLabel(text=evetypes.GetGroupName(self.typeID), subcaption=localization.GetByLabel('UI/UpgradeWindow/TypeUpgradesTo', type1=self.typeID, type2=self.GetUpgradeTypeID()), parent=self.sr.topParent, align=uiconst.RELATIVE) uicontrols.Icon(parent=self.sr.topParent, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, pos=(0, 0, 64, 64), padding=(pad, pad, pad, pad), typeID=self.typeID) self.sr.footer = uiprimitives.Container(name='footer', parent=self.sr.main, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 25), padding=(pad, pad, pad, pad)) uiprimitives.Line(align=uiconst.TOBOTTOM, parent=self.sr.main) self.sr.iconContainer = uiprimitives.Container(name='iconContainer', parent=self.sr.main, align=uiconst.TOALL, padding=(pad + 5, pad + 5, 0, 0), columns=4) self.sr.iconContainer.OnDropData = self.OnDropData self.sr.iconContainer.OnDragEnter = self.OnDragEnter self.sr.iconContainer.OnDragExit = self.OnDragExit btns = [(localization.GetByLabel('UI/UpgradeWindow/StartUpgrade'), self.InitiateUpgrade, (), None)] self.buttons = btns = uicontrols.ButtonGroup(btns=btns, parent=self.sr.footer, line=0) self.transferBtn = btns.GetBtnByIdx(0)
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 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 AddWeapon(self, moduleInfo): if self is None or self.destroyed: return cont = uiprimitives.Container(parent=self.sr.assigned, align=uiconst.RELATIVE, width=32, height=32, state=uiconst.UI_HIDDEN) icon = uicontrols.Icon(parent=cont, align=uiconst.TOALL, width=0, height=0, state=uiconst.UI_NORMAL, typeID=moduleInfo.typeID) cont.sr.moduleID = moduleInfo.itemID cont.icon = icon icon.sr.moduleID = moduleInfo.itemID icon.OnClick = (self.ClickWeapon, icon) icon.OnMouseEnter = (self.OnMouseEnterWeapon, icon) icon.OnMouseExit = (self.OnMouseExitWeapon, icon) icon.OnMouseHover = (self.OnMouseHoverWeapon, icon) if self.IsECMModule(moduleInfo.typeID): icon.baseAlpha = 0.3 else: icon.baseAlpha = 1.0 icon.SetAlpha(icon.baseAlpha) self.ArrangeWeapons() self.SetSizeAutomatically() uthread.new(sm.GetService('target').AdjustRowSize)
def OnCompetitorTrackingStart(self, competitorsByShipID): scrolllist = [] for shipData in competitorsByShipID.values(): data = util.KeyVal() data.shipID = shipData.shipID data.texts = EntryRow(character=shipData.ownerName, groupName=shipData.groupName, typeName=shipData.typeName, maxDistance='%.1f km' % (shipData.maxDistance * 0.001), distance='%.1f km' % (shipData.distance * 0.001)) data.sortData = EntryRow(character=shipData.ownerName, groupName=shipData.groupName, typeName=shipData.typeName, maxDistance=shipData.maxDistance, distance=shipData.distance) data.columnID = 'AtCompetitorsScroll' data.isSelected = False data.GetMenu = lambda x: sm.GetService('menu').GetMenuFormItemIDTypeID(shipData.shipID, shipData.typeID) iconPar = uiprimitives.Container(name='iconParent', parent=None, align=uiconst.TOPLEFT, width=16, height=16, state=uiconst.UI_HIDDEN) icon = uicontrols.Icon(parent=iconPar, icon='ui_38_16_182', pos=(0, 0, 16, 16), align=uiconst.RELATIVE) icon.hint = 'Destroy Ship' icon.shipID = shipData.shipID icon.OnClick = (self.DestroyShip, icon) data.overlay = iconPar entry = listentry.Get('AtCompetitorEntry', data=data) scrolllist.append(entry) scrolllist = listentry.SortColumnEntries(scrolllist, 'AtCompetitorsScroll') data = util.KeyVal() data.texts = ('Character', 'Group', 'Type', 'Max Distance', 'Distance') data.columnID = 'AtCompetitorsScroll' data.editable = True data.showBottomLine = True data.selectable = False data.hilightable = False scrolllist.insert(0, listentry.Get('AtCompetitorEntry', data=data)) if scrolllist: listentry.InitCustomTabstops('AtCompetitorsScroll', scrolllist) self.scroll.LoadContent(contentList=scrolllist)
def Load(self, node): self.sr.node = node self.sr.label.text = node.label self.sr.iconList = [] textOffset = 1 for iconID, hintText in node.missionIconData: self.sr.iconList.append( uicontrols.Icon(icon=iconID, parent=self, pos=(textOffset, 1, 16, 16), align=uiconst.TOPLEFT, idx=0)) self.sr.iconList[-1].hint = hintText textOffset += self.sr.iconList[-1].width self.sr.label.left = textOffset + 4 self.rightClickMenu = [] self.rightClickMenu.append( (uiutil.MenuLabel('UI/Agents/Commands/ReadDetails'), self.OpenDetails)) self.rightClickMenu.append( (uiutil.MenuLabel('UI/Agents/Commands/StartConversationWith', {'agentID': self.sr.node.agentID}), self.Convo)) if node.missionState == const.agentMissionStateOffered: self.rightClickMenu.append( (uiutil.MenuLabel('UI/Agents/Commands/RemoveOffer'), self.RemoveOffer))
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.sr.sizefactor = None self.sr.sizefactorsize = None self.sr.marks = None self.Reset() self.overlays = uiprimitives.Container(name='overlays', parent=self, clipChildren=1, pos=(0, 0, 0, 0)) self.sr.areas = uiprimitives.Container(name='areas', parent=self, clipChildren=1, pos=(0, 0, 0, 0)) self.hilite = uiprimitives.Sprite(parent=self.overlays, pos=(0, 0, 16, 16), color=(1.0, 1.0, 1.0, 0.4), name='hilite', state=uiconst.UI_HIDDEN, texturePath='res:/UI/Texture/Shared/circleThin16.png', align=uiconst.RELATIVE) self.imhere = uiprimitives.Container(name='imhere', parent=self.overlays, state=uiconst.UI_HIDDEN, align=uiconst.TOPLEFT, width=16, height=16) circle = uiprimitives.Sprite(parent=self.imhere, idx=0, pos=(0, 0, 16, 16), color=(1.0, 0.0, 0.0, 1.0), name='imhere_sprite', texturePath='res:/UI/Texture/Shared/circleThin16.png', align=uiconst.RELATIVE) self.destination = uiprimitives.Sprite(parent=self.overlays, pos=(0, 0, 16, 16), color=(1.0, 1.0, 0.0, 1.0), state=uiconst.UI_HIDDEN, name='destination', texturePath='res:/UI/Texture/Shared/circleThin16.png', align=uiconst.RELATIVE) self.sprite = uicontrols.Icon(name='mapsprite', parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED, color=(1.0, 1.0, 1.0, 0.0)) self.bgSprite = None self.dragging = 0 self.ditherIn = 1 self.dragAllowed = 0 self.dataLayer = None self.dataToggle = 0 self.dataArgs = {} self.dataLoaded = None self.needsize = None self.allowAbstract = 1 self.fillSize = 0.8 self.mouseHoverGroups = [] self.cordsAsPortion = {} self.fov = None self.tempAngleFov = None
def Startup(self, *args): Generic.Startup(self) self.sr.icon = uicontrols.Icon( icon='res:/ui/Texture/WindowIcons/smallfolder.png', parent=self, pos=(6, 0, 16, 16), ignoreSize=1)
def Load(self, data): uix.Flush(self.sr.icon) uix.Flush(self.sr.status) self.typeID = data.typeInfo.typeID self.typeInfo = data.typeInfo self.groupID = data.groupID self.item = data.typeInfo.item self.hubID = data.hubID if self.item is None: self.itemID = None self.flagID = None else: self.itemID = self.item.itemID self.flagID = self.item.flagID if data.Get('selected', 0): self.Select() else: self.Deselect() sovSvc = sm.GetService('sov') self.sr.nameLabel.text = '%s' % self.typeInfo.typeName info = sovSvc.GetUpgradeLevel(self.typeID) if info is None: levelText = '' else: levelText = localization.GetByLabel('UI/InfrastructureHub/LevelX', level=sovSvc.GetUpgradeLevel(self.typeID).level) self.sr.levelLabel.text = levelText uicontrols.Icon(parent=self.sr.icon, align=uiconst.CENTER, pos=(0, 0, 24, 24), ignoreSize=True, typeID=self.typeID, size=24) if self.item is not None: statusIconPath = 'ui_38_16_193' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeAlreadyInstalled') elif self.typeInfo.canInstall: statusIconPath = 'ui_38_16_195' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeMeetsRequirements') else: statusIconPath = 'ui_38_16_194' hint = localization.GetByLabel('UI/InfrastructureHub/UpgradeRequirementsNotMet') statusIcon = uicontrols.Icon(icon=statusIconPath, parent=self.sr.status, align=uiconst.CENTER, pos=(0, 0, 16, 16)) statusIcon.hint = hint if self._CanUpgradeBeManuallyToggled(): self.MakeFlagSwitch() else: self.SetFlagIcon() hinttext = localization.GetByLabel('UI/InfrastructureHub/PrereqsShort', level=sovSvc.GetUpgradeLevel(self.typeID).level) preReqs = sovSvc.GetPrerequisite(self.typeID) if preReqs is not None: hinttext = localization.GetByLabel('UI/InfrastructureHub/PrereqsLong', level=sovSvc.GetUpgradeLevel(self.typeID).level, preReqs=preReqs) self.hint = hinttext
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 = cfg.invtypes.Get(self.typeID).Icon() 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 Setup(self, moduleinfo): targetContainer = uiprimitives.Container(name='targetCont', align=uiconst.TOPLEFT, parent=self, top=0, height=64, width=64) slot = DefenceModuleButton(parent=targetContainer, idx=0) self.sr.targetIcon = uiutil.GetChild(targetContainer, 'iconSprite') self.sr.targetContainer = targetContainer self.sr.targetContainer.state = uiconst.UI_DISABLED sourceContainer = uiprimitives.Container(name='sourceCont', align=uiconst.TOPLEFT, parent=self, top=targetContainer.height + 22, height=64, width=64) slot = DefenceModuleButton(parent=sourceContainer, idx=0) self.sr.sourceIcon = uiutil.GetChild(sourceContainer, 'iconSprite') self.sr.sourceIcon.state = uiconst.UI_DISABLED self.sr.glow = uiutil.GetChild(sourceContainer, 'glow') self.sr.busy = uiutil.GetChild(sourceContainer, 'busy') self.sr.quantityParent = uiutil.GetChild(sourceContainer, 'quantityParent') self.sr.quantityParent.left = 8 self.sr.quantityParent.width = 28 idx = self.parent.children.index(self) fill = uiprimitives.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.125), state=uiconst.UI_HIDDEN, idx=idx) self.sr.hilite = fill self.sr.sourceContainer = sourceContainer self.sr.sourceContainer.state = uiconst.UI_DISABLED chargeIcon = uicontrols.Icon(parent=sourceContainer, align=uiconst.RELATIVE, top=32, left=6, size=24, idx=0, state=uiconst.UI_HIDDEN, ignoreSize=True) self.sr.chargeIcon = chargeIcon if not len(self.__cgattrs__): self.__cgattrs__.extend([ a.attributeID for a in cfg.dgmattribs if cgre.match(a.attributeName) is not None ]) self.sr.typeID = moduleinfo.typeID self.moduleinfo = moduleinfo self.locationFlag = moduleinfo.flagID self.sr.sourceID = moduleinfo.itemID self.id = moduleinfo.itemID self.sr.glow.z = 0 self.sr.qtylabel = uicontrols.Label(text='', parent=self.sr.quantityParent, width=30, state=uiconst.UI_DISABLED, idx=0, fontsize=9) self.sr.distancelabel = uicontrols.EveHeaderSmall(text='', parent=self.sr.targetContainer, left=12, top=-16, width=70, state=uiconst.UI_DISABLED, idx=0) if cfg.IsChargeCompatible(moduleinfo): self.invCookie = sm.GetService('inv').Register(self) self.SetCharge(None) for key in moduleinfo.effects.iterkeys(): effect = moduleinfo.effects[key] if self.IsEffectActivatible(effect): self.def_effect = effect if effect.isActive: self.SetActive() if effect.effectName == 'online': if effect.isActive: self.ShowOnline() else: self.ShowOffline() self.state = uiconst.UI_NORMAL currentTarget = self.GetCurrentTarget() if currentTarget is not None: uthread.pool('DefenceMobuleButton::OnTargetAdded::', self.OnTargetAdded, currentTarget) self.sr.sourceUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'source') self.UpdateData('source') self.sr.targetUpdateTimer = base.AutoTimer(random.randint(750, 1000), self.UpdateData, 'target') self.UpdateData('target') self.UpdateDistance() self.sr.distanceUpdateTimer = base.AutoTimer(random.randint(5000, 6000), self.UpdateDistance) self.EnableDrag() uthread.new(self.BlinkIcon)
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) quantityParent = uiprimitives.Container(parent=self, name='quantityParent', pos=(8, 10, 22, 10), align=uiconst.BOTTOMRIGHT, state=uiconst.UI_HIDDEN) fill = uiprimitives.Fill(parent=quantityParent, color=(0.0, 0.0, 0.0, 1.0)) iconSprite = uicontrols.Icon(parent=self, name='iconSprite', pos=(8, 6, 48, 48), state=uiconst.UI_HIDDEN) mainshape = uiprimitives.Sprite(parent=self, name='mainshape', align=uiconst.TOALL, state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/classes/DefenceModuleButton/mainShape.png', color=(1.0, 1.0, 1.0, 0.7)) glow = uiprimitives.Sprite(parent=self, name='glow', pos=(-1, -1, -1, -1), align=uiconst.TOALL, state=uiconst.UI_HIDDEN, texturePath='res:/UI/Texture/classes/DefenceModuleButton/mainGlow.png', color=(0.24, 0.67, 0.16, 0.74)) busy = uiprimitives.Sprite(parent=self, name='busy', pos=(-2, -2, -2, -2), align=uiconst.TOALL, state=uiconst.UI_HIDDEN, texturePath='res:/UI/Texture/classes/DefenceModuleButton/mainGlow.png', color=(1.0, 0.13, 0.0, 0.73))