Exemple #1
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     size = 24
     self.ramps = uicls.Container(parent=self,
                                  name='ramps',
                                  pos=(0, 0, size, size),
                                  align=uiconst.TOPLEFT,
                                  state=uiconst.UI_DISABLED)
     leftRampCont = uicls.Container(parent=self.ramps,
                                    name='leftRampCont',
                                    pos=(0, 0, size / 2, size),
                                    align=uiconst.TOPLEFT,
                                    state=uiconst.UI_DISABLED,
                                    clipChildren=True)
     self.leftRamp = uicls.Transform(parent=leftRampCont,
                                     name='leftRamp',
                                     pos=(0, 0, size, size),
                                     align=uiconst.TOPLEFT,
                                     state=uiconst.UI_DISABLED)
     uicls.Sprite(
         parent=self.leftRamp,
         name='rampSprite',
         pos=(0, 0, size / 2, size),
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/TiDiIndicator/left.png',
         color=(0, 0, 0, 0.5))
     rightRampCont = uicls.Container(parent=self.ramps,
                                     name='rightRampCont',
                                     pos=(0, 0, size / 2, size),
                                     align=uiconst.TOPRIGHT,
                                     state=uiconst.UI_DISABLED,
                                     clipChildren=True)
     self.rightRamp = uicls.Transform(parent=rightRampCont,
                                      name='rightRamp',
                                      pos=(-size / 2, 0, size, size),
                                      align=uiconst.TOPLEFT,
                                      state=uiconst.UI_DISABLED)
     uicls.Sprite(
         parent=self.rightRamp,
         name='rampSprite',
         pos=(size / 2, 0, size / 2, size),
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/TiDiIndicator/right.png',
         color=(0, 0, 0, 0.5))
     self.coloredPie = uicls.Sprite(
         parent=self,
         name='tidiColoredPie',
         pos=(0, 0, size, size),
         texturePath='res:/UI/Texture/classes/TiDiIndicator/circle.png',
         state=uiconst.UI_DISABLED,
         color=(1, 1, 1, 0.5))
Exemple #2
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 = uicls.Transform(parent=self.spriteCont,
                                              align=uiconst.CENTER,
                                              pos=(0, 0, 128, 128))
         self.mainSprite = uicls.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 = uicls.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'))
         uicls.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
Exemple #3
0
 def DrawPointer(self, alignToTop):
     pointerWidth = DOCK_POINTER_LENGTH * 2
     pointerSideWidth = int(DOCK_POINTER_LENGTH * 2 / sqrt(2))
     pointerSideWidthHalf = pointerSideWidth / 2
     if alignToTop:
         clipperAlign = uiconst.CENTERTOP
         transformAlign = uiconst.CENTERBOTTOM
     else:
         clipperAlign = uiconst.CENTERBOTTOM
         transformAlign = uiconst.CENTERTOP
     clipperCont = uicls.Container(name='clipper',
                                   parent=self,
                                   width=pointerWidth,
                                   height=DOCK_POINTER_LENGTH,
                                   clipChildren=True,
                                   align=clipperAlign,
                                   top=-DOCK_POINTER_LENGTH)
     transform = uicls.Transform(name='transform',
                                 parent=clipperCont,
                                 align=transformAlign,
                                 rotation=pi / 4,
                                 width=pointerSideWidth,
                                 height=pointerSideWidth,
                                 top=-pointerSideWidthHalf)
     uicls.Fill(bgParent=transform, color=BGCOLOR)
Exemple #4
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.btnData = attributes.btnData
     self.btnNum = attributes.btnNum
     self.width = attributes.width
     self._isDraggable = attributes.get('isDraggable',
                                        self.default_isDraggable)
     self._openNeocomPanel = None
     self.height = self.width
     self.top = self.height * self.btnNum
     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 = uicls.Transform(name='iconTransform',
                                          parent=self,
                                          align=uiconst.TOALL,
                                          scalingCenter=(0.5, 0.5))
     self.iconLabelCont = None
     self.icon = uicls.Sprite(parent=self.iconTransform,
                              name='icon',
                              state=uiconst.UI_DISABLED,
                              align=uiconst.CENTER,
                              width=self.iconSize,
                              height=self.iconSize)
     self.UpdateIcon()
     PAD = 1
     self.mouseHoverFrame = uicls.Sprite(
         bgParent=self,
         name='mouseHoverFrame',
         texturePath='res:/UI/Texture/classes/Neocom/buttonHover.png',
         state=uiconst.UI_HIDDEN)
     self.blinkSprite = uicls.Sprite(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonBlink.png',
         state=uiconst.UI_HIDDEN)
     self.mouseDownFrame = uicls.Frame(
         bgParent=self,
         name='mosueDownFrame',
         texturePath='res:/UI/Texture/classes/Neocom/buttonDown.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN)
     self.activeFrame = uicls.Frame(
         bgParent=self,
         name='hoverFill',
         texturePath='res:/UI/Texture/classes/Neocom/buttonActive.png',
         cornerSize=5,
         state=uiconst.UI_HIDDEN)
     self.CheckIfActive()
     self.dropFrame = uicls.Frame(parent=self,
                                  name='hoverFrame',
                                  color=util.Color.GetGrayRGBA(1.0, 0.5),
                                  state=uiconst.UI_HIDDEN)
     sm.RegisterNotify(self)
Exemple #5
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.pinned = False
     self.isSelected = False
     self.safetyLevel = attributes.get('safetyLevel')
     self.data = SAFETY_LEVEL_DATA_MAP[self.safetyLevel]
     self.SetHint(localization.GetByLabel(self.data.safetySelectionHint))
     cont = uicls.Container(name='content', parent=self, padding=3)
     self.text = uicls.EveHeaderSmall(name='buttonLabel',
                                      parent=cont,
                                      color=self.data.color.GetRGBA(),
                                      text=localization.GetByLabel(
                                          self.data.buttonText),
                                      align=uiconst.CENTER,
                                      opacity=DESELECTED_BUTTON_OPACITY,
                                      bold=True)
     self.defaultSprite = uicls.Sprite(
         parent=self,
         name='default',
         texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Default.png',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         color=self.data.color.GetRGBA(),
         opacity=DESELECTED_BUTTON_OPACITY)
     self.highlightSprite = uicls.Sprite(
         parent=self,
         name='highlight',
         texturePath='res:/UI/Texture/Crimewatch/SafetyButton_Highlight.png',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         color=self.data.color.GetRGBA())
     self.highlightSprite.Hide()
     self.leftArrowSprite = uicls.Sprite(
         parent=self,
         name='leftArrows',
         texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png',
         align=uiconst.CENTERLEFT,
         pos=(-24, 0, 16, 13),
         state=uiconst.UI_DISABLED,
         color=self.data.color.GetRGBA(),
         opacity=0.0)
     self.rightArrows = uicls.Transform(parent=self,
                                        name='rightArrowsTranform',
                                        align=uiconst.CENTERRIGHT,
                                        pos=(-24, 0, 16, 13),
                                        state=uiconst.UI_DISABLED,
                                        rotation=pi)
     self.rightArrowSprite = uicls.Sprite(
         parent=self.rightArrows,
         name='rightArrows',
         texturePath='res:/UI/Texture/Crimewatch/Safety_Selection.png',
         align=uiconst.CENTERRIGHT,
         pos=(0, 0, 16, 13),
         state=uiconst.UI_DISABLED,
         color=self.data.color.GetRGBA(),
         opacity=0.0)
Exemple #6
0
 def ApplyAttributes(self, attributes):
     uicls.Transform.ApplyAttributes(self, attributes)
     groupParent = uicls.Transform(parent=self,
                                   name='groupParent',
                                   pos=(-10, 14, 16, 16),
                                   align=uiconst.CENTER,
                                   state=uiconst.UI_PICKCHILDREN)
     groupMark = uicls.Icon(parent=groupParent,
                            name='groupMark',
                            pos=(0, 0, 20, 20),
                            align=uiconst.TOPLEFT)
     iconParent = uicls.Transform(parent=self,
                                  name='iconParent',
                                  align=uiconst.TOPLEFT,
                                  state=uiconst.UI_DISABLED,
                                  pos=(0, 0, self.width, self.height))
     icon = uicls.Icon(parent=iconParent,
                       name='icon',
                       pos=(8, 8, 8, 8),
                       align=uiconst.TOALL,
                       state=uiconst.UI_NORMAL)
     underlay = uicls.Icon(parent=self,
                           name='underlay',
                           align=uiconst.TOALL,
                           state=uiconst.UI_DISABLED,
                           padding=(-10, -5, -10, -5),
                           icon='ui_81_64_1',
                           filter=True)
     chargeIndicator = uicls.Icon(parent=self,
                                  name='chargeIndicator',
                                  padTop=-2,
                                  height=7,
                                  align=uiconst.TOTOP,
                                  state=uiconst.UI_HIDDEN,
                                  icon='ui_81_64_2',
                                  ignoreSize=True)
     chargeIndicator.rectWidth = 44
     chargeIndicator.rectHeight = 7
     self.sr.underlay = underlay
     self.sr.chargeIndicator = chargeIndicator
     self.sr.flagIcon = icon
     self.sr.groupMark = groupMark
Exemple #7
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.callback = attributes.get('callback', self.default_callback)
     self.speed = attributes.get('speed', self.default_speed)
     text = attributes.get('text', self.default_text)
     self.rollInColor = attributes.get('color', self.default_color)
     self.rollOutColor = self.rollInColor
     self.scrollOut = uicls.Transform(parent=self,
                                      align=uiconst.TOPLEFT,
                                      height=self.height)
     self.scrollOutText = uicls.EveCaptionLarge(text=text,
                                                parent=self.scrollOut,
                                                align=uiconst.TOLEFT,
                                                color=(1, 1, 1, 1))
     self.scrollIn = uicls.Transform(parent=self,
                                     align=uiconst.TOPLEFT,
                                     height=self.height)
     self.scrollInText = uicls.EveCaptionLarge(text='',
                                               parent=self.scrollIn,
                                               align=uiconst.TOLEFT,
                                               color=(1, 1, 1, 1))
     self.scrolling = False
Exemple #8
0
    def LoadOptions(self, options, activeOptionIndex=0):
        for each in self.sr.mainTransform.children[:]:
            if each.name == 'tick':
                each.Close()

        self._options = options
        step = math.pi * 2 / len(self._options)
        self._tickGap = step
        angle = 0.0
        activeRotation = 0.0
        for i, each in enumerate(self._options):
            isZero, args = each
            markerTransform = uicls.Transform(parent=self.sr.mainTransform,
                                              pos=(0, 0, self.MARKERTFSIZE,
                                                   self.MARKERTFSIZE),
                                              align=uiconst.CENTER,
                                              state=uiconst.UI_DISABLED,
                                              name='tick',
                                              rotation=angle + math.pi * 0.25,
                                              idx=0)
            sprite = uicls.Sprite(
                parent=markerTransform,
                align=uiconst.TOPRIGHT,
                pos=(0, 0, 16, 16),
                color=(0.0, 0.0, 0.0, 1.0),
                texturePath='res:/UI/Texture/spinWheelPicker_marker2.dds')
            if i == activeOptionIndex:
                activeRotation = angle
            angle += step
            if isZero:
                sprite.texture.resPath = 'res:/UI/Texture/CharacterCreation/ovalSlider_Filler.dds'
                sprite.SetRGB(1.0, 0.0, 0.0)
                sprite.top = 2
                sprite.left = 2

        if activeRotation:

            def UpdateMarker(_None, newAngle):
                self.sr.mainTransform.SetRotation(newAngle)

            currentAngle = self.sr.mainTransform.GetRotation()
            uicore.effect.MorphUIMassSpringDamper(None,
                                                  None,
                                                  activeRotation,
                                                  newthread=False,
                                                  frequency=15.0,
                                                  dampRatio=0.5,
                                                  callback=UpdateMarker,
                                                  initVal=currentAngle)
        self.SettleOnTick()
Exemple #9
0
    def ApplyAttributes(self, attributes):
        uicls.Container.ApplyAttributes(self, attributes)
        self._spinning = False
        self._lastAngle = 0.0
        self._tickGap = 0.0
        self._options = None
        self._value = None
        self._lastRotationDelta = None
        self._didSpin = False
        self._wheelbuffer = 0
        self._wheeling = False
        for each in uicore.layer.main.children[:]:
            if each.name == self.default_name:
                each.Close()

        if attributes.parent is None:
            uicore.layer.main.children.append(self)
        transform = uicls.Transform(parent=self,
                                    pos=(0, 0, self.TEXTURESIZE,
                                         self.TEXTURESIZE),
                                    align=uiconst.CENTER,
                                    state=uiconst.UI_DISABLED,
                                    name='mainTransform')
        self.sr.mainTransform = transform
        sprite = uicls.Sprite(
            parent=transform,
            align=uiconst.TOALL,
            texturePath='res:/UI/Texture/spinWheelPicker_main.dds')
        self.sr.mainTransform = transform
        self.sr.marker = uicls.Fill(parent=self,
                                    align=uiconst.CENTER,
                                    pos=(0, -64, 2, 16),
                                    color=(1.0, 1.0, 1.0, 1.0),
                                    idx=0)
        options = attributes.Get('options',
                                 [(True, None)] + [(False, i)
                                                   for i in xrange(60)])
        activeOptionIndex = attributes.Get('activeOptionIndex', 4)
        self.LoadOptions(options, activeOptionIndex)
        setvalueCallback = attributes.Get('OnSetValue', None)
        if setvalueCallback:
            self.OnSetValue = setvalueCallback
Exemple #10
0
    def ApplyAttributes(self, attributes):
        uicls.Container.ApplyAttributes(self, attributes)
        self.entityID = attributes.entityID
        self.cursor = uiconst.UICURSOR_SELECT
        self.hoverFill = uicls.Fill(parent=self,
                                    color=(1.0, 1.0, 1.0, 0.0),
                                    padding=-50)
        uicls.ScreenFrame1(parent=self, align=uiconst.TOALL, padding=10)
        self.circles = []
        for i in xrange(1, 5):
            transform = uicls.Transform(parent=self,
                                        align=uiconst.CENTER,
                                        state=uiconst.UI_DISABLED,
                                        width=540,
                                        height=540,
                                        top=-26)
            circle = uicls.Sprite(
                parent=transform,
                texturePath='res:/UI/Texture/Classes/CQSideScreens/circle%s.png'
                % i,
                align=uiconst.TOALL)
            self.circles.append(transform)

        self.hoverLabel = uicls.Label(
            name='hoverLabel',
            parent=self,
            text=localization.GetByLabel('UI/Common/LocationTypes/Planets'),
            align=uiconst.CENTERBOTTOM,
            top=60,
            uppercase=True,
            fontsize=35,
            state=uiconst.UI_DISABLED,
            color=util.Color.WHITE)
        self.hoverLabel.opacity = 0.0
        self.bgSprite = uicls.Sprite(
            parent=self,
            texturePath='res:/UI/Texture/Classes/CQSideScreens/PIScreenBG.png',
            align=uiconst.TOALL,
            state=uiconst.UI_DISABLED,
            padding=-50)
        uthread.new(self.AnimCircles)
Exemple #11
0
 def _Minimize(self, animate = True):
     if self.destroyed or self.IsMinimized():
         return
     self.OnStartMinimize_(self)
     self._changing = True
     self._SetMinimized(True)
     uicore.registry.CheckMoveActiveState(self)
     if animate:
         x, y = sm.GetService('neocom').GetMinimizeToPos(self)
         x = float(x) / uicore.desktop.width
         y = float(y) / uicore.desktop.height
         t = uicls.Transform(parent=uicore.layer.main, state=uiconst.UI_DISABLED, align=uiconst.TOALL, scalingCenter=(x, y), idx=0)
         wasCacheContent = self.cacheContents
         self.cacheContents = False
         self.SetParent(t)
         uicore.animations.Tr2DFlipOut(t, duration=0.3)
         uicore.animations.FadeOut(t, duration=0.25, sleep=True)
         self.SetParent(uicore.layer.main)
         self.cacheContents = wasCacheContent
         t.Close()
     self.state = uiconst.UI_HIDDEN
     self.OnEndMinimize_(self)
     self._changing = False
     sm.ScatterEvent('OnWindowMinimized', self)
Exemple #12
0
    def _AddTarget(self, dock=False, flush=False):
        import random
        dockCounter = 0
        if flush:
            for each in self.children[:]:
                if isinstance(each,
                              uicls.StretchLine) or each.name == 'targetTest':
                    each.Close()
                else:
                    for child in each.children[:]:
                        if child.name == 'targetTest':
                            child.Close()

            for each in self.children[:]:
                if each.name == 'targetTest':
                    each.Close()

        else:
            for each in self.parent.children:
                if each.name == 'targetTest':
                    dockCounter += 1

        inTime = 0.5
        curveSet = trinity.TriCurveSet()
        curveSet.scale = 1.0
        par = uicls.Container(parent=self,
                              name='targetTest',
                              left=100,
                              top=0,
                              align=uiconst.TOPLEFT,
                              width=300,
                              height=128,
                              idx=0)
        mainParent = uicls.Container(parent=par,
                                     name='mainParent',
                                     align=uiconst.RELATIVE,
                                     width=200,
                                     height=64,
                                     top=32,
                                     left=96)
        maintext = uicls.Sprite(
            parent=mainParent,
            texturePath='res:/ui/sprite/carbontest/text.dds',
            left=96.0,
            width=200,
            height=64,
            effect=trinity.S2D_RFX_BLUR)
        caption = uicls.Sprite(
            parent=mainParent,
            texturePath='res:/ui/sprite/carbontest/caption.dds',
            left=50,
            top=56,
            width=160,
            height=32,
            effect=trinity.S2D_RFX_BLUR)
        bracket = uicls.Sprite(
            parent=mainParent,
            texturePath='res:/ui/sprite/carbontest/brackettext.dds',
            left=200,
            top=56,
            width=100,
            height=32,
            effect=trinity.S2D_RFX_BLUR)
        scrolltext = uicls.Label(parent=mainParent,
                                 text='0123456789',
                                 align=uiconst.TOPLEFT,
                                 left=237,
                                 top=7,
                                 fontsize=9,
                                 color=(1.0, 1.0, 1.0, 0.5))
        curve, binding = self.CreateColorCurve(bracket,
                                               curveSet,
                                               length=0.5,
                                               startValue=(1, 1, 1, 1),
                                               endValue=(1, 1, 1, 0),
                                               cycle=True)
        curve.AddKey(0.0, (1, 1, 1, 0.0))
        curve.AddKey(0.1, (1, 1, 1, 1))
        curve.AddKey(0.5, (1, 1, 1, 0.0))
        self.AddBinding(curve, 'currentValue', caption, 'color', curveSet)
        curve, binding = self.CreateScalarCurve(mainParent,
                                                'currentValue',
                                                'displayX',
                                                curveSet,
                                                length=inTime,
                                                startValue=-500.0,
                                                endValue=0.0,
                                                endTangent=-1000.0,
                                                cycle=False)
        correction = 0.0
        innerTransform = uicls.Transform(parent=par, idx=0, left=8, top=8)
        innerTransform.rotationCenter = (64, 64)
        inner = uicls.Sprite(
            parent=innerTransform,
            pos=(0, 0, 128, 128),
            texturePath='res:/ui/sprite/carbontest/innercircles.dds',
            blurFactor=0.1,
            filter=True)
        curve, binding = self.CreatePerlinCurve(innerTransform,
                                                'value',
                                                'rotation',
                                                curveSet,
                                                scale=10.025)
        outerTransform = uicls.Transform(parent=par, idx=0, left=8, top=8)
        outerTransform.rotationCenter = (64, 64)
        outer = uicls.Sprite(
            parent=outerTransform,
            pos=(0, 0, 128, 128),
            texturePath='res:/ui/sprite/carbontest/outercircles.dds',
            blurFactor=0.1,
            filter=True)
        curve, binding = self.CreatePerlinCurve(outerTransform,
                                                'value',
                                                'rotation',
                                                curveSet,
                                                scale=10.00125)
        uicore.desktop.GetRenderObject().curveSets.append(curveSet)
        curveSet.Play()
Exemple #13
0
 def Load(self):
     self.districtID = self.district['districtID']
     self.planetID = self.district['planetID']
     self.latitude = self.district['latitude']
     self.longitude = self.district['longitude']
     self.planet = sm.GetService('michelle').GetBallpark(
         session.solarsystemid).balls[self.planetID]
     self.point = planet.SurfacePoint(phi=self.latitude,
                                      theta=self.longitude)
     self.name = 'DistrictBracket_%d' % self.districtID
     self.destrictGfxID = self.planet.GetDistrictNum('district-%d' %
                                                     self.districtID)
     if self.container:
         self.container.Close()
     self.container = ui3d.Container(
         scene=sm.GetService('sceneManager').GetRegisteredScene('default'),
         name=self.name,
         width=512,
         height=512,
         clearBackground=True,
         backgroundColor=(0, 0, 0, 0))
     self.container.transform.translationCurve = self.planet.model.translationCurve
     self.container.transform.translation = geo2.Vec3Scale(
         geo2.Vec3Normalize(self.point.GetAsXYZTuple()), self.planet.radius)
     self.container.transform.scaling = (1000000, 1000000, 1000000)
     self.container.transform.rotation = geo2.QuaternionRotationSetYawPitchRoll(
         -self.longitude + math.pi / 2, self.latitude - math.pi / 2, 0)
     self.hover = uicls.Container(parent=self.container,
                                  align=uiconst.CENTER,
                                  state=uiconst.UI_NORMAL,
                                  opacity=1,
                                  width=512,
                                  height=512)
     self.hover.OnMouseEnter = self.OnMouseEnter
     self.hover.OnMouseExit = self.OnMouseExit
     self.hover.OnClick = self.OnClick
     self.transform = uicls.Transform(parent=self.hover,
                                      align=uiconst.TOALL,
                                      rotation=0,
                                      scalingCenter=(0.5, 0.5))
     uicore.animations.MorphScalar(self.transform,
                                   'rotation',
                                   startVal=0,
                                   endVal=math.pi / 2,
                                   duration=10,
                                   loops=uiconst.ANIM_REPEAT,
                                   curveType=uiconst.ANIM_LINEAR)
     self.frame = self.Corners(
         parent=self.transform,
         image='res:/UI/Texture/Bombardment/district_bracket_frame.png',
         boxSize=450,
         cornerSize=170,
         opacity=0.0)
     self.arrows_transform = uicls.Transform(parent=self.transform,
                                             align=uiconst.TOALL,
                                             rotation=0,
                                             scalingCenter=(0.5, 0.5))
     self.arrows = self.Corners(
         parent=self.arrows_transform,
         image='res:/UI/Texture/Bombardment/target_triangle.png',
         boxSize=300,
         cornerSize=30,
         opacity=0.0)
     self.Redraw()
Exemple #14
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.hintClass = attributes.get('hintClass', self.default_hintClass)
     self.state = uiconst.UI_PICKCHILDREN
     self.timerHint = None
     self.showHint = False
     self.expiryTime = None
     self.iconBlink = None
     self.rewind = False
     self.ratio = 0.0
     self.counterText = None
     self.animationThread = None
     self.timerData = CRIMEWATCH_TIMER_DATA[attributes.Get('timerType')]
     self.GetTime = self.timerData.timerFunc
     self.activeAnimationCurves = None
     self.content = uicls.Transform(parent=self,
                                    name='content',
                                    align=uiconst.TOPLEFT,
                                    pos=(0, 0, 32, 32),
                                    state=uiconst.UI_NORMAL)
     self.circleSprite = uicls.Sprite(
         name='icon',
         parent=self.content,
         pos=(0, 0, 32, 32),
         texturePath='res:/UI/Texture/Crimewatch/Crimewatch_TimerCircle.png',
         color=self.timerData.color,
         state=uiconst.UI_DISABLED,
         align=uiconst.CENTER,
         opacity=ALPHA_EMPTY)
     self.content.OnMouseEnter = self.OnMouseEnter
     self.iconTransform = uicls.Transform(parent=self.content,
                                          name='iconTransform',
                                          align=uiconst.CENTER,
                                          width=16,
                                          height=16,
                                          state=uiconst.UI_DISABLED)
     self.icon = uicls.Sprite(name='icon',
                              parent=self.iconTransform,
                              pos=(0, 0, 16, 16),
                              texturePath=self.timerData.icon,
                              color=self.timerData.color,
                              state=uiconst.UI_DISABLED,
                              align=uiconst.CENTER)
     self.halfCircleSprite = uicls.Sprite(
         name='half_circle',
         parent=self.content,
         width=32,
         height=32,
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerHalfCircle.png',
         color=self.timerData.color,
         state=uiconst.UI_DISABLED)
     self.clipContainer = uicls.Container(name='clipper',
                                          parent=self.content,
                                          width=16,
                                          align=uiconst.TOLEFT,
                                          clipChildren=True,
                                          state=uiconst.UI_DISABLED)
     self.cycleContainer = uicls.Transform(name='cycle_container',
                                           parent=self.clipContainer,
                                           width=32,
                                           height=32)
     self.cycleSprite = uicls.Sprite(
         name='cycle_half_circle',
         parent=self.cycleContainer,
         width=32,
         height=32,
         rotation=pi,
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerHalfCircle.png',
         color=self.timerData.color,
         state=uiconst.UI_DISABLED)
     self.pointerContainer = uicls.Transform(name='pointer_container',
                                             parent=self.content,
                                             width=32,
                                             height=32,
                                             idx=0)
     self.pointerClipper = uicls.Container(parent=self.pointerContainer,
                                           pos=(9, -10, 15, 13),
                                           clipChildren=True,
                                           align=uiconst.TOPLEFT,
                                           state=uiconst.UI_DISABLED)
     self.pointerSprite = uicls.Sprite(
         name='cycle_pointer',
         parent=self.pointerClipper,
         pos=(0, 0, 15, 19),
         texturePath=
         'res:/UI/Texture/Crimewatch/Crimewatch_TimerPoint_WithShadow.png',
         color=self.timerData.color,
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED)
     self.iconTransform.scalingCenter = (0.5, 0.5)
     uicore.animations.Tr2DScaleTo(self.iconTransform,
                                   startScale=(0.8, 0.8),
                                   endScale=(1.0, 1.0),
                                   duration=0.75,
                                   curveType=uiconst.ANIM_OVERSHOT)
Exemple #15
0
 def CreateLayout(self):
     if self.typeID is None:
         text = localization.GetByLabel('UI/PI/Common/NoFilter')
         self.icon = None
         self.loadingIcon = None
     else:
         self.icon = uicls.Icon(parent=self,
                                align=uiconst.RELATIVE,
                                pos=(0, 0, self.ICON_SIZE, self.ICON_SIZE),
                                state=uiconst.UI_DISABLED,
                                ignoreSize=True,
                                typeID=self.typeID,
                                size=self.ICON_SIZE)
         text = cfg.invtypes.Get(self.typeID).typeName
         self.loadingIcon = uicls.Transform(parent=self,
                                            align=uiconst.RELATIVE,
                                            pos=(0, 0, self.ICON_SIZE,
                                                 self.ICON_SIZE),
                                            state=uiconst.UI_HIDDEN)
         load = uicls.Icon(icon='ui_77_32_13',
                           parent=self.loadingIcon,
                           IgnoreSize=True,
                           pos=(0, 0, self.ICON_SIZE, self.ICON_SIZE),
                           align=uiconst.CENTER)
     self.container = uicls.Container(parent=self,
                                      name='mainContainer',
                                      align=uiconst.TOALL,
                                      state=uiconst.UI_DISABLED)
     self.resourceName = uicls.EveLabelMedium(
         text=text,
         parent=self,
         left=4 + (self.ICON_SIZE if self.typeID is not None else 0),
         top=6,
         align=uiconst.TOPLEFT,
         state=uiconst.UI_DISABLED)
     if self.typeID is not None:
         self.levelBar = uicls.Container(name='levelBar',
                                         parent=self,
                                         pos=(self.LEVEL_LEFT, 7,
                                              self.LEVEL_WIDTH,
                                              self.LEVEL_HEIGHT),
                                         align=uiconst.RELATIVE,
                                         state=uiconst.UI_DISABLED)
         self.level = uicls.Fill(
             parent=self.levelBar,
             pos=(0, 0, int(self.LEVEL_WIDTH * (self.quality or 0.0)), 0),
             align=uiconst.TOLEFT,
             color=self.LEVEL_COLOR)
         self.levelFill = uicls.Fill(parent=self.levelBar,
                                     align=uiconst.TOALL,
                                     color=self.LEVEL_BG_COLOR)
         if self.quality is None:
             self.levelBar.state = uiconst.UI_HIDDEN
     self.selectBlock = uicls.Fill(parent=self,
                                   name='selectBlock',
                                   state=uiconst.UI_DISABLED,
                                   align=uiconst.TOALL,
                                   padding=(0, self.SELECT_BLOCK_PADDING, 0,
                                            self.SELECT_BLOCK_PADDING),
                                   color=self.SELECT_FILL_COLOR
                                   if self.selected else self.EMPTY_COLOR)
Exemple #16
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.state = uiconst.UI_HIDDEN
     self.initialized = False
     size = 24
     self.ramps = uicls.Container(parent=self,
                                  name='ramps',
                                  pos=(0, 0, size, size),
                                  align=uiconst.TOPLEFT,
                                  state=uiconst.UI_DISABLED)
     leftRampCont = uicls.Container(parent=self.ramps,
                                    name='leftRampCont',
                                    pos=(0, 0, size / 2, size),
                                    align=uiconst.TOPLEFT,
                                    state=uiconst.UI_DISABLED,
                                    clipChildren=True)
     self.leftRamp = uicls.Transform(parent=leftRampCont,
                                     name='leftRamp',
                                     pos=(0, 0, size, size),
                                     align=uiconst.TOPLEFT,
                                     state=uiconst.UI_DISABLED)
     uicls.Sprite(
         parent=self.leftRamp,
         name='rampSprite',
         pos=(0, 0, size / 2, size),
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/TiDiIndicator/left.png',
         color=(0.0, 0.0, 0.0, 0.55))
     rightRampCont = uicls.Container(parent=self.ramps,
                                     name='rightRampCont',
                                     pos=(0, 0, size / 2, size),
                                     align=uiconst.TOPRIGHT,
                                     state=uiconst.UI_DISABLED,
                                     clipChildren=True)
     self.rightRamp = uicls.Transform(parent=rightRampCont,
                                      name='rightRamp',
                                      pos=(-size / 2, 0, size, size),
                                      align=uiconst.TOPLEFT,
                                      state=uiconst.UI_DISABLED)
     uicls.Sprite(
         parent=self.rightRamp,
         name='rampSprite',
         pos=(size / 2, 0, size / 2, size),
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/TiDiIndicator/right.png',
         color=(0.0, 0.0, 0.0, 0.55))
     self.coloredPie = uicls.Sprite(
         parent=self,
         name='tidiColoredPie',
         pos=(0, 0, size, size),
         texturePath='res:/UI/Texture/classes/TiDiIndicator/circle.png',
         color=(0, 1, 0, 1),
         state=uiconst.UI_DISABLED)
     background = uicls.Sprite(
         parent=self,
         name='tidiBackground',
         pos=(0, 0, size, size),
         texturePath='res:/UI/Texture/classes/TiDiIndicator/shadow.png',
         color=(0.2, 0.2, 0.2, 0.5),
         state=uiconst.UI_DISABLED)
     uthread.new(self.Animate)