def ApplyAttributes(self, attributes): super(PurchaseResultPanel, self).ApplyAttributes(attributes) self.audioEventName = attributes.audioEventName cont = Container(parent=self, align=uiconst.TOTOP, height=72, padTop=4) self.iconForegroundTransform = Transform(parent=cont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) self.iconForeground = Sprite( parent=self.iconForegroundTransform, align=uiconst.CENTER, texturePath=attributes.iconForegroundTexturePath, width=72, height=64, opacity=0) self.iconBackgroundTransform = Transform(parent=cont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) self.iconBackground = Sprite( parent=self.iconBackgroundTransform, align=uiconst.CENTER, texturePath=attributes.iconBackgroundTexturePath, width=72, height=64, opacity=0) captionCont = Container(parent=self, align=uiconst.TOTOP, height=40, padding=(TEXT_PADDING, 4, TEXT_PADDING, 0)) VgsLabelLarge(parent=captionCont, align=uiconst.CENTER, text=attributes.textTitle)
def _ConstructUI(self): self.stackFaderContainer = Container(name='notificationPopupContainer', parent=self.layer) self._ConstructStackFader() self._ConstructBadge() self.notificationContainer = Transform(name='NotificationContainer', parent=self.layer, align=uiconst.TOPLEFT, width=self.widgetWidth, height=self.widgetHeight, clipChildren=True) self.subNotificationContainer = Transform( name='SubNotificationContainer', parent=self.notificationContainer, align=uiconst.TOALL, clipChildren=True) self.actualUnderlay = WindowUnderlay( bgParent=self.notificationContainer) self.topContainer = Container(name='topContainer', parent=self.subNotificationContainer, align=uiconst.TOALL, padding=(0, 0, 0, 0)) self.AutoPositionContainer() self._ConstructNotificationArea() if self.enablePositionDebug: self._ConstructGuideLines() self.AutoPositionContainer() self.HideFrame()
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.radius = attributes.Get('radius', self.default_radius) self.lineWidth = attributes.Get('lineWidth', self.default_lineWidth) self.startAngle = attributes.Get('startAngle', self.default_startAngle) self.value = attributes.Get('value', self.default_value) self.colorStart = attributes.Get('colorStart', self.default_colorStart) self.colorEnd = attributes.Get('colorEnd', self.default_colorEnd) self.colorBg = attributes.Get('colorBg', self.default_colorBg) colorMarker = attributes.Get('colorMarker', self.default_colorMarker) self.callback = attributes.Get('callback', self.default_callback) self.isHoverMarkerEnabled = attributes.Get( 'hoverMarkerEnabled', self.default_hoverMarkerEnabled) self.isClockwise = attributes.Get('clockwise', self.default_clockwise) self.bgPortion = attributes.Get('bgPortion', self.default_bgPortion) self.showMarker = attributes.get('showMarker', self.default_showMarker) self.autoUpdate = attributes.get('autoUpdate', self.default_autoUpdate) self.moveMarker = attributes.get('moveMarker', self.default_moveMarker) self.useRealTime = attributes.get('useRealTime', self.default_animateInRealTime) if colorMarker is None: colorMarker = self.colorStart self.width = self.height = self.radius * 2 self.pickRadius = self.radius + self.lineWidth self._angle = 0.0 hoverMarkerSize = self.lineWidth * 1.7 self.hoverMarker = Sprite( name='hoverMarker', parent=self, color=colorMarker, width=hoverMarkerSize, height=hoverMarkerSize, state=uiconst.UI_DISABLED, opacity=0.0, texturePath='res:/UI/Texture/Classes/Gauge/circle.png') if self.isClockwise: rotation = -self.startAngle - pi / 2 else: rotation = self.startAngle + pi / 2 state = uiconst.UI_DISABLED if self.showMarker else uiconst.UI_HIDDEN self.markerTransform = Transform(name='markerTransform', parent=self, align=uiconst.TOALL, rotationCenter=(0.5, 0.5), rotation=rotation, state=state) height = self.lineWidth + 5 self.marker = Fill(name='marker', parent=self.markerTransform, color=colorMarker, align=uiconst.CENTERTOP, pos=(0, -(height - self.lineWidth), 2, height)) self.gauge = None self.bgGauge = None self.Reconstruct() if self.autoUpdate: uthread.new(self.UpdateThread)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) leftTexture = 'res:/UI/Texture/classes/ShipUI/slotRampLeft.png' leftRampCont = Container(parent=self, name='leftRampCont', pos=(0, 0, 32, 64), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, clipChildren=True) self.leftRamp = Transform(parent=leftRampCont, name='leftRamp', pos=(0, 0, 64, 64), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) rampLeftSprite = Sprite(parent=self.leftRamp, name='rampLeftSprite', pos=(0, 0, 32, 64), state=uiconst.UI_DISABLED, texturePath=leftTexture) self.leftShadowRamp = Transform(parent=leftRampCont, name='leftShadowRamp', pos=(0, 1, 64, 64), align=uiconst.TOPLEFT, state=uiconst.UI_HIDDEN) shadow = Sprite(parent=self.leftShadowRamp, name='rampSprite', pos=(0, 0, 32, 64), state=uiconst.UI_DISABLED, texturePath=leftTexture, color=(0, 0, 0, 1)) rightTexture = 'res:/UI/Texture/classes/ShipUI/slotRampRight.png' rightRampCont = Container(parent=self, name='rightRampCont', pos=(32, 0, 32, 64), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, clipChildren=True) self.rightRamp = Transform(parent=rightRampCont, name='rightRamp', pos=(-32, 0, 64, 64), align=uiconst.TOPLEFT, state=uiconst.UI_NORMAL) rampRightSprite = Sprite(parent=self.rightRamp, name='rampRightSprite', pos=(32, 0, 32, 64), state=uiconst.UI_DISABLED, texturePath=rightTexture) self.rightShadowRamp = Transform(parent=rightRampCont, name='rightShadowRamp', pos=(-32, 1, 64, 64), align=uiconst.TOPLEFT, state=uiconst.UI_HIDDEN) shadow = Sprite(parent=self.rightShadowRamp, name='rampSprite', pos=(32, 0, 32, 64), state=uiconst.UI_DISABLED, texturePath=rightTexture, color=(0, 0, 0, 1)) self.display = False
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.panSpeed = attributes.Get('panSpeed', self.default_panSpeed) self.panAmount = attributes.Get('panAmount', self.default_panAmount) self.callback = attributes.Get('callback', self.default_callback) self._border = None self.border = attributes.Get('border', self.default_border) self._panLeft = attributes.Get('panLeft', self.default_panLeft) self._panTop = attributes.Get('panTop', self.default_panTop) self.axisLockMargin = attributes.Get('axisLockMargin', self.default_axisLockMargin) self._scale = 1.0 self.panUpdateThread = None self.panTarget = None self.transform = Transform(parent=self, align=TOPLEFT, state=UI_PICKCHILDREN, scalingCenter=(0.5, 0.5)) self.mainCont = ContainerAutoSize(name='mainCont', parent=self.transform, align=CENTER, state=UI_PICKCHILDREN)
def ApplyAttributes(self, attributes): super(PurchaseSuccessPanel, self).ApplyAttributes(attributes) text = attributes.pop('text', localization.GetByLabel(self.default_text)) subText = attributes.pop('subText', localization.GetByLabel(self.default_subText) if self.default_subText is not None else None) mainCont = ContainerAutoSize(parent=self, align=uiconst.CENTER, alignMode=uiconst.TOTOP, width=1) iconCont = Container(parent=mainCont, align=uiconst.TOTOP, height=72) self.iconForegroundTransform = Transform(parent=iconCont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) self.iconForeground = Sprite(parent=self.iconForegroundTransform, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=self.ICON_FOREGROUND, width=72, height=64, opacity=0) self.iconBackgroundTransform = Transform(parent=iconCont, align=uiconst.CENTERTOP, width=72, height=78, scalingCenter=(0.5, 0.5)) self.iconBackground = Sprite(parent=self.iconBackgroundTransform, align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath=self.ICON_BACKGROUND, width=72, height=64, opacity=0) labelCont = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP, top=4) VgsLabelLarge(parent=labelCont, align=uiconst.CENTER, text=text) if subText: self.subTextCont = ContainerAutoSize(parent=mainCont, align=uiconst.TOTOP, top=12, opacity=0) VgsLabelSmall(parent=self.subTextCont, align=uiconst.CENTER, width=460, text='<center>%s</center>' % subText)
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) degree = attributes.degree radians = mathUtil.DegToRad(degree) self.rotation = -radians self.actionDistance = attributes.sizeInfo.actionDistance self.degree = degree
def ConstructBackground(self): self.bgTransform = Transform(name='bgTransform', parent=self.mainCont, align=CENTERBOTTOM, state=UI_DISABLED, scalingCenter=(0.5, 0.5), width=400, height=400) Sprite( bgParent=self.bgTransform, align=TOALL, texturePath='res:/UI/Texture/classes/Industry/Center/bgCircle.png') self.bgBorder = Sprite( bgParent=self.bgTransform, align=TOALL, texturePath= 'res:/UI/Texture/classes/Industry/Center/bgCircleBorder.png', color=self.color) self.bgGradient = Sprite( parent=self.bgTransform, align=uiconst.CENTER, texturePath= 'res:/UI/Texture/classes/Industry/Center/bgGlowRing.png', color=self.color, opacity=0.0, width=432, height=432)
def FadeOutPanelAndClose(panel, duration=0.2): if panel.destroyed or panel.beingDestroyed: return panel.beingDestroyed = True duration *= panel.opacity if not duration: panel.Close() return pointerOffset = panel.backgroundFrame.pointerOffset if not pointerOffset: panel.Close() return x, y = uicore.ReverseScaleDpi(panel.displayX + pointerOffset[0]), uicore.ReverseScaleDpi( panel.displayY + pointerOffset[1]) panel.scaleTransform = Transform( parent=panel.parent, state=uiconst.UI_DISABLED, align=uiconst.TOALL, scalingCenter=(x / float(uicore.desktop.width), y / float(uicore.desktop.height))) panel.parent.renderObject.children.remove(panel.renderObject) panel.scaleTransform.renderObject.children.append(panel.renderObject) uicore.animations.FadeTo(panel.scaleTransform, startVal=panel.opacity, endVal=0.0, duration=duration * 0.5, curveType=uiconst.ANIM_SMOOTH) uicore.animations.Tr2DScaleTo(panel.scaleTransform, panel.scaleTransform.scale, (0.0, 0.0), duration=duration, callback=panel.Close)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.offer = attributes.offer if self.offer: self.CreateInfoBox(attributes.upperText, attributes.lowerText, attributes.upperSize or VGS_FONTSIZE_OFFER, attributes.lowerSize or VGS_FONTSIZE_OFFER) self.imageLayer = Transform(name='imageLayer', parent=self, align=uiconst.TOALL, scalingCenter=(0.5, 0.5), bgColor=OFFER_BACKGROUND_COLOR) if self.offer is not None and self.offer.label is not None: Ribbon(parent=self.imageLayer, align=uiconst.TOPLEFT, label=self.offer.label, state=uiconst.UI_DISABLED, idx=0, isBig=False) if self.offer: self.lazySprite = LazyUrlSprite(parent=self.imageLayer, align=uiconst.TOALL, imageUrl=self.offer.imageUrl) GradientSprite(name='OfferGradient', align=uiconst.TOALL, bgParent=self.imageLayer, rgbData=((1.0, OFFER_RADIAL_SHADOW), ), alphaData=((0.0, 0.0), (1.0, 1.0)), radial=True, idx=0)
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 ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) sm.RegisterNotify(self) self.typeID = attributes.typeID self.factionID = attributes.factionID self.groupNode = attributes.groupNode self.masteryLevel = None self.isMasteryIconBlinking = False if self.groupNode.IsRestricted(): Sprite(bgParent=self, align=uiconst.TOALL, texturePath='res:/UI/Texture/classes/ShipTree/groups/hatchPattern.png', textureSecondaryPath='res:/UI/Texture/classes/ShipTree/groups/bgVignette.png', spriteEffect=trinity.TR2_SFX_MODULATE, tileX=True, tileY=True, color=(0.965, 0.467, 0.157, 0.4)) self.bgFrame = Frame(bgParent=self, cornerSize=10, opacity=0.5, texturePath='res:/UI/Texture/Classes/ShipTree/groups/frameUnlocked.png') self.bgBlinkFill = None self.bgVignette = Sprite(name='bgFill', bgParent=self, texturePath='res:/UI/Texture/Classes/ShipTree/groups/bgFill.png') Sprite(name='bgVignette', bgParent=self, texturePath='res:/UI/Texture/Classes/ShipTree/groups/bgVignette.png', color=COLOR_BG) self.recentUnlockBG = None texturePath = shipTreeConst.GetTagIconForType(self.typeID) if texturePath: self.techIcon = Sprite(name='techIcon', parent=self, align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, width=32, height=32, texturePath=texturePath, idx=0) else: self.techIcon = None self.iconTransform = Transform(parent=self, align=uiconst.TOALL, scalingCenter=(0.5, 0.5)) try: texturePath = inventorycommon.typeHelpers.GetHoloIconPath(self.typeID) except AttributeError as e: texturePath = None log.LogException(e) self.iconSprite = Sprite(name='iconSprite', parent=self.iconTransform, align=uiconst.TOPLEFT_PROP, state=uiconst.UI_DISABLED, texturePath=texturePath, blendMode=trinity.TR2_SBM_ADD, pos=(0.5, 0.08, self.width - 36, self.width - 36), idx=0) self.masteryIcon = Sprite(name='masterySprite', parent=self, align=uiconst.CENTERBOTTOM, state=uiconst.UI_DISABLED, pos=(0, -3, 45, 45), idx=0)
def ConstructMainCont(self): self.spriteCont.Flush() self.mainItem = None self.mainTransform = None self.mainSprite = None self.codeEdit = None if self.mode is MODE_NORMAL: self.mainTransform = Transform(parent=self.spriteCont, align=uiconst.CENTER, pos=(0, 0, 128, 128)) self.mainSprite = Sprite( parent=self.mainTransform, align=uiconst.CENTER, pos=(0, 0, 128, 128), texturePath='res:/UI/Texture/CorpLogoLibs/419.png', texturePathSecondary='res:/UI/Texture/colorgradient.dds') elif self.mode is MODE_CODE: self.codeEdit = SinglelineEdit( parent=self.spriteCont, align=uiconst.TOTOP, label='Code that returns a UI object:', heigt=15, padding=(10, 30, 150, 0), setvalue=settings.user.ui.Get('TestAnimationsWndCode', 'uicore.layer.sidePanels')) Button(parent=self.spriteCont, align=uiconst.TOPLEFT, label='Assign result', top=60, left=5, func=self.OnAssignCodeBtn) elif self.mode is MODE_INPUT: self.mainItem = self.inputObj
def InitCapacitor(self): self.initialized = 0 self.lastSetCapacitor = None self.AnimateCapacitorOut(self.children[:], 0.5) self.powerCells = [] maxCap = self.controller.GetCapacitorCapacityMax() numcol = min(18, int(maxCap / 50)) rotstep = 360.0 / max(1, numcol) colWidth = max(12, min(16, numcol and int(192 / numcol))) newColumns = [] for i in range(numcol): powerColumn = Transform(parent=self, name='powerColumn', pos=(0, 0, colWidth, 56), align=uiconst.CENTER, state=uiconst.UI_DISABLED, rotation=DegToRad(i * -rotstep), idx=0) newColumns.append(powerColumn) for ci in xrange(4): newcell = Sprite( parent=powerColumn, name='pmark', pos=(0, ci * 5, 10 - ci * 2, 7), align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, texturePath= 'res:/UI/Texture/classes/ShipUI/capacitorCell_2.png', color=(0, 0, 0, 0)) self.powerCells.insert(0, newcell) self.AnimateCapacitorIn(newColumns, 1.0) self.initialized = 1
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.controller = attributes.controller self.wantedspeed = None self.speedTimer = None self.speedInited = 0 self.speedCircularPickParent = Container( name='speedCircularPickParent', parent=self, align=uiconst.CENTERBOTTOM, pos=(0, 0, 144, 144), pickRadius=72) self.speedGaugeParent = Container(parent=self.speedCircularPickParent, name='speedGaugeParent', pos=(0, 0, 124, 36), align=uiconst.CENTERBOTTOM, state=uiconst.UI_DISABLED, clipChildren=True) self.speedLabel = EveLabelSmall(name='speedLabel', parent=self.speedGaugeParent, color=Color.BLACK, align=uiconst.CENTER) Sprite(parent=self.speedCircularPickParent, name='speedoUnderlay', pos=(0, 48, 104, 44), align=uiconst.CENTER, state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/classes/ShipUI/speedoUnderlay.png') self.speedNeedle = Transform(parent=self.speedGaugeParent, name='speedNeedle', pos=(-5, -38, 134, 12), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN, rotationCenter=(0.5, 0.5)) Sprite( parent=self.speedNeedle, name='needle', pos=(0, 0, 24, 12), align=uiconst.TOPLEFT, state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/classes/ShipUI/heatGaugeNeedle.png') Sprite(parent=self.speedNeedle, name='speedGaugeSprite', texturePath='res:/UI/Texture/classes/ShipUI/speedoOverlay.png', pos=(-8, -73, 79, 79), state=uiconst.UI_DISABLED) self.speedTimer = uthread.new(self.UpdateSpeedThread)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.cameraSvc = sm.GetService('camera') self.michelle = sm.GetService('michelle') self.compassTransform = Transform(name='compass_transform', parent=self, width=COMPASS_WIDTH, height=COMPASS_WIDTH, align=uiconst.CENTER, opacity=COMPASS_OPACITY_ACTIVE) Sprite( name='compass_dots', bgParent=self.compassTransform, texturePath='res:/UI/Texture/classes/SensorSuite/compass_dots.png', color=COMPASS_DIRECTIONS_COLOR.GetRGBA()) self.sweepTransform = Transform(bgParent=self.compassTransform, name='compass_transform', width=COMPASS_WIDTH, height=COMPASS_WIDTH, align=uiconst.CENTER, opacity=0.0) Sprite( name='sensor_sweep', bgParent=self.sweepTransform, texturePath='res:/UI/Texture/classes/SensorSuite/scan_sweep.png', blendMode=trinity.TR2_SBM_ADD, color=COMPASS_SWEEP_COLOR.GetRGBA()) Sprite(name='sensor_centerline', bgParent=self, texturePath= 'res:/UI/Texture/classes/SensorSuite/compass_centerline.png', blendMode=trinity.TR2_SBM_ADD, opacity=0.2) Sprite(name='compass_underlay', bgParent=self, texturePath= 'res:/UI/Texture/classes/SensorSuite/compass_underlay.png') self.sensorSuite = sm.GetService('sensorSuite') self.siteIndicatorsBySiteID = {} self.lastPose = None logger.debug('Compass updating starting') self.timer = AutoTimer(40, self.__UpdateCompass) self.sensorSuite.AddSiteObserver(self.OnSiteChanged) self.sensorSuite.AddSweepObserver(self.OnSweepStarted, self.OnSweepEnded)
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) self.controller = attributes.controller self.utilButtons = [] self._emptyHint, self._emptyTooltip = self.PrimeToEmptySlotHint() self.controller.on_online_state_change.connect( self.UpdateOnlineDisplay) self.controller.on_item_fitted.connect(self.UpdateFitting) self.hilitedFromMathing = False
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) labelText = attributes.text wrapWidth = attributes.get('wrapWidth', self.default_wrapWidth) labelClass = attributes.get('labelClass', EveLabelSmall) self.label = labelClass(text=labelText, parent=self, maxLines=2, wrapWidth=wrapWidth) self.width = self.label.width self.height = self.label.height self.rotation = attributes.get('rotation', self.default_rotation) self.rotationCenter = attributes.get('rotationCenter', self.default_rotationCenter)
def AddPowerColumn(self, parent, colIdx, rotStep, colWidth, colHeight): rotation = DegToRad(colIdx * -rotStep) powerColumn = Transform(parent=parent, name='powerColumn', pos=(0, 0, colWidth, colHeight), align=uiconst.CENTER, state=uiconst.UI_DISABLED, rotation=rotation, idx=0) return powerColumn
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) self.display = attributes.Get('display', True) self.isExpanded = False self.buttonDict = {} self.sizeInfo = attributes.sizeInfo self.buttonWidth = attributes.sizeInfo.buttonWidth self.actionDistance = attributes.sizeInfo.actionDistance self.actionButtonTopPadding = attributes.sizeInfo.buttonPaddingTop self.buttonBackgroundOpacity = attributes.Get('buttonBackgroundOpacity', 0.8) self.usePreciseRanges = attributes.Get('usePreciseRanges', True)
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.numSegments = attributes.numSegments self.radius = attributes.Get('radius', self.default_radius) self.lineWidth = attributes.Get('lineWidth', self.default_lineWidth) self.updateIconThread = None self.width = self.height = self.radius * 2 self.segmentTransform = Transform(name='segmentTransform', parent=self, align=TOALL) self.segments = self.ConstructSegments() self.icon = Sprite(name='icon', parent=self, align=CENTER, state=UI_DISABLED, width=20, height=20) self.AnimEntry()
def _create_item_reward_icon(self): self.reward_item_icon_glow_container = Transform( name='reward_item_icon_glow_container', parent=self.reward_content_container, align=uiconst.CENTER, height=REWARD_ITEM_ICON_SIZE, width=REWARD_ITEM_ICON_SIZE, top=REWARD_ITEM_ICON_TOP_MARGIN, scalingCenter=REWARD_ITEM_ICON_SCALING_CENTER) self.reward_item_icon_glow_container.Hide() self.reward_item_icon_container = Container( name='reward_item_icon_container', parent=self.reward_item_icon_glow_container, align=uiconst.TOALL, padding=REWARD_ITEM_ICON_GLOW_PADDING) self.reward_item_icon_overlay_fill = Fill( parent=self.reward_item_icon_container, color=Color.WHITE, opacity=ANIMATED_ICON_OVERLAY_OPACITY) Fill(bgParent=self.reward_item_icon_container, color=REWARD_BACKGROUND_FILL_COLOR)
def FadeOutTransition(self): if not self.opacity or self.fadeoutState == FADE_STATE_OUT: return self.fadeoutState = FADE_STATE_OUT timeScale = 1.0 wasCacheContent = self.cacheContents self.cacheContents = False l, t, w, h = self.GetAbsolute() transform = Transform( parent=self.parent, state=uiconst.UI_DISABLED, align=uiconst.TOALL, scalingCenter=(float(l + w / 2) / uicore.desktop.width, float(t + h / 2) / uicore.desktop.height), scaling=(1.0, 1.0), idx=self.parent.children.index(self)) self.SetParent(transform) self.transitionBox = WindowTransition(parent=transform, pos=self.pos) uicore.animations.BlinkOut(self.transitionBox.cornerPoints, loops=5, duration=0.3 * timeScale) uicore.animations.FadeOut(self, duration=0.2 * timeScale, sleep=True) uicore.animations.FadeTo(self.transitionBox.whiteFill, startVal=0.2, endVal=0.05, duration=0.1 * timeScale, sleep=True) uicore.animations.SpColorMorphTo(self.transitionBox.whiteFill, startColor=(0, 0, 0, 0.1), endColor=(1, 1, 1, 0.1), duration=0.1 * timeScale) uicore.animations.Tr2DScaleTo(transform, startScale=(1.0, 1.0), endScale=(1.0, 0.0), duration=0.3 * timeScale, sleep=True) if not self.destroyed: self.SetParent(uicore.layer.main, idx=0) self.cacheContents = wasCacheContent transform.Close()
def CreateSpinningCircles(self): self.wheelTransformInner = Transform(parent=self, align=uiconst.CENTER, width=175, height=175, state=uiconst.UI_DISABLED) self.wheelTransformOuter = Transform(parent=self, align=uiconst.CENTER, width=175, height=175, state=uiconst.UI_DISABLED) self.wheelSpriteInner = Sprite( parent=self.wheelTransformInner, align=uiconst.TOALL, texturePath= 'res:/UI/Texture/classes/SensorSuite/CircleDots_Inner.png', opacity=self.spinnerOpacity) self.wheelSpriteOuter = Sprite( parent=self.wheelTransformOuter, align=uiconst.TOALL, texturePath= 'res:/UI/Texture/classes/SensorSuite/CircleDots_Outer.png', opacity=self.spinnerOpacity)
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) borderColor = attributes.get('borderColor', redeemColors.REDEEM_BUTTON_BORDER_COLOR) backgroundColor = attributes.get( 'backgroundColor', redeemColors.REDEEM_BUTTON_BACKGROUND_COLOR) fillColor = attributes.get('fillColor', redeemColors.REDEEM_BUTTON_FILL_COLOR) textColor = attributes.get('textColor', redeemColors.TEXT_COLOR) uiprimitives.Line(parent=self, color=borderColor, align=uiconst.TOTOP, weight=1) uiprimitives.Fill(bgParent=self, color=backgroundColor) borderFillColor = fillColor[:3] self.borderFill = uicontrols.GradientSprite(bgParent=self, rgbData=[ (0, borderFillColor), (0.5, borderFillColor), (1.0, borderFillColor) ], alphaData=[(0.3, 0.1), (0.5, 0.4), (0.7, 0.1)], idx=0, state=uiconst.UI_DISABLED) self.OnClick = attributes.get('OnClick', self.DefaultOnClick) self.captionCont = Container(parent=self, name='captionCont', align=uiconst.CENTERTOP) self.expanderIcon = uiprimitives.Sprite( parent=self.captionCont, texturePath='res:/UI/Texture/Icons/105_32_5.png', align=uiconst.CENTERRIGHT, pos=(0, 0, 32, 32), state=uiconst.UI_DISABLED, color=textColor) self.availableLabel = uicontrols.EveCaptionMedium( parent=self.captionCont, align=uiconst.CENTERLEFT, text=localization.GetByLabel('UI/RedeemWindow/RedeemableItems'), state=uiconst.UI_DISABLED, color=textColor, bold=False) self.availableLabel.letterspace = 1 self.captionCont.width = self.availableLabel.textwidth + 10 + self.expanderIcon.width self.captionCont.height = max(self.availableLabel.textheight + 10, self.expanderIcon.height) self.height = self.captionCont.height
def BuildRefreshInventory(self): self.refreshCont = Transform(parent=self.layoutGrid, pos=(0, 0, 32, 32), align=uiconst.CENTER) self.refreshIcon = ButtonIcon(name='refreshSprite', parent=self.refreshCont, width=32, height=32, align=uiconst.CENTER, texturePath=REFRESH_TEXTUREPATH, iconSize=32, func=self.OnRefreshClicked) self.refreshIcon.hint = GetByLabel( 'UI/Fitting/FittingWindow/FittingManagement/RefreshInventoryStatusHint' )
def ApplyAttributes(self, attributes): super(SidePanelButtonWithText, self).ApplyAttributes(attributes) self.isLeftAlign = attributes.isLeftAlign self.tabText = attributes.tabText self.onClick = attributes.onClick self.args = attributes.args self.isSelected = attributes.isSelected textRotation, frameRotation = self.GetRotations() self.tabLabelCont = VerticalLabel(parent=self, text=self.tabText, align=uiconst.CENTER, state=uiconst.UI_DISABLED, rotation=textRotation, labelClass=EveLabelLarge, rotationCenter=(0.5, 0.5)) self.tabLabelCont.label.letterspace = 1 frameCont = Transform(name='frameCont', parent=self, align=uiconst.TOALL, rotation=frameRotation) self.hilite = Frame(name='hilite', parent=frameCont, texturePath='res:/UI/Texture/Shared/sideTab_Over.png', align=uiconst.TOLEFT_NOPUSH, width=40, cornerSize=TABWIDTH) self.selectedFrame = Frame(name='selectedFrame', parent=frameCont, texturePath='res:/UI/Texture/Shared/sideTab_Over.png', align=uiconst.TOLEFT_NOPUSH, width=40, cornerSize=TABWIDTH, opacity=4.0) self.selectedFrame.display = False Frame(name='outputFrame', parent=frameCont, texturePath='res:/UI/Texture/Shared/sideTab_Active.png', align=uiconst.TOLEFT_NOPUSH, width=40, cornerSize=TABWIDTH, opacity=0.4) self.SetSelectedBtnState(self.isSelected)
def _ConstructControlContainer(self): if self.verticalAlignment is ExpandAlignmentConst.EXPAND_ALIGNMENT_VERTICAL_UP: controlContainerAlignment = uiconst.TOBOTTOM else: controlContainerAlignment = uiconst.TOTOP ctop = 0 if self.verticalAlignment is ExpandAlignmentConst.EXPAND_ALIGNMENT_VERTICAL_DOWN: ctop = -self.historyHeader.height - 4 self.controlBottomContainer = Transform(parent=self.windowunderlay, name='buttonControlContainer', align=controlContainerAlignment, height=32, width=32, top=ctop, clipChilren=False) buttonAlignment = uiconst.TORIGHT if self.horizontalAlignment is ExpandAlignmentConst.EXPAND_ALIGNMENT_HORIZONTAL_RIGHT: buttonAlignment = uiconst.TOLEFT self.widgetButton2 = ButtonIcon(name='WidgetIcon', align=buttonAlignment, width=32, height=32, iconSize=32, texturePath='res:/UI/Texture/classes/Notifications/widgetIcon.png', func=self.OnWidgetButtonClick) self.widgetButton2.LoadTooltipPanel = self._LoadWidgetTooltipPanel self.controlBottomContainer.children.append(self.widgetButton2) self.dragMovable = DragMovable(self.notificationContainer, buttonObject=self.widgetButton2, onDrag=self.onWidgetDrag, onDragEnter=self.onWidgetDragEnter, onDragFinished=self.onWidgetDragFinished, startPosition=(self.customX, self.customY))
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) self.sprite1 = Sprite( parent=self, align=uiconst.CENTERLEFT, pos=(0, 0, 49, 6), texturePath='res:/UI/Texture/classes/Industry/Center/blueDash.png') self.sprite2 = Sprite( parent=self, align=uiconst.CENTERLEFT, pos=(0, 0, 49, 6), texturePath='res:/UI/Texture/classes/Industry/Center/blueDash.png') self.sprite3 = Sprite( parent=self, align=uiconst.CENTERLEFT, pos=(0, 0, 49, 6), texturePath='res:/UI/Texture/classes/Industry/Center/blueDash.png') uthread.new(self.Animate)
def ApplyAttributes(self, attributes): Transform.ApplyAttributes(self, attributes) self.display = False rangeSize = attributes.rangeSize self.rangeMeterLeftSide = SpriteThemeColored(parent=self, name='rangeMeterLeftSide', pos=(0, 0, rangeSize, rangeSize), state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/classes/RadialMenu/rangeMaskL.png', textureSecondaryPath='res:/UI/Texture/classes/RadialMenu/gaugeFill.png', colorType=uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.5, align=uiconst.CENTER, blendMode=1, spriteEffect=trinity.TR2_SFX_MODULATE) self.rangeMeterLeftSide.display = True self.rangeMeterRightSide = SpriteThemeColored(parent=self, name='rangeMeterRightSide', pos=(0, 0, rangeSize, rangeSize), state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/classes/RadialMenu/rangeMaskR.png', textureSecondaryPath='res:/UI/Texture/classes/RadialMenu/gaugeFill.png', colorType=uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.5, align=uiconst.CENTER, blendMode=1, spriteEffect=trinity.TR2_SFX_MODULATE) self.rangeMeterRightSide.display = True self.rangeMeterFull = Sprite(parent=self, name='rangeMeterFull', pos=(0, 0, rangeSize, rangeSize), state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/classes/RadialMenu/rangeShadow.png', align=uiconst.CENTER, color=(1.0, 1.0, 1.0, 0.4))