Пример #1
0
 def ApplyAttributes(self, attributes):
     InSceneContainer.ApplyAttributes(self, attributes)
     cont = Container(parent=self,
                      align=uiconst.CENTER,
                      width=500,
                      height=500)
     SpriteThemeColored(
         parent=cont,
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/Classes/Camera/crosshair.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT)
     self.crosshairPitchSprite = SpriteThemeColored(
         parent=cont,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/Classes/Camera/pitch.png',
         width=500,
         height=500,
         colorType=uiconst.COLORTYPE_UIHILIGHT)
     self.crosshairRotationSprite = SpriteThemeColored(
         parent=cont,
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/Classes/Camera/rotate.png',
         width=500,
         height=500,
         colorType=uiconst.COLORTYPE_UIHILIGHT)
     self.crosshairRotationSprite.useTransform = True
     self.AnimEntry()
Пример #2
0
 def ConstructLayout(self):
     self.frame = FrameThemeColored(
         name='frame',
         bgParent=self,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         color=self.fixedColor,
         blendMode=trinity.TR2_SBM_ADD,
         texturePath='res:/UI/Texture/Classes/RadioButton/frame.png',
         opacity=self.OPACITY_IDLE)
     self.innerGlow = FrameThemeColored(
         name='innerGlow',
         bgParent=self,
         cornerSize=10,
         texturePath='res:/UI/Texture/Classes/RadioButton/innerGlow.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         color=self.fixedColor,
         opacity=self.OPACITY_IDLE)
     self.hoverFill = SpriteThemeColored(
         name='hoverFill',
         bgParent=self,
         texturePath='res:/UI/Texture/Classes/RadioButton/frame.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         opacity=self.OPACITY_IDLE,
         color=self.fixedColor)
     SpriteThemeColored(
         name='backgroundColorFill',
         bgParent=self,
         texturePath='res:/UI/Texture/Classes/RadioButton/innerGlow.png',
         colorType=uiconst.COLORTYPE_UIBASE,
         opacity=0.45)
Пример #3
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.texturePath = attributes.Get('texturePath',
                                       self.default_texturePath)
     self.color = attributes.Get('color', None)
     self.rotation = attributes.Get('rotation', self.default_rotation)
     self.iconOpacity = attributes.Get('iconOpacity',
                                       self.default_iconOpacity)
     self.gradientStrength = attributes.get('gradientStrength',
                                            self.default_gradientStrength)
     self.color = attributes.get('color', self.default_color)
     self._glowAmount = 0.0
     self.spriteEffect = None
     self.glowExpand = None
     self.icon = SpriteThemeColored(
         bgParent=self,
         name='icon',
         state=uiconst.UI_DISABLED,
         align=uiconst.TOALL,
         blendMode=trinity.TR2_SBM_ADD,
         opacity=self.iconOpacity,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         color=self.color,
         texturePath=self.texturePath,
         rotation=self.rotation)
     self.glowIcon = None
     self.bgGradient = None
Пример #4
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.btnData = attributes.btnData
     self.width = attributes.width
     self.controller = attributes.controller
     self._isDraggable = attributes.get('isDraggable',
                                        self.default_isDraggable)
     self._openNeocomPanel = None
     self.isDragging = False
     self.height = self.width
     self.SetCorrectPosition()
     self.panel = None
     self.blinkThread = None
     self.realTop = self.top
     self.dragEventCookie = None
     self.disableClick = False
     self.iconSize = self.height - 2 * self.PADVERTICAL
     self.iconTransform = uiprimitives.Transform(name='iconTransform',
                                                 parent=self,
                                                 align=uiconst.TOALL,
                                                 scalingCenter=(0.5, 0.5))
     self.iconLabelCont = None
     if self.btnData.id == 'map_beta' or self.btnData.id == 'map' and IsMapBetaExplicit(
     ):
         Sprite(parent=self.iconTransform,
                align=uiconst.TOPLEFT,
                pos=(0, 0, 11, 29),
                texturePath='res:/UI/Texture/Shared/betaTag.png',
                state=uiconst.UI_DISABLED)
     self.icon = GlowSprite(parent=self.iconTransform,
                            name='icon',
                            state=uiconst.UI_DISABLED,
                            align=uiconst.CENTER,
                            width=self.iconSize,
                            height=self.iconSize,
                            iconOpacity=1.0)
     self.UpdateIcon()
     PAD = 1
     self.blinkSprite = SpriteThemeColored(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.activeFrame = FrameThemeColored(
         bgParent=self,
         name='hoverFill',
         texturePath='res:/UI/Texture/classes/Neocom/buttonActive.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.CheckIfActive()
     self.dropFrame = uicontrols.Frame(parent=self,
                                       name='hoverFrame',
                                       color=util.Color.GetGrayRGBA(
                                           1.0, 0.5),
                                       state=uiconst.UI_HIDDEN)
     sm.RegisterNotify(self)
Пример #5
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     skinName = attributes.get('skinName', 'general')
     actualSkinClass = SKIN_NAME_TO_CLASS.get(skinName)
     if not FrameWithPointer.skinCache.get(skinName):
         FrameWithPointer.skinCache[skinName] = actualSkinClass()
     self.skin = FrameWithPointer.skinCache[skinName]
     self._pointer = SpriteThemeColored(texturePath='res:/UI/Texture/classes/FrameWithPointer/pointer_down_02.png', parent=self, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)
     self._background = FrameThemeColored(name='__underlay', bgParent=self, cornerSize=self.skin.backgroundCornerSize, offset=self.skin.backgroundOffset, texturePath=self.skin.backgroundTexture, colorType=attributes.colorType or uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.95)
Пример #6
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.achievementGroupID = attributes.achievementGroupID
     self.hexGridPosition = attributes.hexGridPosition
     self.nameLabel = InfoPanelLabel(parent=self.parent, state=uiconst.UI_DISABLED, align=uiconst.TOPLEFT, idx=0)
     self.stateSprite = GlowSprite(parent=self, pos=(0, 0, 20, 20), align=uiconst.CENTER, state=uiconst.UI_DISABLED)
     self.activeEffectSprite = SpriteThemeColored(parent=self, state=uiconst.UI_DISABLED, spriteEffect=trinity.TR2_SFX_MODULATE, blendMode=trinity.TR2_SBM_ADDX2, texturePath='res:/UI/Texture/classes/Achievements/hexPingGlow.png', textureSecondaryPath='res:/UI/Texture/classes/Achievements/hexPingMask.png', pos=(0, 0, 300, 300), align=uiconst.CENTER, opacity=0.0)
     self.activeStateSprite = SpriteThemeColored(parent=self, state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/classes/Achievements/hexActive.png', pos=(0, 0, 200, 200), align=uiconst.CENTER, opacity=0.0, blendMode=trinity.TR2_SBM_ADDX2, colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.backgroundSprite = SpriteThemeColored(bgParent=self, texturePath='res:/UI/Texture/classes/Achievements/hexBackIncomplete.png', colorType=uiconst.COLORTYPE_UIHILIGHTGLOW, opacity=0.5)
     self.UpdateGroupState()
Пример #7
0
 def ConstructBackground(self):
     self.mouseEnterBG = SpriteThemeColored(
         name='mouseEnterBG',
         bgParent=self.bgContainer,
         texturePath='res:/UI/Texture/classes/ButtonIcon/mouseEnter.png',
         opacity=0.0,
         color=self.colorSelected)
     self.mouseDownBG = SpriteThemeColored(
         name='mouseEnterBG',
         bgParent=self.bgContainer,
         texturePath='res:/UI/Texture/classes/ButtonIcon/mouseDown.png',
         opacity=0.0,
         color=self.colorSelected)
Пример #8
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.SetSliderLabel = attributes.get('setlabelfunc',
                                          self.default_setlabelfunc)
     self.GetSliderHint = attributes.get('gethintfunc', self.GetSliderHint)
     self.GetSliderValue = attributes.get('getvaluefunc',
                                          self.default_getvaluefunc)
     self.EndSetSliderValue = attributes.get('endsliderfunc',
                                             self.default_endsliderfunc)
     self.OnSetValue = attributes.get('onsetvaluefunc',
                                      self.default_onsetvaluefunc)
     self.value = None
     self.valueproportion = None
     self.increments = []
     self.label = None
     self.top = 0
     self.dragging = False
     self.valueHint = TooltipGeneric(parent=uicore.layer.hint, idx=0)
     self.valueHint.textLabel.align = uiconst.CENTER
     self.valueHint.textLabel.left = 0
     self.valueHint.textLabel.top = 0
     self.valueHint.display = False
     SpriteThemeColored(
         parent=self,
         name='handle',
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Slider/handle.png',
         align=uiconst.TOALL)
     Frame(parent=self.parent, color=(0.5, 0.5, 0.5, 0.3))
Пример #9
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.fixedColor = attributes.Get('color', self.default_fixedColor)
     self.isSelected = attributes.get('isSelected', self.default_isSelected)
     self.bgCont = Container(name='bgCont',
                             bgParent=self,
                             opacity=self.OPACITY_IDLE,
                             state=uiconst.UI_DISABLED,
                             idx=0)
     StretchSpriteVerticalThemeColored(
         name='edgeGlow',
         bgParent=self.bgCont,
         texturePath='res:/UI/Texture/shared/buttonEdgeGlowFrameBottom.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         blendMode=trinity.TR2_SBM_ADD,
         opacity=0.5,
         color=self.fixedColor,
         topEdgeSize=1,
         bottomEdgeSize=1)
     SpriteThemeColored(name='buttonGlow',
                        bgParent=self.bgCont,
                        texturePath='res:/UI/Texture/shared/buttonGlow.png',
                        colorType=uiconst.COLORTYPE_UIHILIGHT,
                        padding=-14,
                        opacity=0.15,
                        color=self.fixedColor)
     colorType = uiconst.COLORTYPE_UIBASECONTRAST if self.isSelected else uiconst.COLORTYPE_UIBASE
     self.underlay = FillThemeColored(bgParent=self,
                                      name='tabBackground',
                                      colorType=colorType,
                                      opacity=0.7)
Пример #10
0
 def ApplyAttributes(self, attributes):
     LayoutGrid.ApplyAttributes(self, attributes)
     EveLabelSmall(text=GetByLabel('Achievements/UI/active'), parent=self, align=uiconst.CENTERRIGHT)
     activeEffectSprite = SpriteThemeColored(parent=self, state=uiconst.UI_DISABLED, blendMode=trinity.TR2_SBM_ADDX2, texturePath='res:/UI/Texture/classes/Achievements/iconActiveLegend.png', pos=(0, 0, 20, 20))
     iconMap = [(GetByLabel('Achievements/UI/incomplete'), 'res:/UI/Texture/classes/Achievements/iconIncomplete.png'), (GetByLabel('Achievements/UI/partial'), 'res:/UI/Texture/classes/Achievements/iconPartial.png'), (GetByLabel('Achievements/UI/complete'), 'res:/UI/Texture/classes/Achievements/iconComplete.png')]
     for label, texturePath in iconMap:
         EveLabelSmall(text=label, parent=self, align=uiconst.CENTERRIGHT)
         GlowSprite(texturePath=texturePath, parent=self, pos=(0, 0, 20, 20))
Пример #11
0
 def ConstructBlinkBackground(self):
     if self.blinkBg:
         return
     self.blinkBg = SpriteThemeColored(
         name='blinkBG',
         bgParent=self.bgContainer,
         texturePath='res:/UI/Texture/classes/ButtonIcon/mouseEnter.png',
         opacity=0.0)
Пример #12
0
 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))
Пример #13
0
 def ApplyAttributes(self, attributes):
     SpriteThemeColored.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.isInFocus = attributes.Get('isInFocus', self.default_isInFocus)
     self.isPinned = attributes.Get('isPinned', self.default_isPinned)
     self.isCameraDragging = False
     if uicore.uilib.blurredBackBufferAtlas:
         self.texture.atlasTexture = uicore.uilib.blurredBackBufferAtlas
     trinity.device.RegisterResource(self)
     self.UpdateState()
Пример #14
0
 def OnMouseEnter(self, *args):
     if not self.callback:
         self.opacity = DISABLED_OPACITY
     else:
         self.opacity = MOUSEOVER_OPACITY
         uicore.Message('ListEntryEnter')
         if not self._hiliteSprite:
             self._hiliteSprite = SpriteThemeColored(parent=self, name='hiliteSprite', texturePath='res:/UI/Texture/classes/UtilMenu/entryHilite.png', opacity=0.0, padding=(1, 0, 1, 0), align=uiconst.TOALL, state=uiconst.UI_DISABLED)
         uicore.animations.FadeIn(self._hiliteSprite, 0.2, duration=uiconst.TIME_ENTRY)
         self.hiliteTimer = AutoTimer(1, self._CheckIfStillHilited)
Пример #15
0
 def AddBackgroundImage(self):
     self.backgroundImage = SpriteThemeColored(
         name='backgroundImage',
         parent=self.weekContParent,
         state=uiconst.UI_DISABLED,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         spriteEffect=trinity.TR2_SFX_BLUR,
         blendMode=trinity.TR2_SBM_ADDX2,
         texturePath=
         'res:/UI/Texture/classes/StructureDeployment/deploymentBg.png',
         opacity=0.02,
         align=uiconst.CENTER)
Пример #16
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     overlay = uiprimitives.Sprite(
         parent=self,
         name='overlay',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_overlay.png',
         color=(1.0, 1.0, 1.0, 0.39))
     self.sr.calibrationStatusPoly = uicls.Polygon(
         parent=self,
         name='calibrationStatusPoly',
         align=uiconst.CENTER,
         spriteEffect=trinity.TR2_SFX_FILL,
         blendMode=trinity.TR2_SBM_ADD)
     self.sr.powergridStatusPoly = uicls.Polygon(
         parent=self,
         name='powergridStatusPoly',
         align=uiconst.CENTER,
         spriteEffect=trinity.TR2_SFX_FILL,
         blendMode=trinity.TR2_SBM_ADD)
     self.sr.cpuStatusPoly = uicls.Polygon(
         parent=self,
         name='cpuStatusPoly',
         align=uiconst.CENTER,
         spriteEffect=trinity.TR2_SFX_FILL,
         blendMode=trinity.TR2_SBM_ADD)
     baseDOT = uiprimitives.Sprite(
         parent=self,
         name='baseDOT',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_dotproduct.png',
         spriteEffect=trinity.TR2_SFX_DOT,
         blendMode=trinity.TR2_SBM_ADD)
     self.sr.baseColor = SpriteThemeColored(
         parent=self,
         name='baseColor',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_basecircle.png',
         colorType=uiconst.COLORTYPE_UIBASE)
     self.sr.baseShape = uiprimitives.Sprite(
         parent=self,
         name='baseShape',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Fitting/fittingbase.png',
         color=(0.0, 0.0, 0.0, 0.86))
Пример #17
0
 def ConstructGlow(self):
     if not self.glowIcon:
         self.OnSizeUpdate()
         self.glowIcon = SpriteThemeColored(
             name='glowIcon',
             bgParent=self,
             state=uiconst.UI_DISABLED,
             colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
             spriteEffect=self.spriteEffect,
             padding=-self.glowExpand,
             blendMode=trinity.TR2_SBM_ADDX2,
             opacity=0.0,
             texturePath=self.texturePath,
             rotation=self.rotation,
             color=self.color)
         self.bgGradient = SpriteThemeColored(
             name='bgGradient',
             bgParent=self,
             texturePath='res:/UI/Texture/shared/circularGradient.png',
             opacity=0.0,
             padding=-self.glowExpand,
             color=self.color)
Пример #18
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     labelLeft = 22
     iconLeft = 3
     if attributes.indentation:
         labelLeft += attributes.indentation
         iconLeft += attributes.indentation
     self.label = EveLabelMedium(parent=self, text=attributes.text, align=uiconst.CENTERLEFT, left=labelLeft, state=uiconst.UI_DISABLED)
     icon = attributes.Get('icon', self.default_icon)
     if icon is not None:
         self.icon = SpriteThemeColored(parent=self, texturePath=icon, colorType=uiconst.COLORTYPE_UIHILIGHTGLOW, state=uiconst.UI_DISABLED, left=iconLeft, width=16, height=16, align=uiconst.CENTERLEFT, ignoreSize=True)
     self.ResetOpacity()
     self.UpdateEntryHeight()
Пример #19
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.isGlobal = bool(attributes.isGlobal)
     if not self.isGlobal:
         sm.GetService('gameui').DisableResourceLoadingIndicator()
     self.wheel = SpriteThemeColored(
         parent=self,
         align=uiconst.CENTER,
         pos=(0, 0, 48, 48),
         texturePath='res:/UI/Texture/loadingWheel.png',
         state=uiconst.UI_DISABLED,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=0.0)
     self.wheelfull = SpriteThemeColored(
         parent=self,
         align=uiconst.CENTER,
         pos=(0, 0, 48, 48),
         texturePath='res:/UI/Texture/loadingWheel_full.png',
         state=uiconst.UI_DISABLED,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=0.1)
     self.downloadingBar = FillThemeColored(
         parent=self,
         align=uiconst.BOTTOMLEFT,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.loadingBar = FillThemeColored(
         parent=self,
         align=uiconst.BOTTOMLEFT,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.queueBar = FillThemeColored(
         parent=self,
         align=uiconst.BOTTOMLEFT,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     uthread2.StartTasklet(self._Update_t)
Пример #20
0
 def Prepare_Handle_(self):
     self.handleOffset = 2
     self.handle = SpriteThemeColored(
         name='diode',
         parent=self.barCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_NORMAL,
         pos=(-self.handleOffset, 0, 12, 12),
         idx=0,
         texturePath='res:/UI/Texture/classes/Slider/handle.png')
     self.handle.OnMouseEnter = self.OnHandleMouseEnter
     self.handle.OnMouseExit = self.OnHandleMouseExit
     self.handle.OnMouseDown = self.OnHandleMouseDown
     self.handle.OnMouseUp = self.OnHandleMouseUp
     self.handle.OnMouseMove = self.OnHandleMouseMove
Пример #21
0
def CreateSectionContainer(parent):
    Line(parent=parent, align=uiconst.TOTOP, color=LINE_COLOR)
    container = ContainerAutoSize(parent=parent,
                                  align=uiconst.TOTOP,
                                  alignMode=uiconst.TOTOP,
                                  state=uiconst.UI_PICKCHILDREN,
                                  bgColor=BACKGROUND_GRAY_COLOR)
    Line(parent=parent, align=uiconst.TOTOP, color=LINE_COLOR)
    SpriteThemeColored(
        bgParent=container,
        name='blinkSprite',
        texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
        state=uiconst.UI_HIDDEN,
        colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
    return container
Пример #22
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.cmdName = attributes.cmdName
     self._openNeocomPanel = None
     self.cmd = uicore.cmd.commandMap.GetCommandByName(attributes.cmdName)
     self.blinkThread = None
     self.isBlinking = False
     self.mouseHoverSprite = SpriteThemeColored(
         parent=self,
         name='mouseHoverSprite',
         align=uiconst.TOALL,
         texturePath='res:/UI/Texture/classes/Neocom/eveButtonBg.png',
         blendMode=trinity.TR2_SBM_ADD,
         state=uiconst.UI_HIDDEN,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
     self.mouseHoverSprite.Hide()
     self.blinkSprite = SpriteThemeColored(
         parent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOALL,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
Пример #23
0
 def ApplyAttributes(self, attributes):
     WrapperButton.ApplyAttributes(self, attributes)
     self.btnData = attributes.btnData
     GlowSprite(parent=self,
                name='EVEMenuIcon',
                align=uiconst.CENTER,
                state=uiconst.UI_DISABLED,
                texturePath='res:/UI/Texture/Icons/79_64_11.png',
                width=20,
                height=20,
                idx=0)
     SpriteThemeColored(
         bgParent=self,
         align=uiconst.TOALL,
         texturePath='res:/UI/Texture/classes/Neocom/panelEntryBG.png',
         colorType=uiconst.COLORTYPE_UIHILIGHT)
Пример #24
0
 def ApplyAttributes(self, attributes):
     ProbeTooltipButtonBase.ApplyAttributes(self, attributes)
     width = attributes.width or 128
     icon = SpriteThemeColored(texturePath=attributes.texturePath,
                               pos=(0, 0, 17, 17),
                               align=uiconst.CENTER,
                               colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
                               state=uiconst.UI_DISABLED)
     self.AddCell(icon, cellPadding=(5, 3, 4, 3))
     self.label = EveLabelSmall(text=attributes.text,
                                bold=True,
                                align=uiconst.CENTERLEFT,
                                autoFitToText=True,
                                width=width)
     self.AddCell(self.label,
                  colSpan=self.columns - 1,
                  cellPadding=(0, 2, 10, 2))
Пример #25
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.OnChange = attributes.get('callback', None)
     self.checked = False
     self.checkMark = Sprite(
         parent=self,
         pos=(0, 0, 16, 16),
         name='self_ok',
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/Shared/checkboxChecked.png')
     self.underlay = SpriteThemeColored(
         name='frame',
         bgParent=self,
         colorType=uiconst.COLORTYPE_UIHILIGHT,
         blendMode=trinity.TR2_SBM_ADD,
         texturePath='res:/UI/Texture/Shared/checkbox_comp.png',
         opacity=0.2,
         padding=2)
Пример #26
0
    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
Пример #27
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     Sprite(parent=self,
            name='mainDot',
            pos=(0, 0, SIZE, SIZE),
            align=uiconst.CENTER,
            state=uiconst.UI_DISABLED,
            texturePath=self.dotTexturePath,
            spriteEffect=trinity.TR2_SFX_DOT,
            blendMode=trinity.TR2_SBM_ADD)
     self.shipuiMainShape = SpriteThemeColored(
         parent=self,
         name='shipuiMainShape',
         pos=(0, 0, SIZE, SIZE),
         align=uiconst.CENTER,
         state=uiconst.UI_DISABLED,
         texturePath=self.mainTexturePath,
         opacity=1.0,
         colorType=uiconst.COLORTYPE_UIBASE)
Пример #28
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.scaleFactor = GetScaleFactor()
     self.baseShapeSize = GetBaseShapeSize()
     self.width = self.baseShapeSize
     self.height = self.baseShapeSize
     overlay = uiprimitives.Sprite(
         parent=self,
         name='overlay',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_overlay.png',
         color=(1.0, 1.0, 1.0, 0.39))
     radius = int(self.baseShapeSize * 0.885 / 2)
     self.calibrationGauge = CalibrationGauge(parent=self, radius=radius)
     self.powerGauge = PowergridGauge(parent=self, radius=radius)
     self.cpuGauge = CPUGauge(parent=self, radius=radius)
     baseDOT = uiprimitives.Sprite(
         parent=self,
         name='baseDOT',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_dotproduct.png',
         spriteEffect=trinity.TR2_SFX_DOT,
         blendMode=trinity.TR2_SBM_ADD)
     self.sr.baseColor = SpriteThemeColored(
         parent=self,
         name='baseColor',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath=
         'res:/UI/Texture/classes/Fitting/fittingbase_basecircle.png',
         colorType=uiconst.COLORTYPE_UIBASE)
     self.sr.baseShape = uiprimitives.Sprite(
         parent=self,
         name='baseShape',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Fitting/fittingbase.png',
         color=(0.0, 0.0, 0.0, 0.86))
Пример #29
0
 def ApplyAttributes(self, attributes):
     Container.ApplyAttributes(self, attributes)
     self.label = LabelThemeColored(
         parent=self,
         state=uiconst.UI_DISABLED,
         fontsize=eveFontConst.EVE_MEDIUM_FONTSIZE,
         align=uiconst.CENTERLEFT,
         left=5)
     FrameThemeColored(bgParent=self,
                       colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
                       opacity=0.25,
                       frameConst=uiconst.FRAME_BORDER1_CORNER1)
     SpriteThemeColored(
         parent=self,
         texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png',
         pos=(5, -1, 7, 7),
         align=uiconst.CENTERRIGHT,
         colorType=uiconst.COLORTYPE_UIHILIGHTGLOW,
         opacity=0.5,
         state=uiconst.UI_DISABLED)
     self.SetText(attributes.text)
Пример #30
0
class WrapperButton(uiprimitives.Container):
    """
    Adds button functionality to clock and character containers
    """
    __guid__ = 'neocom.WrapperButton'
    __notifyevents__ = ['ProcessNeocomBlinkPulse']
    default_name = 'WrapperButton'
    default_state = uiconst.UI_NORMAL

    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        sm.RegisterNotify(self)
        self.cmdName = attributes.cmdName
        self._openNeocomPanel = None
        self.cmd = uicore.cmd.commandMap.GetCommandByName(attributes.cmdName)
        self.blinkThread = None
        self.isBlinking = False
        self.mouseHoverSprite = SpriteThemeColored(
            parent=self,
            name='mouseHoverSprite',
            align=uiconst.TOALL,
            texturePath='res:/UI/Texture/classes/Neocom/eveButtonBg.png',
            blendMode=trinity.TR2_SBM_ADD,
            state=uiconst.UI_HIDDEN,
            colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)
        self.mouseHoverSprite.Hide()
        self.blinkSprite = SpriteThemeColored(
            parent=self,
            name='blinkSprite',
            texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
            state=uiconst.UI_HIDDEN,
            align=uiconst.TOALL,
            colorType=uiconst.COLORTYPE_UIHILIGHTGLOW)

    def OnClick(self, *args):
        self.cmd.callback()
        self.DisableBlink()

    def OnDblClick(self, *args):
        """ Swallow double click event so that we don't get two OnClick events """
        pass

    def OnMouseEnter(self, *args):
        self.DisableBlink()
        self.mouseHoverSprite.state = uiconst.UI_DISABLED
        uicore.animations.SpMaskIn(self.mouseHoverSprite, duration=0.5)

    def OnMouseExit(self, *args):
        uicore.animations.SpMaskOut(self.mouseHoverSprite,
                                    duration=0.5,
                                    callback=self.mouseHoverSprite.Hide)

    def LoadTooltipPanel(self, tooltipPanel, *args):
        isOpen = self._openNeocomPanel and not self._openNeocomPanel.destroyed
        if isOpen:
            return
        tooltipPanel.LoadGeneric3ColumnTemplate()
        tooltipPanel.AddCommandTooltip(self.cmd)
        if self.cmdName == 'OpenCalendar':
            timeLabel = localization.formatters.FormatDateTime(
                blue.os.GetTime(), dateFormat='full', timeFormat=None)
            tooltipPanel.AddLabelMedium(text=timeLabel,
                                        colSpan=tooltipPanel.columns)
        elif self.cmdName == 'OpenSkillQueueWindow':
            trainingHintLabel = tooltipPanel.AddLabelMedium(
                text='', colSpan=tooltipPanel.columns)
            tooltipPanel.trainingHintLabel = trainingHintLabel
            self.UpdateSkillQueueTooltip_thread(tooltipPanel)
            self._skillqueueTooltipUpdate = AutoTimer(
                1000, self.UpdateSkillQueueTooltip_thread, tooltipPanel)

    def UpdateSkillQueueTooltip_thread(self, tooltipPanel):
        if tooltipPanel.destroyed:
            self._skillqueueTooltipUpdate = None
            return
        skill = sm.GetService('skills').SkillInTraining()
        if skill is None or skill.skillTrainingEnd is None:
            trainingHint = localization.GetByLabel('UI/Neocom/NoSkillHint')
        else:
            secUntilDone = max(
                0L,
                long(skill.skillTrainingEnd) - blue.os.GetTime())
            trainingHint = localization.GetByLabel(
                'UI/Neocom/SkillTrainingHint',
                skillName=skill.name,
                skillLevel=skill.skillLevel + 1,
                time=secUntilDone)
        tooltipPanel.trainingHintLabel.text = trainingHint

    def EnableBlink(self):
        self.isBlinking = True

    def DisableBlink(self):
        self.isBlinking = False

    def BlinkOnce(self):
        self.blinkSprite.state = uiconst.UI_DISABLED
        uicore.animations.SpSwoopBlink(self.blinkSprite, duration=0.7)

    def ProcessNeocomBlinkPulse(self):
        if self.isBlinking:
            self.BlinkOnce()

    def GetMenu(self):
        return sm.GetService('neocom').GetMenu()