def SetTextList(self, textList, funcList=None, funcKeywordsList=None):
        self.textCont.Flush()
        if self.scrollThread:
            self.scrollThread.kill()
        if not textList:
            return
        x = 0
        for i, text in enumerate(textList):
            if i != 0:
                bullet = uiprimitives.Sprite(
                    parent=self.textCont,
                    align=uiconst.CENTERLEFT,
                    texturePath=
                    'res:/UI/texture/classes/CQMainScreen/bullet.png',
                    pos=(x, 0, 11, 11),
                    color=self.color)
                bulletWidth = bullet.width + 10
            else:
                bulletWidth = 0
            if funcList:
                clickFunc = funcList[i]
            else:
                clickFunc = None
            if funcKeywordsList:
                funcKeywords = funcKeywordsList[i]
            else:
                funcKeywords = None
            labelCont = uicls._AutoTextLabelCont(parent=self.textCont,
                                                 clickFunc=clickFunc,
                                                 funcKeywords=funcKeywords,
                                                 left=x + bulletWidth,
                                                 align=uiconst.TOPLEFT)
            label = uicontrols.Label(parent=labelCont,
                                     text='<b>%s' % text,
                                     fontsize=self.fontSize,
                                     color=self.color)
            labelCont.width = label.width
            labelCont.height = label.height
            x += label.width + 10 + bulletWidth

        self.textCont.width = x
        self.textCont.height = label.height
        self.scrollThread = uthread.new(self.ScrollThread)
示例#2
0
 def PositionSliderMark(self):
     if self.sr.mark is None:
         self.sr.mark = uiprimitives.Container(name='mark',
                                               parent=self,
                                               align=uiconst.TOPLEFT,
                                               width=self.width,
                                               height=self.width,
                                               idx=0,
                                               state=uiconst.UI_DISABLED)
         illsprite = uiprimitives.Sprite(
             parent=self.sr.mark,
             state=uiconst.UI_DISABLED,
             align=uiconst.RELATIVE,
             width=36,
             height=36,
             texturePath='res:/UI/Texture/colorslider.dds')
     if self.sr.mark:
         l, t, w, h = self.GetAbsolute()
         self.sr.mark.top = int(h * self.value) - self.sr.mark.height / 2
示例#3
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self._mode = None
     self.isInModeTransition = False
     self.isModeFixed = attributes.Get('isModeFixed',
                                       self.default_isModeFixed)
     self.topCont = uiprimitives.Container(name='topCont',
                                           parent=self,
                                           align=uiconst.TOTOP,
                                           state=uiconst.UI_NORMAL,
                                           height=28)
     if not self.isModeFixed:
         self.topCont.OnClick = self.OnTopContClick
         self.topCont.OnDblClick = self.OnTopContDblClick
         self.topCont.OnMouseEnter = self.OnTopContMouseEnter
         self.topCont.OnMouseExit = self.OnTopContMouseExit
     self.hoverBG = uiprimitives.Fill(bgParent=self.topCont,
                                      color=util.Color.WHITE,
                                      opacity=0.0)
     self.headerBtnCont = uiprimitives.Container(
         name='headerBtnCont',
         parent=self.topCont,
         align=uiconst.TOLEFT,
         width=infoPanelConst.LEFTPAD)
     self.headerCont = uiprimitives.Container(name='headerCont',
                                              parent=self.topCont)
     self.headerButton = self.ConstructHeaderButton()
     self.collapseArrow = uiprimitives.Sprite(
         parent=self.headerBtnCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_DISABLED,
         texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png',
         pos=(6, 0, 7, 7),
         opacity=0.0)
     if not self.hasSettings:
         self.headerButton.pickState = uiconst.TR2_SPS_OFF
     self.mainCont = uicontrols.ContainerAutoSize(
         name='mainCont',
         parent=self,
         align=uiconst.TOTOP,
         padLeft=infoPanelConst.LEFTPAD,
         padBottom=self.MAINPADBOTTOM)
示例#4
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.charID = attributes.get('charID')
     self.timeout = attributes.get('timeout')
     self.isDragObject = True
     self.itemID = self.charID
     self.info = cfg.eveowners.Get(self.charID)
     self.activeBlink = None
     self.highlight = uiprimitives.Fill(bgParent=self,
                                        color=(1, 1, 1, 0.1),
                                        state=uiconst.UI_HIDDEN)
     leftCont = uiprimitives.Container(parent=self,
                                       align=uiconst.TOLEFT,
                                       width=54)
     self.time = uicontrols.Label(parent=leftCont,
                                  name='counter',
                                  text='',
                                  fontsize=16,
                                  bold=False,
                                  align=uiconst.CENTERLEFT,
                                  color=Colors.Engagement.GetRGBA(),
                                  left=2 * const.defaultPadding)
     self.portrait = uiprimitives.Sprite(parent=self,
                                         pos=(50, 0, 32, 32),
                                         state=uiconst.UI_DISABLED)
     uicontrols.EveLabelSmall(parent=self,
                              name='name',
                              text=self.info.ownerName,
                              align=uiconst.TOPLEFT,
                              top=1,
                              left=96)
     self.corpText = uicontrols.EveLabelSmall(parent=self,
                                              name='corporation',
                                              text='',
                                              align=uiconst.TOPLEFT,
                                              top=17,
                                              left=96)
     self.stateFlag = FlagIconWithState(parent=self,
                                        align=uiconst.TOPRIGHT,
                                        left=13,
                                        top=4)
     self.LoadData()
     sm.RegisterNotify(self)
示例#5
0
 def Setup(self, *args):
     self.width = 130
     self.height = 130
     self.SetOpacity(0.0)
     hex = uicls.CCHexButtonHead(name='headHex', parent=self, align=uiconst.CENTERTOP, state=uiconst.UI_NORMAL, pos=(0, 0, 64, 64), pickRadius=21, info=None, id=0, hexName=localization.GetByLabel('UI/CharacterCreation/ZoomIn'), func=self.HeadClicked, iconNum=0, showIcon=False)
     self.sr.headSolid = hex.selection
     hex.selection.state = uiconst.UI_DISABLED
     self.sr.headFrame = hex.frame
     self.sr.headHex = hex
     hex = uicls.CCHexButtonBody(name='bodyHex', parent=self, align=uiconst.CENTERTOP, state=uiconst.UI_NORMAL, pos=(0, 16, 128, 128), pickRadius=42, info=None, id=0, hexName=localization.GetByLabel('UI/CharacterCreation/ZoomOut'), func=self.BodyClicked, iconNum=0, showIcon=False)
     self.sr.bodySolid = hex.selection
     hex.selection.state = uiconst.UI_DISABLED
     self.sr.bodyFrame = hex.frame
     self.sr.bodyHex = hex
     texturePath = 'res:/UI/Texture/CharacterCreation/silhuette_ghost.dds'
     sprite = uiprimitives.Sprite(name='ghost', parent=self, align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, pos=(0, 7, 128, 128), idx=0, texturePath=texturePath)
     sprite.rectLeft, sprite.rectTop, sprite.rectWidth, sprite.rectHeight = (0, 0, 0, 0)
     self.sr.updateTimer = base.AutoTimer(33, self.UpdatePosition)
     uthread.new(uicore.effect.CombineEffects, self, opacity=1.0, time=250.0)
示例#6
0
 def GetScenePicture(self, res=128, blur=0):
     scene = sm.GetService('sceneManager').GetRegisteredScene(
         None, defaultOnActiveScene=True)
     camera = sm.GetService('sceneManager').GetActiveCamera()
     depthTexture = scene.depthTexture
     scene.depthTexture = None
     renderTarget = trinity.Tr2RenderTarget(
         res, res, 1, trinity.PIXEL_FORMAT.B8G8R8A8_UNORM)
     depthStencil = trinity.Tr2DepthStencil(
         res, res, trinity.DEPTH_STENCIL_FORMAT.AUTO)
     view = trinity.TriView()
     view.transform = camera.viewMatrix.transform
     projection = camera.projectionMatrix
     renderJob = trinity.CreateRenderJob('StaticScene')
     renderJob.PushRenderTarget(renderTarget)
     renderJob.PushDepthStencil(depthStencil)
     renderJob.SetProjection(projection)
     renderJob.SetView(view)
     renderJob.Clear((0.0, 0.0, 0.0, 0.0), 1.0)
     renderJob.RenderScene(scene)
     renderJob.PopDepthStencil()
     renderJob.PopRenderTarget()
     renderJob.ScheduleOnce()
     renderJob.WaitForFinish()
     scene.depthTexture = depthTexture
     hostCopy = trinity.Tr2HostBitmap(renderTarget)
     hostCopy.name = 'hostCopy'
     if blur:
         gaussBlur = trinity.TriConvolutionMatrix5(2.0, 3.0, 5.0, 3.0, 2.0,
                                                   3.0, 4.0, 8.0, 5.0, 3.0,
                                                   5.0, 7.0, 13.0, 7.0, 5.0,
                                                   3.0, 4.0, 8.0, 5.0, 3.0,
                                                   2.0, 3.0, 5.0, 3.0, 2.0)
         blurCopy = trinity.Tr2HostBitmap(
             res, res, 1, trinity.PIXEL_FORMAT.B8G8R8A8_UNORM)
         blurCopy.name = 'blurCopy'
         blurCopy.ApplyConvFilter(hostCopy, gaussBlur, 0)
         hostCopy = blurCopy
     pic = uiprimitives.Sprite(align=uiconst.TOALL)
     pic.texture.atlasTexture = uicore.uilib.CreateTexture(res, res)
     pic.texture.atlasTexture.CopyFromHostBitmap(hostCopy)
     return pic
示例#7
0
 def LoadAttrs(self, attrs):
     src = attrs.src
     if attrs.texture:
         sprite = uiprimitives.Sprite(parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
         sprite.texture = attrs.texture
     elif src.startswith('icon:'):
         uthread.new(self.LoadIcon)
     parts = src.split(':', 1)
     if len(parts) == 2:
         imageType, imageData = parts
         if imageType == 'portrait':
             uthread.new(self.LoadPortrait)
         elif imageType in self.LOGO_IMAGE_TYPES:
             logo = uiutil.GetLogoIcon(itemID=int(imageData), align=uiconst.TOALL, parent=self, state=uiconst.UI_DISABLED)
         elif src.startswith('starmap:'):
             uthread.new(self.GetMap, src)
         elif src.startswith('typeicon:'):
             uthread.new(self.LoadTypeIcon)
         elif imageType == 'reward':
             uthread.new(self.LoadReward, int(imageData)).context = 'Image::LoadReward'
 def OnCorpFinderScreenDesktopCreated(self,
                                      desktop,
                                      entityID,
                                      newCorpID=None):
     if newCorpID is None:
         newCorpID = session.corpid
     self.corpFinderScreenDesktop = desktop
     if prefs.GetValue('cqScreensEnabled', True):
         self.corpFinderScreen = cqscreen.CorpFinderScreen(
             parent=self.corpFinderScreenDesktop,
             corpID=newCorpID,
             entityID=entityID)
     else:
         self.corpFinderScreen = uiprimitives.Sprite(
             name='screenLeftFallback',
             parent=desktop,
             texturePath=
             'res:/UI/Texture/classes/CQSideScreens/corpRecruitmentScreenBG.png',
             align=uiconst.TOALL)
         self.corpFinderScreen.entityID = entityID
 def InitBroadcastBottom(self):
     self.sr.broadcastBottom = uiprimitives.Container(name='broadcastBottom', parent=self.sr.main, align=uiconst.TOBOTTOM, height=BROADCAST_HEIGHT, state=uiconst.UI_HIDDEN)
     broadcastHeaderParent = uiprimitives.Container(name='lastbroadcastheader', parent=self.sr.main, align=uiconst.TOBOTTOM, state=uiconst.UI_NORMAL, height=24)
     broadcastHeaderParent.padBottom = 3
     expanderCont = uiprimitives.Container(name='expanderCont', parent=broadcastHeaderParent, align=uiconst.TORIGHT, state=uiconst.UI_NORMAL, width=18)
     expanderCont.OnClick = self.ToggleBroadcasts
     broadcastHeaderParent.height = uix.GetTextHeight('Xg')
     self.sr.broadcastHeaderParent = broadcastHeaderParent
     expander = uiprimitives.Sprite(parent=expanderCont, pos=(5, 0, 11, 11), name='expandericon', state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/Shared/expanderUp.png', align=uiconst.TOPRIGHT)
     self.sr.broadcastExpanderIcon = expander
     uix.Flush(self.sr.broadcastBottom)
     self.sr.lastBroadcastCont = uiprimitives.Container(name='lastBroadcastCont', parent=broadcastHeaderParent, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_NORMAL)
     uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoBroadcasts'), parent=self.sr.lastBroadcastCont, left=6, top=1, width=500, state=uiconst.UI_NORMAL)
     self.sr.lastVoiceEventCont = uiprimitives.Container(name='lastVoiceEventCont', parent=self.sr.broadcastBottom, align=uiconst.TOTOP_PROP, top=0, left=0, height=1.0, width=1.0, state=uiconst.UI_PICKCHILDREN)
     uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoVoiceBroadcasts'), parent=self.sr.lastVoiceEventCont, left=6, top=0, width=500)
     self.sr.actionsCont = uiprimitives.Container(name='actionsCont', parent=self.sr.broadcastBottom, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_NORMAL)
     self.sr.toggleCont = uiprimitives.Container(name='toggleCont', parent=self.sr.actionsCont, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_PICKCHILDREN)
     self.sr.line = uiprimitives.Container(name='lineparent', align=uiconst.TOTOP, parent=self.sr.actionsCont, idx=0, height=1)
     uiprimitives.Line(parent=self.sr.line, align=uiconst.TOALL)
     self.InitActions()
 def ApplyAttributes(self, attributes):
     uicls.RadialMenuActionBase.ApplyAttributes(self, attributes)
     self.rangeList = attributes.rangeList
     self.defaultRange = attributes.defaultRange
     self.percOfAllRange = None
     self.currentRange = self.defaultRange
     self.minRangeDistance = attributes.sizeInfo.actionDistance
     self.actionButtonTopPadding = attributes.get('actionButtonTopPadding',
                                                  0)
     self.usePreciseRanges = attributes.get('usePreciseRanges', True)
     self.maxRangeDistance = 300
     self.lastLength = None
     self.rangeArrow = uiprimitives.Sprite(
         parent=self,
         name='rangeArrow',
         pos=(0, self.actionButtonTopPadding + 1, 18, 12),
         state=uiconst.UI_DISABLED,
         align=uiconst.CENTERTOP,
         texturePath='res:/UI/Texture/classes/RadialMenu/rangeArrow.png',
         idx=0)
 def ApplyAttributes(self, attributes):
     uicontrols.Window.ApplyAttributes(self, attributes)
     self.scope = 'all'
     self.sr.browser = uicontrols.Edit(parent=self.sr.main, padding=const.defaultPadding, readonly=1)
     self.sr.browser.HideBackground(True)
     self.sr.browser.AllowResizeUpdates(0)
     self.sr.browser.sr.window = self
     m = uicls.UtilMenu(menuAlign=uiconst.TOPRIGHT, parent=self.sr.topParent, align=uiconst.TOPRIGHT, left=const.defaultPadding, top=18, GetUtilMenu=self.SettingMenu, texturePath='res:/UI/Texture/Icons/73_16_50.png')
     self.nextFunc = attributes.nextFunc
     self.backFunc = attributes.backFunc
     self.onStartScalingWidth = None
     self.onStartScalingHeight = None
     self.constrainScreen = True
     if self.sr.stack is not None:
         self.sr.stack.RemoveWnd(self, 0, 0)
     if sm.GetService('tutorial').IsTutorialWindowUnkillable():
         self.MakeUnKillable()
         repairSysSkill = sm.GetService('skills').HasSkill(const.typeRepairSystems)
         shieldOpsSkill = sm.GetService('skills').HasSkill(const.typeShieldOperations)
         if repairSysSkill or shieldOpsSkill:
             self.MakeKillable()
     Sprite(parent=self.sr.topParent, name='mainicon', pos=(0, 2, 64, 64), texturePath='res:/UI/Texture/Icons/74_64_13.png')
     self.HideHeader()
     self.MakeUnstackable()
     self.SetMinSize([350, 220])
     self.imgpar = uiprimitives.Container(name='imgpar', parent=self.sr.main, align=uiconst.TOLEFT, width=64, idx=4, state=uiconst.UI_HIDDEN, clipChildren=1)
     imgparclipper = uiprimitives.Container(name='imgparclipper', parent=self.imgpar, align=uiconst.TOALL, left=5, top=5, width=5, height=5, clipChildren=1)
     self.img = uiprimitives.Sprite(parent=imgparclipper, align=uiconst.RELATIVE, left=1, top=1)
     self.bottomCont = uiprimitives.Container(name='bottom', parent=self.sr.maincontainer, align=uiconst.TOBOTTOM, height=32, idx=0)
     self.backBtn = Button(parent=self.bottomCont, label=localization.GetByLabel('UI/Commands/Back'), name='tutorialBackBtn', func=self.backFunc, align=uiconst.TOLEFT, padding=(8, 0, 0, 6))
     self.nextBtn = Button(parent=self.bottomCont, label=localization.GetByLabel('UI/Commands/Next'), name='tutorialNextBtn', func=self.nextFunc, align=uiconst.TORIGHT, padding=(0, 0, 8, 6), btn_default=1)
     self.Confirm = self.nextFunc
     self.sr.text = uicontrols.EveLabelMedium(text='', parent=self.bottomCont, state=uiconst.UI_DISABLED, align=uiconst.CENTER)
     top = self.tTop = uiprimitives.Container(name='tTop', parent=self.sr.topParent, align=uiconst.TOALL, padding=(64, 0, 24, 0), idx=0)
     self.captionText = uicontrols.EveLabelLarge(text='', parent=top, align=uiconst.TOTOP, top=10, state=uiconst.UI_DISABLED)
     self.captionText.OnSizeChanged = self.CheckTopHeight
     self.subcaption = uicontrols.Label(text='', parent=top, align=uiconst.TOTOP, state=uiconst.UI_DISABLED, fontsize=18, color=TutorialColor.HINT_FRAME)
     self.sr.browser.AllowResizeUpdates(1)
     self.SetParent(uicore.layer.abovemain)
     uicore.animations.SpSwoopBlink(self.blinkFill, rotation=math.pi - 0.5, duration=3.0, loops=TutorialConstants.NUM_BLINKS)
     uicore.animations.SpSwoopBlink(self.blinkBorder, rotation=math.pi - 0.5, duration=3.0, loops=TutorialConstants.NUM_BLINKS)
 def SetOnline(self, online):
     if online is None:
         if self.sr.Get('onlinestatus', None):
             self.sr.onlinestatus.state = uiconst.UI_HIDDEN
     else:
         if not self.sr.Get('onlinestatus', None):
             col = uiprimitives.Sprite(
                 parent=self.sr.name,
                 align=uiconst.TOPRIGHT,
                 pos=(20, 10, 10, 10),
                 texturePath='res:/UI/Texture/classes/Chat/Status.png')
             self.sr.onlinestatus = col
         color = self.GetOnlineColor(online)
         self.sr.onlinestatus.SetRGB(*color)
         if online:
             self.sr.onlinestatus.hint = localization.GetByLabel(
                 'UI/InfrastructureHub/Online')
         else:
             self.sr.onlinestatus.hint = localization.GetByLabel(
                 'UI/InfrastructureHub/Offline')
         self.sr.onlinestatus.state = uiconst.UI_NORMAL
示例#13
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.lowerLimit = attributes.lowerLimit
     self.upperLimit = attributes.upperLimit
     self.lpAmount = attributes.lpAmount
     self.lastAmount = 0
     self.level = attributes.level
     self.leftCont = uiprimitives.Container(name='leftCont', parent=self, align=uiconst.TOLEFT_PROP, width=0.75)
     self.rightCont = uiprimitives.Container(name='rightCont', parent=self)
     self.bgFrame = uicontrols.Frame(bgParent=self.leftCont, frameConst=uiconst.FRAME_BORDER1_CORNER1)
     self.bgGradient = uicontrols.GradientSprite(bgParent=self.leftCont, rotation=-pi / 2)
     levelName = uicontrols.EveCaptionLarge(parent=self.leftCont, text=self.GetLevelName(), top=5, left=10)
     if self.level == 6:
         levelName.fontsize = 16
     self.progressGauge = uicls.Gauge(parent=self.leftCont, value=0.0, color=(0.0, 0.31, 0.4, 1.0), backgroundColor=(0.1, 0.1, 0.1, 1.0), align=uiconst.TOBOTTOM, gaugeHeight=15, padding=2, opacity=0.0)
     self.progressGauge.GetHint = self.GetProgressGaugeHint
     self.iconCont = uiprimitives.Container(name='iconCont', parent=self.leftCont, align=uiconst.TOPRIGHT, pos=(10, 4, 300, 20))
     self.ConstructIcons()
     self.checkboxSprite = uiprimitives.Sprite(name='checkboxSprite', parent=self.rightCont, align=uiconst.CENTERLEFT, pos=(15, 0, 16, 16))
     uicontrols.EveLabelLarge(parent=self.rightCont, text=localization.formatters.FormatNumeric(self.upperLimit, useGrouping=True), align=uiconst.CENTERLEFT, left=50)
     self.SetLPAmount(self.lpAmount, init=True)
示例#14
0
 def InitUI(self):
     self.selectionScreen.Flush()
     self.redeemPanel = RedeemPanel(
         parent=self.selectionScreen,
         collapseCallback=self.ExitRedeemMode,
         expandCallback=self.EnterRedeemMode,
         dragEnabled=True,
         instructionText=localization.GetByLabel(
             'UI/RedeemWindow/DragAndDropToGive'),
         redeemButtonBorderColor=csColors.REDEEM_BORDER,
         redeemButtonBackgroundColor=csColors.REDEEM_BORDER_BACKGROUND,
         redeemButtonFillColor=csColors.REDEEM_BORDER_FILL,
         textColor=csColors.REDEEM_PANEL_AVAILABLE_TEXT,
         redeemPanelBackgroundColor=csColors.REDEEM_PANEL_FILL)
     self.topBorder = Container(name='topBorder',
                                parent=self.selectionScreen,
                                align=uiconst.TOTOP_NOPUSH,
                                height=40,
                                state=uiconst.UI_PICKCHILDREN)
     self.centerArea = Container(name='centerAra',
                                 parent=self.selectionScreen,
                                 align=uiconst.TOALL,
                                 state=uiconst.UI_PICKCHILDREN)
     self.logoCont = Container(parent=self,
                               name='logoCont',
                               align=uiconst.TOTOP_NOPUSH,
                               height=100,
                               state=uiconst.UI_NORMAL)
     self.logo = uiprimitives.Sprite(
         parent=self.logoCont,
         texturePath='res:/UI/Texture/classes/CharacterSelection/logo.png',
         align=uiconst.CENTER,
         pos=(0, 0, LOGO_WIDTH, LOGO_HEIGHT))
     self.charactersCont = Container(name='charactersCont',
                                     parent=self.centerArea,
                                     align=uiconst.CENTER,
                                     state=uiconst.UI_PICKCHILDREN,
                                     width=1050,
                                     height=600)
     self.SetupCharacterSlots()
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.statType = attributes.statType
     self.value = None
     self.diffQueue = []
     self.mainCont = uicontrols.ContainerAutoSize(parent=self,
                                                  align=uiconst.CENTER)
     uiprimitives.Sprite(name='icon',
                         parent=self.mainCont,
                         align=uiconst.TOPLEFT,
                         state=uiconst.UI_DISABLED,
                         texturePath=self.GetTexturePath(),
                         pos=(0, 0, 10, 10),
                         opacity=0.7)
     self.label = uicontrols.Label(name='label',
                                   parent=self.mainCont,
                                   align=uiconst.TOPLEFT,
                                   state=uiconst.UI_DISABLED,
                                   color=util.Color.WHITE,
                                   fontsize=10,
                                   pos=(11, -1, 0, 0))
     self.diffLabel = None
示例#16
0
 def StartTransition(self, fromView, toView):
     viewstate.Transition.StartTransition(self, fromView, toView)
     viewState = sm.GetService('viewState')
     self.fadeLayer = uiprimitives.Container(name='transition_overlay', parent=viewState.overlayLayerParent, pickState=uiconst.TR2_SPS_OFF, bgColor=util.Color.BLACK, opacity=0.0)
     height = uicore.desktop.height
     width = uicore.desktop.width
     self.loadingText = uicontrols.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)
     stationRace = evetypes.GetRaceID(eve.stationItem.stationTypeID)
     backgroundToUse = self.racialLoadingBackgrounds[stationRace]
     uiprimitives.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)
     lobby = GetLobbyClass().GetIfOpen()
     if lobby is not None and not lobby.destroyed:
         lobby.LockUndockButton()
示例#17
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.blinkSprite = uiprimitives.Sprite(
         bgParent=self,
         name='blinkSprite',
         texturePath='res:/UI/Texture/classes/Neocom/buttonDown.png',
         state=uiconst.UI_DISABLED)
     uicontrols.Frame(name='pointerFrame',
                      bgParent=self,
                      color=TutorialColor.HINT_FRAME)
     uiprimitives.Fill(name='UIPointerImg',
                       bgParent=self,
                       color=TutorialColor.BACKGROUND)
     uicore.animations.SpSwoopBlink(self.blinkSprite,
                                    rotation=math.pi - 0.5,
                                    duration=3.0,
                                    loops=TutorialConstants.NUM_BLINKS)
     self.headerButtons = uiprimitives.Container(
         name='headerButtons',
         state=uiconst.UI_PICKCHILDREN,
         align=uiconst.TOPRIGHT,
         parent=self,
         pos=(5, 0, 15, 15),
         idx=0,
         display=False)
     uicls.ImageButton(
         name='close',
         parent=self.headerButtons,
         align=uiconst.TOPRIGHT,
         state=uiconst.UI_NORMAL,
         pos=(0, 0, 16, 16),
         idleIcon='ui_38_16_220',
         mouseoverIcon='ui_38_16_220',
         mousedownIcon='ui_38_16_220',
         onclick=lambda: getattr(self, 'OnCloseContainer')(),
         expandonleft=True,
         hint=localization.GetByLabel('UI/Common/Buttons/Close'))
     self.headerButtons.Hide()
示例#18
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 = uiprimitives.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 = uiprimitives.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 = uicontrols.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 = uiprimitives.Sprite(parent=slot,
                                             texturePath=None,
                                             align=uiconst.TOALL,
                                             padding=(2, 2, 2, 2),
                                             state=uiconst.UI_DISABLED)
     uiprimitives.Fill(parent=slot,
                       padding=(2, 2, 2, 2),
                       color=(0.0, 0.0, 0.0, 0.75))
     return slot
示例#19
0
 def DrawFill(self):
     step = math.pi / 90.0
     fromAngle, toAngle, rotationRange = self.rotationRange
     l, t, w, h = self.GetAbsolute()
     ox, oy = self.centerOffset
     radius = self.textureRadius
     startAngle = fromAngle + math.pi
     while startAngle < fromAngle + rotationRange + math.pi:
         cos = math.cos(startAngle)
         sin = math.sin(startAngle)
         left = int(radius * cos) + ox - 8
         top = int(radius * sin) + oy - 8
         fillDot = uiprimitives.Sprite(
             parent=self,
             align=uiconst.TOPLEFT,
             pos=(left, top, 16, 16),
             texturePath=
             'res:/UI/Texture/CharacterCreation/ovalSlider_Filler.dds',
             ignoreSize=True,
             state=uiconst.UI_DISABLED,
             name='fillDot',
             color=(0.3, 0.3, 0.3, 1.0))
         startAngle += step
示例#20
0
 def ConstructLayout(self):
     self.topFill = uiprimitives.Container(parent=self,
                                           name='topFill',
                                           align=uiconst.TOTOP,
                                           height=30)
     BlurredSceneUnderlay(bgParent=self.topFill)
     self.topBG = uiprimitives.Sprite(
         parent=self.topFill,
         align=uiconst.TOALL,
         texturePath='res:/UI/Texture/classes/Neocom/eveButtonBg.png',
         blendMode=trinity.TR2_SBM_ADD)
     self.main = uiprimitives.Container(name='main', parent=self, padTop=3)
     self.bgFill = FillUnderlay(parent=self,
                                align=uiconst.TOTOP,
                                colorType=uiconst.COLORTYPE_UIBASE,
                                opacity=0.8)
     GradientUnderlay(parent=self,
                      align=uiconst.TOALL,
                      colorType=uiconst.COLORTYPE_UIBASE,
                      rgbData=[(0.0, (1.0, 1.0, 1.0))],
                      alphaData=[(0.0, 0.8), (0.4, 0.3), (1.0, 0.1)],
                      rotation=-pi / 2)
     BlurredSceneUnderlay(bgParent=self, isPinned=True, opacity=0.8)
示例#21
0
 def ConstructFoeSquares(self, proportion):
     self.bottomCont.Flush()
     for i in xrange(int(ceil(proportion * 5))):
         cont = uiprimitives.Container(parent=self.bottomCont,
                                       align=uiconst.TORIGHT_PROP,
                                       state=uiconst.UI_NORMAL,
                                       width=0.2,
                                       padding=(0, 2, 0, 20),
                                       hint=localization.GetByLabel(
                                           self.TIERHINTS[i]))
         subCont = uiprimitives.Container(parent=cont, padding=(2, 0, 2, 0))
         uiprimitives.Sprite(
             bgParent=subCont,
             texturePath='res:/UI/Texture/Classes/FWWindow/TierBlock.png',
             opacity=0.5)
         uiprimitives.Fill(bgParent=subCont, color=facwarCommon.COLOR_FOE)
         uicontrols.EveHeaderLarge(parent=subCont,
                                   align=uiconst.CENTERBOTTOM,
                                   top=-22,
                                   text=localization.GetByLabel(
                                       'UI/FactionWarfare/TierNum',
                                       tierNum=i + 1),
                                   color=facwarCommon.COLOR_FOE_LIGHT)
 def UpdateDrones(self):
     if not self.drones:
         self.RemoveWeapon('drones')
         return
     droneIconCont = self.GetWeapon('drones')
     if not droneIconCont:
         cont = uiprimitives.Container(parent=self.sr.assigned,
                                       align=uiconst.RELATIVE,
                                       width=32,
                                       height=32,
                                       state=uiconst.UI_HIDDEN)
         icon = uiprimitives.Sprite(
             parent=cont,
             align=uiconst.TOALL,
             width=0,
             height=0,
             state=uiconst.UI_NORMAL,
             texturePath='res:/UI/Texture/Icons/56_64_5.png')
         cont.sr.moduleID = 'drones'
         cont.icon = icon
         icon.sr.moduleID = 'drones'
         self.ArrangeWeapons()
     self.UpdateDroneHint()
示例#23
0
 def ApplyAttributes(self, attributes):
     uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.copyicon = uicontrols.Icon(icon='ui_73_16_1', parent=self, pos=(3, 3, 16, 16), align=uiconst.TOPRIGHT, hint=localization.GetByLabel('UI/Control/Entries/CopyKillInfo'))
     self.copyicon.OnClick = self.GetCombatText
     iconCont = uiprimitives.Container(parent=self, align=uiconst.TOLEFT, width=40)
     self.shipCont = uiprimitives.Container(parent=iconCont, align=uiconst.CENTER, width=32, height=32)
     self.shipFrame = uicontrols.Frame(parent=self.shipCont)
     self.shipIcon = uicontrols.Icon(parent=self.shipCont, align=uiconst.TOALL, size=256, ignoreSize=True)
     self.shipIcon.cursor = uiconst.UICURSOR_MAGNIFIER
     self.shipIcon.OnClick = (self.OnPreviewClick, self.shipIcon)
     self.shipIcon.OnMouseEnter = self.OnControlEnter
     self.shipIcon.OnMouseExit = self.OnControlExit
     self.techIcon = uiprimitives.Sprite(name='techIcon', parent=self.shipCont, align=uiconst.RELATIVE, width=16, height=16, idx=0, left=1, top=1)
     self.techIcon.OnMouseEnter = self.OnControlEnter
     self.techIcon.OnMouseExit = self.OnControlExit
     self.timeCont = uiprimitives.Container(parent=self, align=uiconst.TORIGHT, width=35, padRight=6)
     self.textCont = uiprimitives.Container(parent=self, align=uiconst.TOALL, state=uiconst.UI_PICKCHILDREN, clipChildren=True)
     self.victimLabel = uicontrols.EveLabelMedium(text='', parent=self.textCont, left=5, top=3, state=uiconst.UI_NORMAL, maxLines=1)
     self.killerLabel = uicontrols.EveLabelMedium(text='', parent=self.textCont, left=5, top=20, state=uiconst.UI_NORMAL, maxLines=1)
     self.dateLabel = uicontrols.EveLabelMedium(text='', parent=self.timeCont, align=uiconst.TOPRIGHT, top=20)
     self.victimLabel.OnMouseEnter = self.OnControlEnter
     self.victimLabel.OnMouseExit = self.OnControlExit
     self.killerLabel.OnMouseEnter = self.OnControlEnter
     self.killerLabel.OnMouseExit = self.OnControlExit
示例#24
0
 def __init__(self, effectInfo, iconParams):
     self.icon = uiprimitives.Sprite(name=effectInfo['name'], texturePath=effectInfo['texturePath'], hint=localization.GetByLabel(effectInfo['hint']), **iconParams)
     self.isScalable = effectInfo['isScalable']
    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        sm.RegisterNotify(self)
        self.strength = None
        self.coherence = None
        self.iconSprite = uiprimitives.Sprite(
            name='virusIconSprite',
            texturePath='res:/UI/Texture/classes/hacking/hudIcon.png',
            parent=self,
            align=uiconst.CENTER,
            state=uiconst.UI_DISABLED,
            pos=(0, 0, 59, 44))
        self.coherenceBar = VirusInfoBar(
            parent=self,
            align=uiconst.CENTERLEFT,
            color=hackingUIConst.COLOR_HUD_BAR_COHERENCE)
        self.strengthBar = VirusInfoBar(
            parent=self,
            align=uiconst.CENTERRIGHT,
            color=hackingUIConst.COLOR_HUD_BAR_STRENGTH,
            mirrored=True)
        self.strengthCont = StatContainer(
            name='strengthCont',
            parent=self,
            statType=hackingUIConst.STAT_STRENGTH,
            align=uiconst.CENTERBOTTOM,
            state=uiconst.UI_NORMAL,
            top=4,
            hint=localization.GetByLabel('UI/Hacking/VirusStrength'))
        self.coherenceCont = StatContainer(
            name='coherencesCont',
            parent=self,
            statType=hackingUIConst.STAT_COHERENCE,
            align=uiconst.CENTERTOP,
            state=uiconst.UI_NORMAL,
            top=4,
            hint=localization.GetByLabel('UI/Hacking/VirusCoherence'))
        uiprimitives.Sprite(
            name='bg',
            parent=self,
            align=uiconst.TOALL,
            texturePath='res:/UI/Texture/classes/hacking/hudBG.png')
        noiseData = ('res:/UI/Texture/Classes/hacking/hudNoise1.png',
                     'res:/UI/Texture/Classes/hacking/hudNoise2.png',
                     'res:/UI/Texture/Classes/hacking/hudNoise3.png',
                     'res:/UI/Texture/Classes/hacking/hudNoise4.png')
        self.noiseSprites = []
        for num, texturePath in enumerate(noiseData):
            noise = HudNoise(parent=self,
                             texturePath=texturePath,
                             width=self.width,
                             height=self.height,
                             num=num)
            self.noiseSprites.append(noise)

        self.iconBG = uiprimitives.Sprite(
            name='iconBG',
            texturePath='res:/UI/Texture/classes/hacking/hudIconBG.png',
            parent=self,
            align=uiconst.CENTER,
            state=uiconst.UI_DISABLED,
            pos=(0, 0, 118, 118),
            opacity=0.0)
        self.animateIconThread = None
        self.AnimateIconBG()
示例#26
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     leftCont = uiprimitives.Container(name='leftCont',
                                       parent=self,
                                       align=uiconst.TOLEFT_PROP,
                                       width=SIDE_WIDTH)
     self.friendIcon = uicls.LogoIcon(name='friendIcon',
                                      parent=leftCont,
                                      align=uiconst.CENTER,
                                      width=32,
                                      height=32,
                                      top=-20,
                                      ignoreSize=True)
     rightCont = uiprimitives.Container(name='leftCont',
                                        parent=self,
                                        align=uiconst.TORIGHT_PROP,
                                        width=SIDE_WIDTH)
     self.foeIcon = uicls.LogoIcon(name='foeIcon',
                                   parent=rightCont,
                                   align=uiconst.CENTER,
                                   width=32,
                                   height=32,
                                   top=20,
                                   ignoreSize=True)
     self.topCont = uiprimitives.Container(name='topCont',
                                           parent=self,
                                           align=uiconst.TOTOP_PROP,
                                           height=0.4)
     self.bottomCont = uiprimitives.Container(name='bottomCont',
                                              parent=self,
                                              align=uiconst.TOBOTTOM_PROP,
                                              height=0.4)
     self.centerCont = uiprimitives.Container(
         name='centerCont',
         parent=self,
         bgColor=facwarCommon.COLOR_CENTER_BG,
         padding=2)
     w, h = self.centerCont.GetAbsoluteSize()
     spWidth = 134 / 16.0 * h
     self.friendBar = uiprimitives.Container(
         parent=self.centerCont,
         align=uiconst.TOLEFT_PROP,
         state=uiconst.UI_NORMAL,
         bgColor=facwarCommon.COLOR_FRIEND_BAR,
         clipChildren=True)
     self.friendBarSprite = uiprimitives.Sprite(
         parent=self.friendBar,
         state=uiconst.UI_HIDDEN,
         texturePath=
         'res:/ui/texture/classes/InfluenceBar/influenceBarPositive.png',
         color=facwarCommon.COLOR_FRIEND_LIGHT,
         align=uiconst.TOLEFT,
         width=spWidth)
     self.friendPointer = uiprimitives.Container(name='friendPointer',
                                                 align=uiconst.TOPLEFT_PROP,
                                                 parent=self,
                                                 pos=(0.0, 0.5, 2, 0.2),
                                                 idx=0)
     uiprimitives.Line(parent=self.friendPointer,
                       align=uiconst.TOLEFT,
                       weight=2,
                       padBottom=2,
                       color=facwarCommon.COLOR_FRIEND_LIGHT)
     self.friendPointerTxt = uicontrols.EveHeaderLarge(
         name='friendPointerTxt',
         parent=self.friendPointer,
         align=uiconst.CENTERTOP,
         top=-28)
     uiprimitives.Sprite(name='friendTriangle',
                         parent=self.friendPointer,
                         texturePath='res:/ui/texture/icons/105_32_15.png',
                         color=facwarCommon.COLOR_FRIEND_LIGHT,
                         align=uiconst.CENTERTOP,
                         rotation=pi / 2,
                         width=32,
                         height=32,
                         top=-19)
     self.foeBar = uiprimitives.Container(
         parent=self.centerCont,
         align=uiconst.TORIGHT_PROP,
         state=uiconst.UI_NORMAL,
         bgColor=facwarCommon.COLOR_FOE_BAR,
         clipChildren=True)
     self.foeBarSprite = uiprimitives.Sprite(
         parent=self.foeBar,
         state=uiconst.UI_HIDDEN,
         texturePath=
         'res:/ui/texture/classes/InfluenceBar/influenceBarPositive.png',
         color=facwarCommon.COLOR_FOE_LIGHT,
         align=uiconst.TORIGHT,
         width=spWidth)
     self.foePointer = uiprimitives.Container(name='foePointer',
                                              align=uiconst.TOPLEFT_PROP,
                                              parent=self,
                                              pos=(0.0, 0.5, 2, 0.2),
                                              idx=0)
     uiprimitives.Line(parent=self.foePointer,
                       align=uiconst.TORIGHT,
                       weight=2,
                       padTop=2,
                       color=facwarCommon.COLOR_FOE_LIGHT)
     self.foePointerTxt = uicontrols.EveHeaderLarge(
         name='foePointerTxt',
         parent=self.foePointer,
         align=uiconst.CENTERBOTTOM,
         top=-28)
     uiprimitives.Sprite(name='foeTriangle',
                         parent=self.foePointer,
                         texturePath='res:/ui/texture/icons/105_32_15.png',
                         color=facwarCommon.COLOR_FOE_LIGHT,
                         align=uiconst.CENTERBOTTOM,
                         rotation=-pi / 2,
                         width=32,
                         height=32,
                         top=-19)
     uthread.new(self.FetchValues)
     uthread.new(self.AnimateBars)
    def Startup(self, slimItem):
        sm.RegisterNotify(self)
        self.ball = _weakref.ref(
            sm.GetService('michelle').GetBall(slimItem.itemID))
        self.slimItem = _weakref.ref(slimItem)
        self.id = slimItem.itemID
        self.itemID = slimItem.itemID
        self.updatedamage = slimItem.categoryID != const.categoryAsteroid and slimItem.groupID != const.groupHarvestableCloud and slimItem.groupID != const.groupOrbitalTarget
        self.AddUIObjects(slimItem, self.itemID)
        iconPar = self.sr.iconPar
        barAndImageCont = self.barAndImageCont
        barAndImageCont.isDragObject = True
        barAndImageCont.GetDragData = self.GetTargetDragData
        barAndImageCont.OnMouseDown = self.OnTargetMouseDown
        barAndImageCont.OnClick = self.OnTargetClick
        barAndImageCont.GetMenu = self.GetTargetMenu
        barAndImageCont.OnMouseEnter = self.OnTargetMouseEnter
        barAndImageCont.OnMouseExit = self.OnTargetMouseExit
        self.sr.activeTarget = uicls.ActiveTargetOnBracket(parent=iconPar,
                                                           itemID=self.itemID)
        self.slimForFlag = slimItem
        self.SetStandingIcon()
        self.sr.hilite = uiprimitives.Sprite(
            name='hiliteSprite',
            parent=iconPar,
            left=-3,
            top=-3,
            width=100,
            height=100,
            texturePath='res:/UI/Texture/classes/Target/targetUnderlay.png',
            color=(1.0, 1.0, 1.0, 0.05))
        self.sr.activeTarget.RotateArrows()
        labelClass = uicontrols.EveLabelSmall
        labelContainer = uicontrols.ContainerAutoSize(parent=self,
                                                      name='labelContainer',
                                                      align=uiconst.TOTOP)
        self.sr.label = labelClass(text=' ',
                                   parent=labelContainer,
                                   align=uiconst.TOTOP,
                                   state=uiconst.UI_DISABLED,
                                   maxLines=1)
        self.sr.label2 = labelClass(text=' ',
                                    parent=labelContainer,
                                    align=uiconst.TOTOP,
                                    state=uiconst.UI_DISABLED,
                                    maxLines=1)
        self.sr.shipLabel = labelClass(text=' ',
                                       parent=labelContainer,
                                       align=uiconst.TOTOP,
                                       state=uiconst.UI_DISABLED,
                                       maxLines=1)
        self.sr.distanceLabel = labelClass(text=' ',
                                           parent=labelContainer,
                                           align=uiconst.TOTOP,
                                           state=uiconst.UI_DISABLED,
                                           maxLines=1)
        self.SetTargetLabel()
        self.sr.assignedPar = uiprimitives.Container(name='assignedPar',
                                                     align=uiconst.TOTOP,
                                                     parent=self,
                                                     height=32)
        self.sr.assigned = uiprimitives.Container(name='assigned',
                                                  align=uiconst.CENTERTOP,
                                                  parent=self.sr.assignedPar,
                                                  height=32)
        self.sr.updateTimer = base.AutoTimer(random.randint(750, 1000),
                                             self.UpdateData)
        self.UpdateData()
        selected = sm.GetService('state').GetExclState(state.selected)
        self.Select(selected == slimItem.itemID)
        hilited = sm.GetService('state').GetExclState(state.mouseOver)
        self.Hilite(hilited == slimItem.itemID)
        activeTargetID = sm.GetService('target').GetActiveTargetID()
        self.ActiveTarget(activeTargetID == slimItem.itemID)
        drones = sm.GetService('michelle').GetDrones()
        for key in drones:
            droneState = drones[key]
            if droneState.targetID == self.id:
                self.drones[droneState.droneID] = droneState.typeID

        self.UpdateDrones()
        for moduleInfo in sm.GetService(
                'godma').GetStateManager().GetActiveModulesOnTargetID(
                    slimItem.itemID):
            self.AddWeapon(moduleInfo)
 def ApplyAttributes(self, attributes):
     uicontrols.Window.ApplyAttributes(self, attributes)
     self.SetCaption('UI Sprite Test')
     if hasattr(self, 'SetTopparentHeight'):
         self.SetTopparentHeight(0)
     self.textureSetFunc = None
     self.bottomCont = uiprimitives.Container(name='bottomCont',
                                              parent=self.sr.main,
                                              align=uiconst.TOBOTTOM_PROP,
                                              padding=(5, 0, 5, 0),
                                              height=0.6)
     self.topCont = uiprimitives.Container(name='topCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOALL,
                                           padding=(3, 3, 3, 3))
     self.topLeftCont = uiprimitives.Container(name='topLeftCont',
                                               parent=self.topCont,
                                               align=uiconst.TOLEFT,
                                               width=90)
     self.topRightCont = uiprimitives.Container(name='topRightCont',
                                                parent=self.topCont,
                                                align=uiconst.TOALL)
     primaryCont = uiprimitives.Container(parent=self.topLeftCont,
                                          align=uiconst.TOTOP,
                                          height=self.topLeftCont.width)
     uicontrols.Button(name='closePrimaryBtn',
                       parent=primaryCont,
                       label='<color=red>X',
                       align=uiconst.TOPRIGHT,
                       func=self.OnClosePrimaryBtnClick,
                       fixedwidth=20,
                       alwaysLite=True,
                       top=-3,
                       left=-3)
     self.primaryTextureSprite = uiprimitives.Sprite(
         name='primaryTextureSprite',
         parent=primaryCont,
         align=uiconst.TOALL)
     uicontrols.Button(name='loadPrimaryTextureBtn',
                       parent=self.topLeftCont,
                       label='Load primary',
                       align=uiconst.TOTOP,
                       func=self.OnLoadPrimaryTextureBtnClicked)
     uicontrols.Button(name='switchBtn',
                       parent=self.topLeftCont,
                       label='Switch',
                       align=uiconst.TOTOP,
                       func=self.OnSwitchBtnClick,
                       padding=(0, 8, 0, 5),
                       alwaysLite=True)
     secondaryCont = uiprimitives.Container(parent=self.topLeftCont,
                                            align=uiconst.TOTOP,
                                            height=self.topLeftCont.width,
                                            padTop=10)
     uicontrols.Button(name='closeSecondaryBtn',
                       parent=secondaryCont,
                       label='<color=red>X',
                       align=uiconst.TOPRIGHT,
                       func=self.OnCloseSecondaryBtnClick,
                       fixedwidth=20,
                       alwaysLite=True,
                       top=-3,
                       left=-3)
     self.secondaryTextureSprite = uiprimitives.Sprite(
         name='secondaryTextureSprite',
         parent=secondaryCont,
         align=uiconst.TOALL)
     uicontrols.Button(name='loadSecondaryTextureBtn',
                       parent=self.topLeftCont,
                       label='Load secondary',
                       align=uiconst.TOTOP,
                       func=self.OnLoadSecondaryTextureBtnClicked)
     self.mainSprite = uiprimitives.Sprite(name='mainSprite',
                                           parent=self.topRightCont,
                                           align=uiconst.CENTER,
                                           width=128,
                                           height=128)
     sizeCont = uiprimitives.Container(parent=self.topRightCont,
                                       align=uiconst.TOPRIGHT,
                                       pos=(5, 5, 60, 50))
     self.mainSpriteWidthEdit = uicontrols.SinglelineEdit(
         parent=sizeCont,
         name='mainSpriteWidthEdit',
         align=uiconst.TOTOP,
         label='width',
         ints=(1, 1024),
         setvalue=self.mainSprite.width,
         padTop=10,
         OnChange=self.OnMainSpriteWidthHeightChange)
     self.mainSpriteHeightEdit = uicontrols.SinglelineEdit(
         parent=sizeCont,
         name='mainSpriteHeightEdit',
         align=uiconst.TOTOP,
         label='height',
         ints=(1, 1024),
         setvalue=self.mainSprite.height,
         padTop=15,
         OnChange=self.OnMainSpriteWidthHeightChange)
     uicontrols.Button(parent=self.topRightCont,
                       align=uiconst.BOTTOMRIGHT,
                       label='Animate',
                       func=self.OpenAnimationWindow,
                       top=20)
     uicontrols.Button(parent=self.topRightCont,
                       align=uiconst.BOTTOMRIGHT,
                       label='Copy to clipboard',
                       func=self.CopyCodeToClipboard,
                       top=0)
     uiprimitives.Line(parent=self.bottomCont, align=uiconst.TOTOP)
     self.ConstructColorColumn()
     self.ConstructBlendModeColumn()
     self.ConstructSpriteEffectColumn()
     self.ConstructGlowColumn()
     self.ConstructShadowColumn()
     self.SetPrimaryPath(
         settings.user.ui.Get('UISpriteTestPrimaryTexturePath', None))
     self.SetSecondaryPath(
         settings.user.ui.Get('UISpriteTestSecondaryTexturePath', None))
 def Load(self, args):
     if not self.sr.Get('inited', 0):
         self.sr.inited = 1
         self.sr.wndButtonContainer = uiprimitives.Container(
             name='results', parent=self, align=uiconst.TOTOP, height=16)
         showHide = uiprimitives.Container(
             name='filters',
             parent=self.sr.wndButtonContainer,
             height=48,
             align=uiconst.TOTOP)
         uiprimitives.Line(parent=showHide,
                           align=uiconst.TOTOP,
                           top=15,
                           color=(0.0, 0.0, 0.0, 0.25))
         uiprimitives.Line(parent=showHide, align=uiconst.TOTOP)
         self.sr.showHide = showHide
         uicontrols.EveHeaderSmall(text=localization.GetByLabel(
             'UI/Corporations/BaseCorporationUI/Query'),
                                   parent=showHide,
                                   left=8,
                                   top=3,
                                   state=uiconst.UI_NORMAL)
         a = uicontrols.EveHeaderSmall(text='',
                                       parent=showHide,
                                       left=18,
                                       top=3,
                                       state=uiconst.UI_NORMAL,
                                       align=uiconst.TOPRIGHT)
         a.OnClick = self.ShowHideQuery
         a.GetMenu = None
         self.sr.ml = a
         expander = uiprimitives.Sprite(
             parent=showHide,
             pos=(6, 2, 11, 11),
             name='expandericon',
             state=uiconst.UI_NORMAL,
             texturePath='res:/UI/Texture/Shared/expanderDown.png',
             align=uiconst.TOPRIGHT)
         expander.OnClick = self.ShowHideQuery
         self.sr.showHideExp = expander
         self.sr.wndButtonContainer.state = uiconst.UI_HIDDEN
         wndQueryForm = self.sr.wndQuery.Load(self, self.PopulateView)
         wndQueryForm.align = uiconst.TOTOP
         wndQueryForm.height = 180
         self.sr.wndQueryForm = wndQueryForm
         wndForm = uiprimitives.Container(name='form',
                                          parent=self,
                                          align=uiconst.TOALL,
                                          pos=(0, 0, 0, 0))
         self.sr.wndForm = wndForm
         wndOutputTypeArea = uiprimitives.Container(name='output_type',
                                                    parent=wndForm,
                                                    align=uiconst.TOTOP,
                                                    height=24)
         uiprimitives.Container(name='push',
                                parent=wndOutputTypeArea,
                                align=uiconst.TOTOP,
                                height=6)
         label = uiprimitives.Container(name='text',
                                        parent=wndOutputTypeArea,
                                        align=uiconst.TOLEFT,
                                        width=150)
         uicontrols.EveLabelMedium(text=localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Members/FindMemberInRole/ShowResultsUsingLabel'
         ),
                                   parent=label,
                                   align=uiconst.TOTOP,
                                   state=uiconst.UI_NORMAL)
         optlist = [
             [
                 localization.GetByLabel(
                     'UI/Corporations/CorporationWindow/Members/FindMemberInRole/SimpleList'
                 ), form.CorpMembersViewSimple
             ],
             [
                 localization.GetByLabel(
                     'UI/Corporations/CorporationWindow/Members/FindMemberInRole/RoleManagementList'
                 ), form.CorpMembersViewRoleManagement
             ],
             [
                 localization.GetByLabel(
                     'UI/Corporations/CorporationWindow/Members/FindMemberInRole/TaskManagementList'
                 ), form.CorpMembersViewTaskManagement
             ]
         ]
         countcombo = uicontrols.Combo(label='',
                                       parent=wndOutputTypeArea,
                                       options=optlist,
                                       name='resultViewType',
                                       callback=self.OnComboChange,
                                       width=146,
                                       align=uiconst.TOLEFT)
         self.sr.outputTypeCombo = countcombo
         self.sr.outputWindowContainer = None
         viewClass = self.sr.outputTypeCombo.GetValue()
         self.SwitchToView(viewClass)
     sm.GetService('corpui').LoadTop(
         'res:/ui/Texture/WindowIcons/corporationmembers.png',
         localization.GetByLabel(
             'UI/Corporations/CorporationWindow/Members/FindMemberInRole/FindMemberInRole'
         ))
示例#30
0
    def ApplyAttributes(self, attributes):
        BaseCharacterCreationStep.ApplyAttributes(self, attributes)
        self.bloodlineInfo = {}
        self.bloodlineIDs = []
        self.bloodlineBtns = []
        info = self.GetInfo()
        self.raceID = info.raceID
        self.bloodlineID = info.bloodlineID
        self.hoveredBloodlineID = None
        self.isFemaleLeft = False
        self.sr.rightSide.width = self.sr.leftSide.width
        bloodlines = sm.GetService('cc').GetBloodlineDataByRaceID().get(
            self.raceID, [])[:]
        for bloodline in bloodlines:
            self.bloodlineIDs.append(bloodline.bloodlineID)

        self.sr.raceInfoCont = uiprimitives.Container(
            name='raceInfoCont',
            parent=self.sr.uiContainer,
            align=uiconst.CENTERTOP,
            width=600,
            height=uicore.desktop.height,
            state=uiconst.UI_PICKCHILDREN)
        self.sr.textCont = uiprimitives.Container(name='raceCont',
                                                  parent=self.sr.raceInfoCont,
                                                  align=uiconst.TOTOP,
                                                  pos=(0, 38, 0, 20),
                                                  state=uiconst.UI_DISABLED)
        self.sr.header = uicls.CCLabel(text=localization.GetByLabel(
            'UI/CharacterCreation/BloodlineSelection'),
                                       name='header',
                                       parent=self.sr.textCont,
                                       align=uiconst.CENTERTOP,
                                       uppercase=1,
                                       letterspace=2,
                                       color=(0.9, 0.9, 0.9, 0.8),
                                       fontsize=22,
                                       bold=False)
        if uicore.desktop.height <= 900:
            top = 20
        else:
            top = 40
        self.sr.raceCont = uiprimitives.Container(name='raceCont',
                                                  parent=self.sr.raceInfoCont,
                                                  align=uiconst.TOTOP,
                                                  pos=(0, top, 0, 80),
                                                  state=uiconst.UI_DISABLED)
        self.raceSprite = uiprimitives.Sprite(name='raceSprite',
                                              parent=self.sr.raceCont,
                                              align=uiconst.CENTER,
                                              state=uiconst.UI_HIDDEN,
                                              texturePath=self.raceHeaderPath,
                                              pos=(0, 0, 512, 128))
        self.raceSprite.state = uiconst.UI_DISABLED
        height = 128
        top = self.racialHeader.get(self.raceID, None)
        self.raceSprite.rectTop, self.raceSprite.rectHeight = top, height
        for bloodlineID in self.bloodlineIDs:
            cont = uiprimitives.Container(name='cont',
                                          parent=self.sr.uiContainer,
                                          align=uiconst.TOPLEFT,
                                          pos=(0, 0, 300, 200),
                                          state=uiconst.UI_HIDDEN)
            contName = 'cont_%d' % bloodlineID
            setattr(self.sr, contName, cont)
            contGender = uiprimitives.Container(name='contGender',
                                                parent=cont,
                                                align=uiconst.CENTERBOTTOM,
                                                pos=(0, 4, 255, 64))
            contGenderName = 'contGender_%d' % bloodlineID
            setattr(self.sr, contGenderName, contGender)
            genderBtnFemale = GenderButton(name='GenderButton',
                                           parent=contGender,
                                           align=uiconst.BOTTOMLEFT,
                                           pos=(0, 0, 64, 64),
                                           genderID=0,
                                           raceID=self.raceID,
                                           state=uiconst.UI_HIDDEN)
            btnName = 'genderBtn_%d_%d' % (bloodlineID, 0)
            setattr(self.sr, btnName, genderBtnFemale)
            genderBtnMale = GenderButton(name='GenderButton',
                                         parent=contGender,
                                         align=uiconst.BOTTOMRIGHT,
                                         pos=(0, 0, 64, 64),
                                         genderID=1,
                                         raceID=self.raceID,
                                         state=uiconst.UI_HIDDEN)
            btnName = 'genderBtn_%d_%d' % (bloodlineID, 1)
            setattr(self.sr, btnName, genderBtnMale)
            btn = BloodlineButton(
                name='BloodlineButton',
                parent=cont,
                align=uiconst.CENTER,
                pos=(0, 0, 128, 128),
                bloodlineID=bloodlineID,
                mouseExitCallback=self.ResetHoverRaceID,
                mouseEnterCallback=self.HiliteCorrectBloodlines)
            btnName = 'bloodlineBtn_%d' % bloodlineID
            setattr(self.sr, btnName, btn)
            self.bloodlineBtns.append(btn)
            if info.bloodlineID and info.bloodlineID == bloodlineID:
                btn.Select()
                genderBtnFemale.state = uiconst.UI_NORMAL
                genderBtnMale.state = uiconst.UI_NORMAL
                if info.genderID is not None:
                    canChangeGender = uicore.layer.charactercreation.CanChangeGender(
                    )
                    if info.genderID == ccConst.GENDERID_FEMALE:
                        genderBtnFemale.Select()
                        if not canChangeGender:
                            genderBtnMale.state = uiconst.UI_HIDDEN
                    else:
                        genderBtnMale.Select()
                        if not canChangeGender:
                            genderBtnFemale.state = uiconst.UI_HIDDEN

        self.sr.bloodlineTextCont = uiprimitives.Container(
            name='bloodlineTextCont',
            parent=self.sr.uiContainer,
            align=uiconst.TOBOTTOM,
            height=80,
            top=64,
            state=uiconst.UI_NORMAL)
        self.sr.bloodlineText = uicls.CCLabel(parent=self.sr.bloodlineTextCont,
                                              fontsize=12,
                                              align=uiconst.BOTTOMLEFT,
                                              width=600,
                                              text='',
                                              letterspace=0,
                                              top=0,
                                              bold=0)
        if info.bloodlineID:
            self.GetBloodlineText()