Пример #1
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     if hasattr(self, 'SetTopparentHeight'):
         self.SetTopparentHeight(0)
     if self.sr.main is None:
         self.sr.main = uicls.Container(parent=self.sr.maincontainer)
     self.mainItem = None
     self.mainSprite = None
     self.mainTransform = None
     self.inputObj = attributes.get('animObj', None)
     self.codeEdit = None
     self.duration = 0.5
     self.loops = 1
     self.curveSet = None
     if self.inputObj:
         self.mode = MODE_INPUT
     else:
         self.mode = MODE_NORMAL
     self.topCont = uicls.Container(name='topCont',
                                    parent=self.sr.main,
                                    align=uiconst.TOTOP,
                                    height=20)
     self.mainCont = uicls.Container(name='mainCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOTOP,
                                     height=200)
     self.topRightCont = uicls.Container(name='topRightCont',
                                         parent=self.mainCont,
                                         align=uiconst.TORIGHT,
                                         width=100)
     self.spriteCont = uicls.Container(name='spriteCont',
                                       parent=self.mainCont)
     self.buttonCont = uicls.GridContainer(name='buttonCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOBOTTOM,
                                           height=30,
                                           columns=3,
                                           lines=1)
     self.bottomCont = uicls.Container(name='bottomCont',
                                       parent=self.sr.main)
     self.ConstructTopCont()
     self.ConstructTopRightCont()
     self.ConstructBottomCont()
     self.ConstructMainCont()
     btns = [('Uncheck all', self.UncheckAll, ()),
             ('Stop all', self.StopAllAnimations, ()),
             ('Play selected', self.PlaySelected, ())]
     for label, func, args in btns:
         uicls.Button(parent=uicls.Container(parent=self.buttonCont),
                      label=label,
                      func=func,
                      align=uiconst.CENTER)
Пример #2
0
 def ApplyAttributes(self, attributes):
     uicls.LayerCore.ApplyAttributes(self, attributes)
     self.looking = 1
     self.locked = 0
     self.zoomlooking = 0
     self.fovready = 0
     self.resetfov = 0
     self.prefov = None
     self.align = uiconst.TOALL
     self.notdbl = 0
     self.sr.tcursor = None
     self.sr.clicktime = None
     self.hoverbracket = None
     self.blockDisable = 0
     self.movingCursor = None
     self.sr.spacemenu = None
     self.downpos = None
     self.locks = {}
     self._isPicked = False
     self.dungeonEditorSelectionEnabled = False
     sceneManager = sm.GetService('sceneManager')
     self.maxFov = sceneManager.maxFov
     self.minFov = sceneManager.minFov
     self.sr.tcursor = uicls.Container(name='targetingcursor',
                                       parent=self,
                                       align=uiconst.ABSOLUTE,
                                       width=1,
                                       height=1,
                                       state=uiconst.UI_HIDDEN)
     uicls.Line(parent=self.sr.tcursor,
                align=uiconst.RELATIVE,
                left=10,
                width=3000,
                height=1)
     uicls.Line(parent=self.sr.tcursor,
                align=uiconst.TOPRIGHT,
                left=10,
                width=3000,
                height=1)
     uicls.Line(parent=self.sr.tcursor,
                align=uiconst.RELATIVE,
                top=10,
                width=1,
                height=3000)
     uicls.Line(parent=self.sr.tcursor,
                align=uiconst.BOTTOMLEFT,
                top=10,
                width=1,
                height=3000)
Пример #3
0
    def ShowTimer(self, timerID, startTime, duration, label):
        check = self.GetTimer(timerID)
        if check:
            if check.endTime <= startTime + duration:
                check.Close()
            else:
                return
        timer = uicls.Container(name='%s' % timerID, parent=self.sr.gaugeParent, align=uiconst.TOTOP, height=7, padTop=5, padBottom=1)
        timer.endTime = startTime + duration
        timer.timerID = timerID
        self.ArrangeGauges()
        t1 = uicls.EveHeaderSmall(text=label, parent=timer, left=68, top=-1, state=uiconst.UI_DISABLED)
        uicls.Frame(parent=timer, padding=-1, color=(1.0, 1.0, 1.0, 0.5))
        t = uicls.EveLabelSmall(text='', parent=timer, left=5, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL)
        p = uicls.Fill(parent=timer, align=uiconst.TOLEFT)
        timer.height = max(7, t.textheight - 3, t1.textheight - 3)
        duration = float(duration)
        while 1 and not timer.destroyed:
            now = blue.os.GetSimTime()
            dt = blue.os.TimeDiffInMs(startTime, now)
            timeLeft = (duration - dt) / 1000.0
            timer.timeLeft = timeLeft
            if timer.destroyed or dt > duration:
                t.text = localization.GetByLabel('UI/Common/Done')
                p.width = 0
                break
            t.text = localization.GetByLabel('UI/Inflight/Target/TimerDuration', timeLeft=timeLeft)
            p.width = int(timer.displayWidth * ((duration - dt) / duration))
            timer.height = max(7, t.textheight - 3)
            blue.pyos.synchro.Yield()

        blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = localization.GetByLabel('UI/Common/Done')
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = localization.GetByLabel('UI/Common/Done')
            blue.pyos.synchro.SleepWallclock(250)
        if not timer.destroyed and not self.destroyed:
            t.text = ''
            timer.Close()
        if not self.destroyed:
            self.ArrangeGauges()
Пример #4
0
 def ApplyAttributes(self, attributes):
     uicls.Bracket.ApplyAttributes(self, attributes)
     self.captureStatus = attributes.get('captureStatus',
                                         facwarCommon.STATE_STABLE)
     self.isCurrLocation = attributes.get('isCurrLocation', False)
     self.controller = attributes.controller
     self.systemID = attributes.systemID
     self.occupierID = attributes.occupierID
     self.friendID = attributes.friendID
     self.foeID = attributes.foeID
     if self.occupierID == self.friendID:
         self.color = facwarCommon.COLOR_FRIEND_BAR
         self.hoverColor = facwarCommon.COLOR_FRIEND_LIGHT
     else:
         self.color = facwarCommon.COLOR_FOE_BAR
         self.hoverColor = facwarCommon.COLOR_FOE_LIGHT
     self.dotSprite = uicls.Sprite(
         parent=self,
         texturePath='res:/Texture/Particle/MapSprite.dds',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         color=self.color)
     self.bgSprite = uicls.Sprite(
         parent=self,
         texturePath='res:/Texture/Particle/MapSprite.dds',
         align=uiconst.TOALL,
         state=uiconst.UI_DISABLED,
         color=self.hoverColor,
         padding=-10,
         opacity=0.0)
     if self.systemID == session.solarsystemid2:
         frame = uicls.Sprite(
             parent=self,
             name='frame',
             pos=(0, 0, 20, 20),
             align=uiconst.CENTER,
             state=uiconst.UI_DISABLED,
             opacity=0.3,
             texturePath=
             'res:/UI/Texture/classes/StarMapSvc/currentLocation.png')
         uicls.Label(
             parent=self,
             align=uiconst.CENTERLEFT,
             left=18,
             fontsize=10,
             text=localization.GetByLabel('UI/FactionWarfare/YouAreHere'),
             opacity=0.5)
     self.animCont = uicls.Container(parent=self, state=uiconst.UI_DISABLED)
     uthread.new(self.SetSystemCaptureStatus, self.captureStatus)
Пример #5
0
    def ConstructLayout(self):
        contName = 'group_%d' % self.groupID
        self.sr.selected = uicls.Fill(bgParent=self, color=(1.0, 1.0, 1.0, 0.15), state=uiconst.UI_HIDDEN)
        self.sr.hilite = uicls.Fill(parent=self, color=(1.0, 1.0, 1.0, 0.1), state=uiconst.UI_HIDDEN)
        self.OnMouseEnter = self.BarOnMouseEnter
        self.OnMouseExit = self.BarOnMouseExit
        attackerName = cfg.eveowners.Get(self.attackerID).name
        defenderName = cfg.eveowners.Get(self.defenderID).name
        hintText = localization.GetByLabel('UI/Corporations/Wars/AggressorDefenderKillsHint', aggressorName=attackerName, aggressorKillsIsk=util.FmtISK(self.attackerKillsIsk, 0), aggressorKills=util.FmtAmt(self.attackerKills), defenderName=defenderName, defenderKillsIsk=util.FmtISK(self.defenderKillsIsk, 0), defenderKills=util.FmtAmt(self.defenderKills))
        self.hint = hintText
        topbar = uicls.Container(name='topbar', parent=self, align=uiconst.TOTOP, height=5, padTop=4)
        try:
            redwith = float(self.attackerKillsIsk) / float(self.maxKills)
        except:
            redwith = 0.0

        redbar = uicls.Container(parent=topbar, align=uiconst.TOLEFT_PROP, width=redwith, height=5, bgColor=ATTACKER_COLOR)
        bottombar = uicls.Container(name='bluebar', parent=self, align=uiconst.TOBOTTOM, height=5, padBottom=4)
        try:
            bluewith = float(self.defenderKillsIsk) / float(self.maxKills)
        except:
            bluewith = 0.0

        bluebar = uicls.Container(parent=bottombar, align=uiconst.TOLEFT_PROP, width=bluewith, height=5, bgColor=DEFENDER_COLOR)
Пример #6
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     textList = attributes.get('textList', self.default_textList)
     self.scrollSpeed = attributes.get('scrollSpeed', self.default_scrollSpeed)
     self.fontSize = attributes.get('fontSize', self.default_fontSize)
     fadeColor = attributes.get('fadeColor', self.default_fadeColor)
     fadeWidth = attributes.get('fadeWidth', self.default_fadeWidth)
     self.color = attributes.get('color', self.default_color)
     self.scrollThread = None
     if fadeColor:
         uicls.Sprite(name='leftFade', parent=self, texturePath='res:/UI/Texture/classes/CQMainScreen/autoTextGradientLeft.png', color=fadeColor, align=uiconst.TOLEFT, width=fadeWidth, state=uiconst.UI_DISABLED)
         uicls.Sprite(name='leftFade', parent=self, texturePath='res:/UI/Texture/classes/CQMainScreen/autoTextGradientRight.png', color=fadeColor, align=uiconst.TORIGHT, width=fadeWidth, state=uiconst.UI_DISABLED)
     self.textCont = uicls.Container(name='textCont', parent=self, align=uiconst.CENTERLEFT, height=self.fontSize)
     if textList:
         self.SetTextList(textList)
Пример #7
0
 def InitMovie(self):
     self.sr.movieCont = uicls.Container(parent=self,
                                         name='movieCont',
                                         idx=0,
                                         align=uiconst.TOALL,
                                         state=uiconst.UI_DISABLED)
     moviePath = 'res:/video/Intro_1280_720.bik'
     x, y, contWidth, contHeight = self.sr.movieCont.GetAbsolute()
     dimWidth, dimHeight = self.GetVideoDimensions(contWidth, contHeight,
                                                   1280, 720)
     self.movie = uicls.VideoSprite(parent=self.sr.movieCont,
                                    pos=(0, 0, dimWidth, dimHeight),
                                    align=uiconst.CENTER,
                                    videoPath=moviePath,
                                    videoAutoPlay=False)
Пример #8
0
 def ShowSupp(self, text):
     bottom = uicls.Container(name='suppressContainer',
                              parent=self.sr.main,
                              align=uiconst.TOBOTTOM,
                              height=20,
                              idx=0)
     self.sr.suppCheckbox = uicls.Checkbox(text=text,
                                           parent=bottom,
                                           configName='suppress',
                                           retval=0,
                                           checked=0,
                                           groupname=None,
                                           callback=self.ChangeSupp,
                                           align=uiconst.TOPLEFT,
                                           pos=(6, 0, 320, 0))
Пример #9
0
 def CreateLocationInfo(self):
     mapIconContainer = uicls.Container(name='mapIconContainer',
                                        parent=self.sr.location,
                                        align=uiconst.TORIGHT,
                                        pos=(0, 0, 32, 0),
                                        padding=(0, 0, 0, 5))
     self.sr.textContainer = uicls.Container(name='textContainer',
                                             parent=self.sr.location,
                                             align=uiconst.TOALL,
                                             pos=(0, 0, 0, 0),
                                             padding=(0, 0, 0, 0))
     btn = uix.GetBigButton(32, mapIconContainer)
     btn.SetAlign(uiconst.CENTERRIGHT)
     btn.OnClick = self.OpenMap
     btn.hint = localization.GetByLabel('UI/Map/Map')
     btn.sr.icon.LoadIcon('ui_7_64_4')
     locationMenu = uicls.MenuIcon(size=24, ignoreSize=True)
     locationMenu.GetMenu = self.GetLocationMenu
     locationMenu.left = -5
     locationMenu.top = -3
     locationMenu.hint = ''
     self.sr.textContainer.children.append(locationMenu)
     self.sr.breadCrumbs = uicls.Label(name='label',
                                       text='',
                                       parent=self.sr.textContainer,
                                       fontsize=16,
                                       align=uiconst.TOTOP,
                                       padding=(15, 0, 0, 0),
                                       boldlinks=0,
                                       state=uiconst.UI_NORMAL)
     self.sr.dominatorText = uicls.EveLabelMedium(
         text='',
         parent=self.sr.textContainer,
         align=uiconst.TOTOP,
         state=uiconst.UI_NORMAL,
         maxLines=1)
Пример #10
0
    def InitGauges(self):
        if getattr(self, 'gaugesInited', False):
            self.sr.gaugeParent.state = uiconst.UI_DISABLED
            return
        parent = self.sr.gaugesContainer
        uicls.Line(parent=parent, align=uiconst.TOLEFT)
        barw, barh = (24, 6)
        borderw = 2
        barsw = (barw + borderw) * 3 + borderw
        par = uicls.Container(name='gauges',
                              parent=parent,
                              align=uiconst.TORIGHT,
                              width=barsw + 2,
                              height=0,
                              left=0,
                              top=0,
                              idx=10)
        self.sr.gauges = []
        l = 2
        for each in ('SHIELD', 'ARMOR', 'STRUCT'):
            g = uicls.Container(parent=par,
                                name='gauge_%s' % each.lower(),
                                align=uiconst.CENTERLEFT,
                                width=barw,
                                height=barh,
                                left=l)
            uicls.Frame(parent=g)
            g.sr.bar = uicls.Fill(parent=g, align=uiconst.TOLEFT)
            uicls.Fill(parent=g,
                       color=(158 / 256.0, 11 / 256.0, 14 / 256.0, 1.0))
            self.sr.gauges.append(g)
            setattr(self.sr, 'gauge_%s' % each.lower(), g)
            l += barw + borderw

        self.sr.gaugeParent = par
        self.gaugesInited = True
Пример #11
0
 def AddSlot(self, idx, imageData):
     step = int(self.imageWidth * 0.75)
     self._slotGap = step
     specialItemPadding = 0
     if self.numSpecialItems and idx >= self.numSpecialItems:
         specialItemPadding = int(step * 0.5)
     slotpar = uicls.Container(name='slotPar_%s' % idx, parent=self.sr.slots, align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN, pos=(-self.imageWidth / 2 + (idx + 1) * step + specialItemPadding,
      0,
      self.imageWidth,
      self.imageHeight))
     slotpar.idx = idx
     slotpar.imageData = imageData
     slot = uicls.Container(parent=slotpar, align=uiconst.CENTER, state=uiconst.UI_NORMAL, pos=(0,
      0,
      self.imageWidth / 2,
      self.imageHeight / 2))
     slot.OnMouseDown = (self.OnSlotMouseDown, slot)
     slot.OnMouseUp = (self.OnSlotMouseUp, slot)
     slot.imageData = imageData
     slot.sr.hilite = uicls.Frame(parent=slot, align=uiconst.TOALL, frameConst=HILITE, state=uiconst.UI_HIDDEN, color=(1.0, 1.0, 1.0, 1.0))
     slot.sr.hilite.padding = -6
     slot.sr.thumbnail = uicls.Sprite(parent=slot, texturePath=None, align=uiconst.TOALL, padding=(2, 2, 2, 2), state=uiconst.UI_DISABLED)
     uicls.Fill(parent=slot, padding=(2, 2, 2, 2), color=(0.0, 0.0, 0.0, 0.75))
     return slot
Пример #12
0
    def AddBackground(self, where, s):
        for i, side in enumerate(['top', 'left', 'right', 'bottom']):
            if s['border-%s-width' % side]:
                align = [
                    uiconst.TOTOP, uiconst.TOLEFT, uiconst.TORIGHT,
                    uiconst.TOBOTTOM
                ][i]
                uicls.Line(parent=where,
                           align=align,
                           weight=s['border-%s-width' % side],
                           color=s['border-%s-color' % side],
                           idx=0)

        if s['background-image'] and where.sr.background:
            browser = uiutil.GetBrowser(self)
            currentURL = None
            if browser:
                currentURL = browser.sr.currentURL
            texture, tWidth, tHeight = sm.GetService(
                'browserImage').GetTextureFromURL(
                    s['background-image'],
                    currentURL,
                    fromWhere='VirtualTable::AddBackground')
            pic = uicls.Sprite()
            pic.left = pic.top = 0
            pic.width = tWidth
            pic.height = tHeight
            pic.texture = texture
            row = uicls.Container(name='row',
                                  align=uiconst.TOTOP,
                                  pos=(0, 0, 0, tHeight),
                                  clipChildren=1)
            if s['background-repeat'] in ('repeat', 'repeat-x'):
                for x in xrange(max(where.width / tWidth, 2) + 1):
                    row.children.append(pic.CopyTo())
                    pic.left += pic.width

            else:
                row.children.append(pic.CopyTo())
            if s['background-repeat'] in ('repeat', 'repeat-y'):
                for y in xrange(max(where.height / tHeight, 2) + 1):
                    row.height = min(where.height - tHeight * y, row.height)
                    where.sr.background.children.append(row.CopyTo())

            else:
                where.sr.background.children.append(row.CopyTo())
        if s['background-color']:
            uicls.Fill(parent=where, color=s['background-color'])
Пример #13
0
 def StartTransition(self, fromView, toView):
     viewstate.Transition.StartTransition(self, fromView, toView)
     viewState = sm.GetService('viewState')
     self.fadeLayer = uicls.Container(name='transition_overlay',
                                      parent=viewState.overlayLayerParent,
                                      pickState=uiconst.TR2_SPS_OFF,
                                      bgColor=util.Color.BLACK,
                                      opacity=0.0)
     self.loadStationEnv = settings.public.device.Get('loadstationenv2', 1)
     height = uicore.desktop.height
     width = uicore.desktop.width
     self.loadingText = uicls.Label(
         parent=self.fadeLayer,
         text=localization.GetByLabel('UI/Worldspaces/Common/Loading'),
         fontsize=50,
         align=uiconst.CENTER,
         top=100,
         color=util.Color.WHITE,
         glowFactor=1.0,
         glowColor=(1.0, 1.0, 1.0, 0.1),
         uppercase=uiconst.WINHEADERUPPERCASE)
     stationTypeID = eve.stationItem.stationTypeID
     stationType = cfg.invtypes.Get(stationTypeID)
     stationRace = stationType['raceID']
     backgroundToUse = self.racialLoadingBackgrounds[stationRace]
     uicls.Sprite(name='aura',
                  parent=self.fadeLayer,
                  texturePath=backgroundToUse,
                  align=uiconst.CENTER,
                  width=width,
                  height=height)
     if fromView is not None:
         if getattr(fromView,
                    'cachedPlayerPos', None) is not None and getattr(
                        fromView, 'cachedPlayerRot', None) is not None:
             toView.cachedPlayerPos = fromView.cachedPlayerPos
             toView.cachedPlayerRot = fromView.cachedPlayerRot
         if getattr(fromView,
                    'cachedCameraYaw', None) is not None and getattr(
                        fromView, 'cachedCameraPitch',
                        None) is not None and getattr(
                            fromView, 'cachedCameraZoom', None) is not None:
             toView.cachedCameraYaw = fromView.cachedCameraYaw
             toView.cachedCameraPitch = fromView.cachedCameraPitch
             toView.cachedCameraZoom = fromView.cachedCameraZoom
     uicore.animations.FadeIn(self.fadeLayer,
                              duration=self.fadeInTimeMS / 1000.0,
                              sleep=True)
Пример #14
0
 def Prepare_Appearance_(self):
     self.subpar = uicls.Container(parent=self,
                                   name='btns',
                                   state=uiconst.UI_PICKCHILDREN,
                                   align=self.subalign)
     if self.line:
         line2 = uicls.Line(parent=self,
                            name='black',
                            state=uiconst.UI_DISABLED,
                            color=(0.0, 0.0, 0.0, 0.15),
                            align=uiconst.TOTOP,
                            padTop=-1)
         line1 = uicls.Line(parent=self,
                            name='white',
                            color=(1.0, 1.0, 1.0, 0.25),
                            align=uiconst.TOTOP)
Пример #15
0
 def PanelDecommissionLink(self):
     cont = uicls.Container(parent=self.actionCont,
                            pos=(0, 0, 0, 0),
                            align=uiconst.TOTOP,
                            state=uiconst.UI_HIDDEN)
     text = localization.GetByLabel('UI/PI/Common/DecommissionLink',
                                    typeName=cfg.invtypes.Get(
                                        self.pin.link.typeID).name)
     editBox = self._DrawEditBox(cont, text)
     cont.height = editBox.height + 25
     btns = [[
         localization.GetByLabel('UI/PI/Common/Proceed'),
         self._DecommissionSelf, None
     ]]
     uicls.ButtonGroup(btns=btns, parent=cont, line=False, alwaysLite=True)
     return cont
Пример #16
0
 def _SetMarks(self, marks):
     if not uiutil.IsUnder(self, uicore.desktop):
         return
     for i in xrange(0, len(marks), 4):
         id = marks[i]
         hint = marks[i + 1]
         uiutil.Update(self, 'Map2D::_SetMarks')
         size = max(1, self.absoluteRight - self.absoluteLeft)
         x, y = self.GetCordsByKeyAsPortion(id, size)
         if x is None or y is None:
             return
         if self.sr.marks is None:
             self.sr.marks = uicls.Container(name='marks', parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0), idx=0, state=uiconst.UI_DISABLED)
         mark = uicls.Sprite(parent=self.sr.marks, name='area', left=x - mark.width / 2, top=y - mark.height / 2 + 1, width=128, height=128, state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/circle_full.png', color=(1.0, 1.0, 1.0, 0.21))
         if hint:
             uicls.EveLabelMedium(text=hint, parent=self.sr.marks, left=mark.left + mark.width, top=mark.top + 2, width=min(128, max(64, size - mark.left - mark.width)), state=uiconst.UI_NORMAL)
Пример #17
0
    def SetSelected(self, ids):
        if self is None or self.destroyed:
            return
        for each in self.overlays.children[:]:
            if each.name == 'selected':
                each.Close()

        for id in ids:
            x, y = self.GetCordsByKeyAsPortion(id)
            if x is not None and y is not None:
                newsel = uicls.Container(parent=self.overlays, name='selected', align=uiconst.TOPLEFT, width=16, height=16, state=uiconst.UI_DISABLED)
                pointer = uicls.Sprite(parent=newsel, pos=(0, 0, 16, 32), state=uiconst.UI_PICKCHILDREN, texturePath='res:/UI/Texture/Shared/circlePointerDown.png', color=(1.0, 1.0, 1.0, 0.4))
                newsel.sr.x = x
                newsel.sr.y = y

        self.RefreshOverlays(1)
Пример #18
0
 def Prepare_Diode_(self):
     if self.sr.diode:
         self.sr.diode.Close()
     self.sr.diode = uicls.Container(parent=self,
                                     pos=(-1, 1, 16, 16),
                                     name='diode',
                                     state=uiconst.UI_DISABLED,
                                     align=uiconst.RELATIVE)
     if self._groupName is None:
         self.sr.active = uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='active',
             state=uiconst.UI_HIDDEN,
             texturePath='res:/UI/Texture/Shared/checkboxActive.png')
         self.checkMark = uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='self_ok',
             state=uiconst.UI_HIDDEN,
             texturePath='res:/UI/Texture/Shared/checkboxChecked.png')
         uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='shape',
             state=uiconst.UI_DISABLED,
             texturePath='res:/UI/Texture/Shared/checkboxShape.png')
     else:
         self.sr.active = uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='active',
             state=uiconst.UI_HIDDEN,
             texturePath='res:/UI/Texture/Shared/checkboxActiveOval.png')
         self.checkMark = uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='self_ok',
             state=uiconst.UI_HIDDEN,
             texturePath='res:/UI/Texture/Shared/checkboxCheckedOval.png')
         uicls.Sprite(
             parent=self.sr.diode,
             pos=(0, 0, 16, 16),
             name='shape',
             state=uiconst.UI_DISABLED,
             texturePath='res:/UI/Texture/Shared/checkboxShapeOval.png')
Пример #19
0
 def CreateWindow(self):
     logoLabel = localization.GetByLabel(
         'UI/Corporations/CorporationWindow/Alliances/Members/Logo')
     nameLabel = localization.GetByLabel('UI/Common/Name')
     chosenExecLabel = localization.GetByLabel(
         'UI/Corporations/CorporationWindow/Alliances/Members/ChosenExecutor'
     )
     self.sr.headers = [logoLabel, nameLabel, chosenExecLabel]
     if eve.session.allianceid is not None:
         self.toolbarContainer = uicls.Container(name='toolbarContainer',
                                                 align=uiconst.TOTOP,
                                                 parent=self,
                                                 left=const.defaultPadding,
                                                 top=const.defaultPadding)
         if eve.session.corprole & const.corpRoleDirector == const.corpRoleDirector:
             declareSupportLabel = localization.GetByLabel(
                 'UI/Corporations/CorporationWindow/Alliances/Members/DeclareSupport'
             )
             btns = [[
                 declareSupportLabel, self.DeclareSupportForm, None, None
             ]]
             t = uicls.ButtonGroup(btns=btns,
                                   parent=self.toolbarContainer,
                                   line=0)
         else:
             hintLabel = localization.GetByLabel(
                 'UI/Corporations/CorporationWindow/Alliances/Members/DirectorDeclareWarHint'
             )
             t = uicls.EveLabelMedium(text=hintLabel,
                                      parent=self.toolbarContainer,
                                      align=uiconst.TOTOP,
                                      state=uiconst.UI_NORMAL)
         self.toolbarContainer.height = t.height
     self.sr.scroll = uicls.Scroll(
         parent=self,
         padding=(const.defaultPadding, const.defaultPadding,
                  const.defaultPadding, const.defaultPadding))
     if eve.session.allianceid is None:
         notInAllianceLabel = localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Alliances/CorpNotInAlliance',
             corpName=cfg.eveowners.Get(eve.session.corpid).ownerName)
         self.sr.scroll.Load(fixedEntryHeight=19,
                             contentList=[],
                             noContentHint=notInAllianceLabel)
         return
     self.ShowMembers()
Пример #20
0
 def ConstructLayout(self):
     cont = uicls.Container(parent=self.sr.main,
                            align=uiconst.TOALL,
                            pos=(const.defaultPadding, 16,
                                 const.defaultPadding,
                                 const.defaultPadding))
     self.newName = uicls.SinglelineEdit(
         name='namePopup',
         parent=cont,
         label=self.label,
         setvalue=self.setvalue,
         align=uiconst.TOTOP,
         maxLength=self.maxLength,
         passwordCharacter=self.passwordChar,
         autoselect=True,
         OnReturn=self.Confirm)
     uicore.registry.SetFocus(self.newName)
Пример #21
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.btnData = attributes.btnData
     if hasattr(self.btnData, 'panelEntryHeight'):
         self.height = self.btnData.panelEntryHeight
     self.blinkThread = None
     self._openNeocomPanel = None
     self.main = uicls.Container(parent=self, name='main')
     self.hoverBG = uicls.Frame(
         bgParent=self.main,
         texturePath='res:/UI/Texture/classes/Neocom/panelEntryBG.png',
         opacity=0.0)
     self.icon = uicls.Icon(parent=self.main,
                            name='icon',
                            state=uiconst.UI_DISABLED,
                            icon=self.GetIconPath(),
                            size=self.height - 4,
                            left=10,
                            top=2,
                            ignoreSize=True)
     self.label = uicls.Label(parent=self.main,
                              align=uiconst.CENTERLEFT,
                              state=uiconst.UI_DISABLED,
                              text=self.GetLabel(),
                              autowidth=True,
                              autoheight=True,
                              left=self.icon.left + self.icon.width + 8)
     if settings.char.ui.Get('neocomAlign',
                             uiconst.TOLEFT) == uiconst.TOLEFT:
         rotation = 0.0
     else:
         rotation = math.pi
     self.expanderIcon = uicls.Icon(parent=self,
                                    name='expanderIcon',
                                    align=uiconst.CENTERRIGHT,
                                    left=10,
                                    icon='ui_38_16_228',
                                    rotation=rotation)
     self.SetExpanderState()
     self.blinkSprite = uicls.Sprite(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/panelEntryBG.png',
         state=uiconst.UI_HIDDEN,
         opacity=0.5)
Пример #22
0
 def ConstructSidePanel(self):
     self.sidePanel = uicls.Container(parent=uicore.layer.sidePanels,
                                      name='sidePanel',
                                      align=uiconst.TOLEFT,
                                      width=infoPanel.PANELWIDTH,
                                      padding=(0, 12, 0, 0))
     self.sidePanel.cacheContents = True
     self.combatTimerContainer = crimewatchTimers.TimerContainer(
         parent=self.sidePanel, left=infoPanel.LEFTPAD)
     self.infoPanelContainer = uicls.InfoPanelContainer(
         parent=self.sidePanel, align=uiconst.TOTOP)
     self.sessionTimer = uicls.SessionTimeIndicator(parent=self.sidePanel,
                                                    pos=(16, 35, 24, 24),
                                                    state=uiconst.UI_HIDDEN,
                                                    align=uiconst.TOPLEFT)
     if self.sessionTimerUpdatePending:
         self.UpdateSessionTimer()
Пример #23
0
 def ConstructStatisticsPanel(self):
     self.statisticsPanel.Flush()
     scrolls = [
         ('personal', localization.GetByLabel('UI/Generic/Personal')),
         ('corp', localization.GetByLabel('UI/Generic/Corporation')),
         ('militia', localization.GetByLabel('UI/FactionWarfare/Militia'))
     ]
     if session.allianceid is not None:
         scrolls.append(
             ('alliance', localization.GetByLabel('UI/Common/Alliance')))
     for key, text in scrolls:
         cont = uicls.Container(parent=self.statisticsPanel,
                                align=uiconst.TOTOP_PROP,
                                height=1.0 / len(scrolls))
         uicls.Label(parent=cont, align=uiconst.TOTOP, text=text)
         scroll = uicls.Scroll(parent=cont, padBottom=5)
         self.LoadStatisticsScrollData(key, scroll)
Пример #24
0
    def CreateAlphaCursors(self):
        while len(self.alphaCursorCont.children) > 0:
            self.alphaCursorCont.children.remove(
                self.alphaCursorCont.children[0])

        width = self.alphaCursorCont.GetAbsoluteSize()[0] - 8
        self.alphaCursors = map(
            lambda loc: uicls.Container(parent=self.alphaCursorCont,
                                        align=uiconst.BOTTOMLEFT,
                                        width=10,
                                        height=16,
                                        top=2,
                                        left=int(width * loc)), self.alphaDivs)
        for i, (s, val) in enumerate(zip(self.alphaCursors, self.alphaPoints)):
            middle = uicls.Sprite(parent=s,
                                  align=uiconst.BOTTOMLEFT,
                                  color=(val, val, val),
                                  width=6,
                                  height=12,
                                  top=2,
                                  left=2,
                                  spriteEffect=trinity.TR2_SFX_FILL)
            uicls.Sprite(parent=s,
                         align=uiconst.BOTTOMLEFT,
                         width=10,
                         height=16,
                         color=(0.5, 0.5, 0.5),
                         spriteEffect=trinity.TR2_SFX_FILL)

            def fake(slf, idx):
                def inner(*args):
                    slf.SelectAlphaCursor(idx)

                return inner

            middle.OnMouseDown = fake(self, i)

        self.alphaCursorSelectedSprite = uicls.Sprite(
            parent=self.alphaCursorCont,
            align=uiconst.BOTTOMLEFT,
            color=(1.0, 1.0, 1.0),
            width=14,
            height=20,
            left=int(width * self.alphaDivs[self.alphaSelected]) - 2,
            spriteEffect=trinity.TR2_SFX_FILL)
Пример #25
0
 def ApplyAttributes(self, attributes):
     uicls.Window.ApplyAttributes(self, attributes)
     self.SetWndIcon()
     self.SetTopparentHeight(0)
     sc = form.SceneContainer(
         uicls.Frame(parent=self.sr.main, padding=(6, 6, 6, 6)))
     sc.Startup()
     nav = SceneContainerBaseNavigation(
         uicls.Container(parent=self.sr.main,
                         left=6,
                         top=6,
                         width=6,
                         height=6,
                         idx=0,
                         state=uiconst.UI_NORMAL))
     nav.Startup(sc)
     self.sr.navigation = nav
     self.sr.sceneContainer = sc
Пример #26
0
 def ConstructLayout(self):
     self.sr.header = uicls.Container(name='header',
                                      parent=self.sr.main,
                                      align=uiconst.TOTOP,
                                      pos=(0, 0, 0, HEADER_HEIGHT),
                                      padding=(0, const.defaultPadding, 0,
                                               const.defaultPadding))
     self.sr.menu = uicls.Container(name='menu',
                                    parent=self.sr.header,
                                    align=uiconst.TOTOP,
                                    pos=(0, 0, 0, MENU_HEIGHT),
                                    padding=(2, 0, 2, 0))
     self.sr.location = uicls.Container(name='location',
                                        parent=self.sr.header,
                                        align=uiconst.TOTOP,
                                        pos=(0, 0, 0, LOCATION_HEIGHT),
                                        padding=(4, 4, 6, 0))
     self.sr.line = uicls.Container(name='line',
                                    parent=self.sr.header,
                                    align=uiconst.TOTOP,
                                    pos=(0, 0, 0, LINE_HEIGHT),
                                    padding=(0, 2, 0, 0))
     uicls.Line(parent=self.sr.line,
                align=uiconst.TOTOP,
                color=(0.0, 0.0, 0.0, 0.25))
     uicls.Line(parent=self.sr.line, align=uiconst.TOTOP)
     self.sr.activekill = uicls.Container(name='activekill',
                                          parent=self.sr.header,
                                          align=uiconst.TOTOP,
                                          pos=(0, 0, 0, LABEL_HEIGHT * 2),
                                          padding=(0, 0, 0, 0))
     self.sr.regionalOverview = uicls.Container(name='regionalOverview',
                                                parent=self.sr.main,
                                                align=uiconst.TOALL,
                                                padding=(0, 4, 0, 0))
     self.sr.worldOverview = uicls.Container(name='worldOverview',
                                             parent=self.sr.main,
                                             align=uiconst.TOALL,
                                             padding=(0, 4, 0, 0),
                                             state=uiconst.UI_HIDDEN)
     self.CreateLocationInfo()
     self.CreateActiveKillInfo()
     self.DrawStationsOutposts()
     self.DrawDivider()
     self.DrawInfrastructureHubs()
     self.DrawChanges()
     self.CreateMenu()
Пример #27
0
 def OpenAd(self, imgpath, url, hidden):
     adPar = uicls.Container(name='ad', parent=self, idx=0, width=690, height=282, left=0, top=0, state=uiconst.UI_NORMAL, align=uiconst.CENTER)
     mainclosex = uicls.Icon(icon='ui_38_16_220', parent=adPar, pos=(2, 1, 0, 0), align=uiconst.TOPRIGHT, state=uiconst.UI_NORMAL, idx=0)
     mainclosex.OnClick = self.CloseAd
     ad = uicls.Sprite(name='adsprite', parent=adPar, width=690, height=282, left=0, top=0, state=uiconst.UI_NORMAL, color=(1.0, 1.0, 1.0, 0.0))
     tex, w, h = sm.GetService('photo').GetTextureFromURL(imgpath)
     ad.rectWidth = ad.width = adPar.width = w
     ad.rectHeight = ad.height = adPar.height = h
     ad.rectLeft = 0
     ad.rectTop = 0
     ad.texture = tex
     ad.url = url
     ad.OnClick = (self.ClickAd, ad)
     if hidden:
         adPar.state = uiconst.UI_HIDDEN
     settings.public.ui.Set(imgpath + 'Ad', 1)
     sm.GetService('ui').Fade(0, 1.0, ad)
     sm.GetService('ui').Fade(0, 1.0, mainclosex)
Пример #28
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     labelTxt = attributes.Get('label', '')
     subTxt = attributes.Get('subText', '')
     gaugeHeight = attributes.Get('gaugeHeight', self.default_gaugeHeight)
     self.markers = {}
     self.gaugeCont = uicls.Container(parent=self,
                                      name='gaugeCont',
                                      height=gaugeHeight,
                                      align=uiconst.TOTOP,
                                      clipChildren=True,
                                      state=uiconst.UI_DISABLED)
     self.label = None
     if labelTxt:
         self.SetText(labelTxt)
     self.subText = None
     if subTxt:
         self.SetSubText(subTxt)
Пример #29
0
 def ConstructLayout(self):
     if eve.session.corprole & const.corpRoleDirector > 0:
         self.SetHeaderIcon()
         hicon = self.sr.headerIcon
         hicon.GetMenu = self.OpenMenu
         hicon.expandOnLeft = 1
         hicon.hint = localization.GetByLabel(
             'UI/InfrastructureHub/HubSettings')
         hicon.name = 'ihHeaderIcon'
         self.sr.presetMenu = hicon
     self.sr.upgradesTab = uicls.Container(name='upgradesTab',
                                           parent=self.sr.main,
                                           align=uiconst.TOALL,
                                           pos=(0, 0, 0, 0),
                                           padding=(0, 0, 0, 0))
     self.sr.index = uicls.Container(name='hubs',
                                     parent=self.sr.upgradesTab,
                                     align=uiconst.TOLEFT,
                                     pos=(0, 0, 155, 0),
                                     padding=(0, 0, 2, 0))
     self.sr.index.state = uiconst.UI_NORMAL
     self.sr.upgrades = uicls.Container(name='upgrades',
                                        parent=self.sr.upgradesTab,
                                        align=uiconst.TOALL,
                                        pos=(0, 0, 0, 0),
                                        padding=(0, 0, 0, 0))
     self.sr.upgrades.state = uiconst.UI_NORMAL
     uicls.Line(parent=self.sr.upgrades, align=uiconst.TOLEFT)
     uicls.Line(parent=self.sr.index, align=uiconst.TORIGHT)
     self.sr.infoContainer = uicls.Container(name='infoContainer',
                                             parent=self.sr.upgrades,
                                             align=uiconst.TOBOTTOM,
                                             pos=(0, 0, 0, 90),
                                             padding=(0, 5, 0, 0))
     self.sr.upgradesContainer = uicls.Container(name='upgradesContainer',
                                                 parent=self.sr.upgrades,
                                                 align=uiconst.TOALL,
                                                 pos=(0, 0, 0, 0),
                                                 padding=(0, 0, 0, 0))
     self.sr.hubs = uicls.Container(name='hubs',
                                    parent=self.sr.index,
                                    align=uiconst.TOALL,
                                    pos=(0, 0, 0, 0),
                                    padding=(0, 0, 0, 0))
     self.DrawUpgrades()
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Strategic'),
                    const.attributeDevIndexSovereignty)
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Military'),
                    const.attributeDevIndexMilitary)
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Industry'),
                    const.attributeDevIndexIndustrial)
     self.DrawInfo()
Пример #30
0
 def ApplyAttributes(self, attributes):
     super(uicls.CameraDebugWindow, self).ApplyAttributes(attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetCaption('Camera Debug Window')
     self.sr.content.padding = (5, 16, 5, 5)
     self.debugSelectionClient = sm.GetService('debugSelectionClient')
     self.cameraDebugClient = sm.GetService('cameraDebugClient')
     self.cameraClient = sm.GetService('cameraClient')
     self.cameraStack = uicls.Label(parent=self.sr.content, align=uiconst.TOPLEFT, text=self.PrintCameraStack())
     buttonContainer = uicls.Container(parent=self.sr.content, align=uiconst.TOBOTTOM, height=70, padding=(150, 0, 150, 0))
     self.toggleCamera = uicls.Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Activate Normal Camera', func=self.OnToggleDebugCamera)
     self.toggleCamUpdate = uicls.Button(parent=buttonContainer, align=uiconst.TOBOTTOM, label='Toggle Camera Update', func=self.OnToggleDebugCameraUpdate, hint='Toggle between updating the debug, and normal camera.')
     self.showCamCheckBox = uicls.Checkbox(parent=buttonContainer, aligh=uiconst.TOBOTTOM, text='Show Normal Camera', checked=False, callback=self.OnSnowNormalCameraCheckbox)
     self.cameraClient.AddSharedCamera('Debug Camera', cameras.DebugCamera())
     if type(self.cameraClient.GetActiveCamera()) is cameras.DebugCamera:
         self.DisableDebugCamera()
     self.EnableDebugCamera()
     sm.GetService('navigation').hasControl = False