コード例 #1
0
ファイル: menu.py プロジェクト: nanxijw/Clara-Pretty-One-Dick
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.sr.entries = ContainerAutoSize(parent=self,
                                         name='_entries',
                                         align=uiconst.TOTOP,
                                         padding=(0, 1, 0, 1))
     self.Prepare_()
コード例 #2
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.node = attributes.node
     self.factionID = self.node.factionID
     self.shipGroupID = self.node.shipGroupID
     self.iconsPerRow = self.node.GetIconsPerRow()
     self.typeIDs = sm.GetService('shipTree').GetShipTypeIDs(self.factionID, self.shipGroupID)
     self.zoomLevel = sm.GetService('shipTreeUI').GetZoomLevel()
     self.iconSize = self.node.GetIconSize()
     nodeNum = attributes.nodeNum
     self.groupNameLabel = EveHeaderMedium(name='groupNameLabel', parent=self, align=uiconst.TOPLEFT, text=GetByMessageID(cfg.fsdInfoBubbleGroups[self.shipGroupID].nameID), left=43, top=0)
     self.iconAndBar = ShipGroupIconAndSkillBar(parent=self, top=20, node=self.node)
     self.shipContainer = ContainerAutoSize(name='shipContainer', parent=self, align=uiconst.TOPLEFT, height=self.iconSize, left=46, top=24)
     self.LoadShips()
     self.lineTop = StretchSpriteHorizontal(name='lineTop', parent=self, align=uiconst.TOTOP, texturePath='res:/UI/Texture/Classes/ShipTree/Groups/frameUpper.png', leftEdgeSize=4, rightEdgeSize=4, height=3, padTop=16)
     width = len(self.typeIDs) % self.iconsPerRow or self.iconsPerRow
     width = self.iconSize * width + 4
     self.lineBottom = StretchSpriteHorizontal(name='lineBottom', parent=self, align=uiconst.BOTTOMLEFT, texturePath='res:/UI/Texture/Classes/ShipTree/Groups/frameLower.png', leftEdgeSize=4, rightEdgeSize=4, height=1, width=width, left=43, top=-7)
     self.UpdateState(nodeNum, animate=False)
     zoomLevel = sm.GetService('shipTreeUI').GetZoomLevel()
     if zoomLevel == ZOOMED_OUT:
         self.groupNameLabel.opacity = 0.0
         self.lineTop.opacity = 0.0
         self.lineBottom.opacity = 0.0
コード例 #3
0
ファイル: progressWnd.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.abortbtn = None
     self.abortbtnpar = None
     self.confirmbtn = None
     self.abortconfirmbtnpar = None
     self.sr.readprogress = util.KeyVal(text='', prev=0)
     self.caption = EveCaptionMedium(name='caption',
                                     parent=self,
                                     align=uiconst.TOTOP,
                                     padding=(25, 0, 25, 0),
                                     top=12,
                                     idx=0,
                                     state=uiconst.UI_DISABLED)
     self.progressText = EveLabelMedium(parent=self,
                                        width=270,
                                        left=2,
                                        top=4,
                                        state=uiconst.UI_NORMAL,
                                        align=uiconst.TOTOP,
                                        padding=(25, 0, 25, 0))
     self.progressBar = ProgressBar(parent=self,
                                    height=10,
                                    padding=(25, 10, 25, 10),
                                    align=uiconst.TOTOP)
     uicontrols.WindowUnderlay(bgParent=self)
コード例 #4
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     iconPath = attributes.iconPath
     iconColor = attributes.get('iconColor', self.default_iconColor)
     title = attributes['title']
     titleColor = attributes.get('titleColor', self.default_titleColor)
     text = attributes['text']
     textColor = attributes.get('textColor', self.default_textColor)
     textTooltipCallback = attributes.get('textTooltipCallback', None)
     actionCallback = attributes.get('actionCallback', None)
     actionText = attributes['actionText']
     self.actionErrors = attributes.get('actionErrors', [])
     Sprite(parent=self, align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED, texturePath=iconPath, color=iconColor, left=self.PADDING, height=self.ICON_SIZE, width=self.ICON_SIZE)
     EveLabelMediumBold(parent=self, align=uiconst.TOTOP, text=title, padding=(self.ICON_SIZE + 2 * self.PADDING,
      self.PADDING,
      self.BUTTON_WIDTH + 2 * self.PADDING,
      0), color=titleColor)
     textLabel = EveLabelMediumBold(parent=self, align=uiconst.TOTOP, state=uiconst.UI_NORMAL, text=text, padding=(self.ICON_SIZE + 2 * self.PADDING,
      0,
      self.BUTTON_WIDTH + 2 * self.PADDING,
      self.PADDING), color=textColor)
     if textTooltipCallback:
         textLabel.state = uiconst.UI_NORMAL
         textLabel.LoadTooltipPanel = textTooltipCallback
     button = Button(parent=self, label=actionText, align=uiconst.CENTERRIGHT, fontsize=self.BUTTON_FONT_SIZE, fixedwidth=self.BUTTON_WIDTH, fixedheight=self.BUTTON_HEIGHT, left=self.PADDING, func=actionCallback)
     if self.actionErrors:
         button.Disable()
         button.LoadTooltipPanel = self.LoadActionErrorTooltip
     self.SetSizeAutomatically()
コード例 #5
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     bannerWidth = attributes.bannerWidth or DEFAULT_BANNER_WIDTH
     bannerHeight = attributes.bannerHeight or DEFAULT_BANNER_HEIGHT
     imageContainer = Container(name='imageContainer',
                                parent=self,
                                align=uiconst.TOTOP,
                                width=bannerWidth,
                                height=bannerHeight,
                                clipChildren=True)
     self.bannerSprite = Sprite(name='bannerSprite',
                                parent=imageContainer,
                                align=uiconst.CENTER,
                                width=bannerWidth,
                                height=bannerHeight)
     self.transitionSprite = Sprite(name='animSprite',
                                    parent=imageContainer,
                                    align=uiconst.CENTER,
                                    width=bannerWidth,
                                    height=bannerHeight)
     bottomContainer = Container(parent=self,
                                 align=uiconst.TOTOP,
                                 height=BUTTON_HEIGHT + 8)
     self.buttonContainer = ContainerAutoSize(name='buttonContainer',
                                              parent=bottomContainer,
                                              align=uiconst.CENTER,
                                              height=BUTTON_HEIGHT)
     self.transitionTimer = None
     self.banners = []
     uthread.new(self._CreateBanners)
コード例 #6
0
ファイル: viewModeButtons.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.settingsID = attributes.settingsID
     self.controller = attributes.controller
     self.viewMode = settings.user.ui.Get(self.settingsID, VIEWMODE_ICONLIST)
     self.btnViewModeIconList = ButtonIcon(texturePath='res:/UI/Texture/Icons/38_16_189.png', parent=self, align=uiconst.TOLEFT, width=self.height, func=self.SetViewModeIconList, hint=localization.GetByLabel('UI/Inventory/Details'))
     self.btnViewModeList = ButtonIcon(texturePath='res:/UI/Texture/Icons/38_16_190.png', parent=self, align=uiconst.TOLEFT, width=self.height, func=self.SetViewModeList, hint=localization.GetByLabel('UI/Inventory/List'))
     self.SetViewMode(self.viewMode)
コード例 #7
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.loadTaskBackgrounds = attributes.get('loadTaskBackgrounds',
                                               self.loadTaskBackgrounds)
     self.ConstructLayout()
     self.LoadGroupData(attributes.groupInfo, attributes.blinkAchievementID,
                        attributes.animateIn)
     sm.RegisterNotify(self)
コード例 #8
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.node = attributes.node
     self.shipGroupIcon = ShipGroupIcon(parent=self, node=self.node)
     self.skillBarCont = ContainerAutoSize(parent=self, align=uiconst.TOPLEFT, width=42, top=43, state=uiconst.UI_DISABLED)
     for typeID, _ in self.node.GetBonusSkillsSorted():
         SkillLevels(parent=self.skillBarCont, typeID=typeID, align=uiconst.TOTOP, padTop=1, padBottom=1, frameColor=COLOR_FRAME, barColor=shipTreeConst.COLOR_HILIGHT)
コード例 #9
0
ファイル: effectsCont.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.fighterID = attributes.fighterID
     self.tubeFlagID = attributes.tubeFlagID
     self.effectsOnFighter = None
     self.shipFighterState = GetShipFighterState()
     self.ewarIcons = {}
     self.controller = attributes.controller
     self.BuildEffectsData()
コード例 #10
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.challenge = attributes.challenge
     self.open_challenges = attributes.open_challenges_function
     show_details = attributes.Get('show_details', DEFAULT_SHOW_DETAILS)
     self._construct_header()
     if show_details:
         self._show_details()
     self.objects_for_animations = []
コード例 #11
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.materialData = attributes.materialData
     if isinstance(self.materialData, industry.Blueprint):
         bpData = self.materialData
     else:
         bpData = None
     icon = ItemIcon(parent=self, align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED, pos=(0, 0, 20, 20), typeID=self.materialData.typeID, bpData=bpData)
     label = EveLabelMedium(parent=self, align=uiconst.CENTERLEFT, text=self.materialData.GetName(), left=24)
コード例 #12
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.totalSlots = 0
     Sprite(parent=self,
            width=16,
            height=16,
            texturePath=self.default_texturePath,
            align=uiconst.TOLEFT,
            state=uiconst.UI_DISABLED)
     self.slotsUsedText = EveLabelSmall(parent=self, align=uiconst.TOLEFT)
コード例 #13
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.typeID = attributes.typeID
     ItemIcon(parent=self,
              align=uiconst.CENTERLEFT,
              state=uiconst.UI_DISABLED,
              pos=(0, 0, 32, 32),
              typeID=self.typeID)
     EveLabelMediumBold(parent=self,
                        align=uiconst.CENTERLEFT,
                        text=evetypes.GetName(self.typeID),
                        left=36)
コード例 #14
0
ファイル: treeViewEntry.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.level = attributes.get('level', 0)
     self.data = attributes.get('data')
     self.eventListener = attributes.get('eventListener', None)
     self.parentEntry = attributes.get('parentEntry', None)
     self.settingsID = attributes.get('settingsID', self.default_settingsID)
     self.defaultExpanded = attributes.get('defaultExpanded', self.level < 1)
     self.childrenInitialized = False
     self.isToggling = False
     self.canAccess = True
     self.isSelected = False
     self.childSelectedBG = False
     self.icon = None
     self.childCont = None
     self.topRightCont = Container(name='topCont', parent=self, align=uiconst.TOTOP, height=self.default_height)
     self.topRightCont.GetDragData = self.GetDragData
     left = self.GetSpacerContWidth()
     if self.data.IsRemovable():
         removeBtn = Sprite(texturePath='res:/UI/Texture/icons/73_16_210.png', parent=self.topRightCont, align=uiconst.CENTERLEFT, width=16, height=16, left=left, hint=localization.GetByLabel('UI/Common/Buttons/Close'))
         left += 20
         removeBtn.OnClick = self.Remove
     icon = self.data.GetIcon()
     if icon:
         iconSize = self.height - 2
         self.icon = Icon(icon=icon, parent=self.topRightCont, pos=(left,
          0,
          iconSize,
          iconSize), align=uiconst.CENTERLEFT, state=uiconst.UI_DISABLED, ignoreSize=True)
         left += iconSize
     self.label = Label(parent=self.topRightCont, align=uiconst.CENTERLEFT, text=self.data.GetLabel(), left=left + 4)
     self.UpdateLabel()
     self.hoverBG = None
     self.selectedBG = None
     self.blinkBG = None
     if self.data.HasChildren():
         self.spacerCont = Container(name='spacerCont', parent=self.topRightCont, align=uiconst.TOLEFT, width=self.GetSpacerContWidth())
         self.toggleBtn = Container(name='toggleBtn', parent=self.spacerCont, align=uiconst.CENTERRIGHT, width=16, height=16, state=uiconst.UI_HIDDEN)
         self.toggleBtn.OnClick = self.OnToggleBtnClick
         self.toggleBtn.OnDblClick = lambda : None
         self.toggleBtnSprite = Sprite(bgParent=self.toggleBtn, texturePath='res:/UI/Texture/classes/Neocom/arrowDown.png', rotation=pi / 2, padding=(4, 4, 5, 5))
         expandChildren = False
         if not self.data.IsForceCollapsed():
             toggleSettingsDict = settings.user.ui.Get('invTreeViewEntryToggle_%s' % self.settingsID, {})
             expandChildren = toggleSettingsDict.get(self.data.GetID(), self.defaultExpanded)
             self.ConstructChildren()
         else:
             self.toggleBtn.state = uiconst.UI_NORMAL
         self.ShowChildCont(expandChildren, animate=False)
     else:
         self.ShowChildCont(False, animate=False)
     if self.eventListener and hasattr(self.eventListener, 'RegisterID'):
         self.eventListener.RegisterID(self, self.data.GetID())
コード例 #15
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     charID = attributes.charID
     parentLayoutGrid = LayoutGrid(parent=self,
                                   columns=2,
                                   align=uiconst.TOPLEFT,
                                   padding=6,
                                   cellSpacing=(10, 10))
     addHeader = attributes.get('addHeader', True)
     if addHeader:
         self.AddHeader(parentLayoutGrid)
     sprite = Sprite(parent=parentLayoutGrid,
                     align=uiconst.TOPLEFT,
                     state=uiconst.UI_DISABLED,
                     pos=(0, 0, 128, 128))
     sm.GetService('photo').GetPortrait(charID,
                                        128,
                                        sprite,
                                        allowServerTrip=True)
     subLayoutGrid = LayoutGrid(parent=parentLayoutGrid,
                                columns=2,
                                align=uiconst.TOPLEFT)
     spacer = Fill(align=uiconst.TOPLEFT,
                   state=uiconst.UI_DISABLED,
                   width=128,
                   height=1,
                   color=(0, 0, 0, 0))
     subLayoutGrid.AddCell(cellObject=spacer, colSpan=2)
     parallelCalls = []
     parallelCalls.append(
         (sm.RemoteSvc('charMgr').GetPublicInfo3, (charID, )))
     parallelCalls.append(
         (sm.GetService('corp').GetInfoWindowDataForChar, (charID, 1)))
     charinfo, corpCharInfo = uthread.parallel(parallelCalls)
     charName = cfg.eveowners.Get(charID).name
     nameLabel = EveLabelMedium(text=charName, autoFitToText=True)
     subLayoutGrid.AddCell(cellObject=nameLabel, colSpan=2)
     titleText = self.GetTitleText(corpCharInfo)
     titleLabel = EveLabelMedium(text=titleText, autoFitToText=True)
     if titleLabel.textwidth > self.maxTextWidth:
         titleLabel.width = self.maxTextWidth
     subLayoutGrid.AddCell(cellObject=titleLabel, colSpan=2)
     if corpCharInfo:
         corpID = corpCharInfo.corpID
         allianceID = corpCharInfo.allianceID
         for eachID in (corpID, allianceID):
             if eachID:
                 logo = self.GetLogo(eachID)
                 logo.hint = cfg.eveowners.Get(eachID).name
                 subLayoutGrid.AddCell(cellObject=logo)
コード例 #16
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.amountLabel = None
     self.baseAmountLabel = None
     if attributes.amountSize:
         self.amountSize = attributes.amountSize
     if attributes.aurSize:
         self.aurSize = attributes.aurSize
     amount = attributes.amount
     baseAmount = attributes.baseAmount
     self.amountLabel = self.AddAurSection(amount)
     if baseAmount is not None and amount != baseAmount:
         self.baseAmountLabel = self.AddAurSection(
             baseAmount, color=VGS_SPECIAL_PRICE_COLOR, strikeThrough=True)
コード例 #17
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     label = attributes.label
     maxValue = attributes.Get('maxValue', 1.0)
     self.colorCallback = attributes.colorCallback
     self.color = Color(*attributes.color)
     self.initialized = False
     Label(parent=self, align=uiconst.TOTOP, text=label, fontsize=20, left=14)
     Button(parent=self, left=4, top=4, align=uiconst.TOPRIGHT, label='Copy to Clipboard', func=self.CopyToClipboard)
     self.r = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=self.color.r, maxValue=maxValue, label='R', callback=self.OnRChange)
     self.g = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=self.color.g, maxValue=maxValue, label='G', callback=self.OnGChange, padTop=PADTOP)
     self.b = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=self.color.b, maxValue=maxValue, label='B', callback=self.OnBChange, padTop=PADTOP)
     h, s, b = self.color.GetHSB()
     self.h = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=h, maxValue=1.0, label='H', callback=self.OnHChange, padTop=PADTOP + 14)
     self.s = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=s, maxValue=1.0, label='S', callback=self.OnSChange, padTop=PADTOP)
     self.br = ValueSelector(parent=self, align=uiconst.TOTOP, height=18, value=b, maxValue=maxValue, label='B', callback=self.OnBrChange, padTop=PADTOP)
     self.initialized = True
コード例 #18
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.autoShowDetails = bool(attributes.autoShowDetails) or True
     Fill(bgParent=self, color=(0, 0, 0, 0.3))
     self.headerContainer = Container(parent=self, align=uiconst.TOTOP)
     self.mouseOverFill = FillThemeColored(bgParent=self.headerContainer, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.0)
     self.completedFill = FillThemeColored(bgParent=self.headerContainer, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.0)
     self.backgroundContainer = InfoPanelHeaderBackground(bgParent=self.headerContainer)
     self.achievementTask = attributes.achievement
     self.achievementGroup = attributes.achievementGroup
     self.callbackTaskExpanded = attributes.callbackTaskExpanded
     self.checkbox = Sprite(parent=self.headerContainer, texturePath=self.uncheckedTexturePath, pos=(4, 3, 14, 14))
     self.achievementText = EveLabelMedium(name='achievementText', text=self.achievementTask.name, parent=self.headerContainer, padLeft=2 * self.checkbox.left + self.checkbox.width, align=uiconst.TOTOP, padTop=2)
     self.UpdateAchievementTaskState()
     newHeight = max(self.checkbox.height + 2 * self.checkbox.top, self.achievementText.textheight + 2 * self.achievementText.padTop)
     self.headerContainer.height = newHeight
     if attributes.blinkIn and self.achievementTask.completed:
         uthread.new(uicore.animations.BlinkIn, self, duration=0.2, loops=4)
コード例 #19
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.shipFighterState = GetShipFighterState()
     self.parentFunc = attributes.parentFunc
     self.squadrons = []
     self.lastSelected = None
     left = BUTTONCONT_WIDTH + 4
     numOfTubes = GetFighterTubesForShip()
     self.DrawControlButtons()
     for i, tubeFlagID in enumerate(const.fighterTubeFlags):
         if i < numOfTubes:
             squadron = SquadronUI(parent=self,
                                   align=uiconst.BOTTOMLEFT,
                                   tubeFlagID=tubeFlagID,
                                   left=left)
             left = squadron.left + squadron.width + 6
             self.squadrons.append(squadron)
             self.width += SQUADRON_WIDTH
コード例 #20
0
ファイル: settingSection.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.structureProfileController = attributes.structureProfileController
     self.ChangeSignalConnection()
     self.settingID = attributes.settingID
     sgControllers = self.structureProfileController.GetGroupsBySettingID(
         self.settingID)
     canHaveGroups = CanHaveGroups(self.settingID)
     if not canHaveGroups and not sgControllers:
         self.structureProfileController.AddGroup(self.settingID,
                                                  groupID=NO_GROUP_ID,
                                                  doSignal=False)
         sgControllers = self.structureProfileController.GetGroupsBySettingID(
             self.settingID)
     self.AddHeader(canHaveGroups, sgControllers)
     self.sectionCont = ContainerAutoSize(parent=self,
                                          name='sectionCont',
                                          align=uiconst.TOTOP)
     self.LoadGroups()
コード例 #21
0
ファイル: gauge.py プロジェクト: connoryang/1v1dec
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     labelTxt = attributes.Get('label', self.default_label)
     subTxt = attributes.Get('subText', self.default_subText)
     gaugeHeight = attributes.Get('gaugeHeight', self.default_gaugeHeight)
     self.gradientBrightnessFactor = attributes.Get(
         'gradientBrightnessFactor', self.default_gradientBrightnessFactor)
     self.markers = {}
     self.gaugeCont = uiprimitives.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)
コード例 #22
0
 def ApplyAttributes(self, attributes):
     attributes.align = uiconst.TOPLEFT
     attributes.width = 128
     attributes.height = 128
     ContainerAutoSize.ApplyAttributes(self, attributes)
     if attributes.GetUtilMenu:
         self._getMenuFunction = attributes.GetUtilMenu
     else:
         raise RuntimeError('GetUtilMenu has to be provided in order to use UtilMenu')
     self.controller = attributes.controller
     self.isTopLevelWindow = True
     self.menuAlign = attributes.Get('menuAlign', self.default_menuAlign)
     self.minWidth = attributes.minWidth or 0
     FrameThemeColored(bgParent=self, colorType=uiconst.COLORTYPE_UIHILIGHT, opacity=0.35)
     FillThemeColored(bgParent=self, opacity=OPACITY_BG)
     FrameThemeColored(bgParent=self, frameConst=('ui_105_32_26', 15, 0), padding=(-12, -5, -12, -15))
     uicore.uilib.RegisterForTriuiEvents([uiconst.UI_MOUSEDOWN], self.OnGlobalMouseDown)
     self.ReloadMenu()
     self.AnimFadeIn()
     self.UpdateMenuPosition()
コード例 #23
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.factionID = attributes.factionID
     self._offset = None
     self._leftFloat = 0.0
     self._topFloat = 0.0
     self.rootNode = None
     self.lineCont = Container(name='lineCont', parent=self)
     self.ConstructTree()
     self.bgCont = Container(name='bgContainer',
                             align=uiconst.CENTER,
                             state=uiconst.UI_DISABLED,
                             parent=self,
                             padding=-100)
     self.topFrame = TopFrame(parent=self.bgCont, align=uiconst.TOTOP)
     self.bottomFrame = BottomFrame(parent=self.bgCont,
                                    align=uiconst.TOBOTTOM)
     Sprite(name='grid',
            bgParent=self.bgCont,
            state=uiconst.UI_DISABLED,
            align=uiconst.CENTER,
            texturePath='res:/UI/Texture/Classes/ShipTree/grid.png',
            color=(0.43, 0.727, 1.0, 0.2),
            idx=0,
            tileX=True,
            tileY=True)
     texturePath = BG_BY_FACTIONID.get(self.factionID)
     _, h = self.rootNode.GetDimensions()
     height = 3.2 * h * TREE_SCALE
     width = 1.6 / 1.8 * height
     self.factionBG = Sprite(name='factionBG',
                             parent=self.bgCont,
                             align=uiconst.CENTER,
                             texturePath=texturePath,
                             width=width,
                             height=height,
                             opacity=0.18,
                             idx=0)
コード例 #24
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.groupInfo = attributes.groupInfo
     self.isExpanded = attributes.isExpanded
     self.clickCallback = attributes.clickCallback
     iconColumn = Container(parent=self,
                            name='iconColumn',
                            align=uiconst.TOLEFT,
                            width=20)
     self.icon = Sprite(name='groupIcon',
                        parent=iconColumn,
                        pos=(0, 0, 16, 16),
                        texturePath=self.groupInfo.iconPath,
                        state=uiconst.UI_DISABLED,
                        align=uiconst.CENTERTOP)
     headerCont = Container(parent=self,
                            name='headerCont',
                            align=uiconst.TOTOP,
                            state=uiconst.UI_NORMAL,
                            height=self.headerHeight)
     headerCont.OnClick = (self.clickCallback, self.groupInfo,
                           self.isExpanded)
     headerCont.OnMouseEnter = self.OnMouseEnterHeader
     headerCont.OnMouseExit = self.OnMouseExitHeader
     self.bodyCont = ContainerAutoSize(parent=self,
                                       name='bodyCont',
                                       align=uiconst.TOTOP)
     Fill(bgParent=self.bodyCont, color=(0.1, 0.1, 0.1, 0.2))
     self.groupText = EveLabelMediumBold(name='groupText',
                                         text=self.groupInfo.groupName,
                                         parent=headerCont,
                                         left=4,
                                         align=uiconst.CENTERLEFT)
     self.progressText = EveLabelMediumBold(name='progressText',
                                            text='',
                                            parent=headerCont,
                                            left=4,
                                            align=uiconst.CENTERRIGHT)
     self.fillBoxFrame = Frame(bgParent=headerCont,
                               name='progress',
                               texturePath=self.fillBox,
                               cornerSize=2)
     progressCont = Container(parent=headerCont,
                              name='progressCont',
                              align=uiconst.TOALL)
     bgColor = [x for x in COLOR_COMPLETED[:3]] + [0.15]
     self.completedBg = Fill(bgParent=progressCont, color=tuple(bgColor))
     self.completedBg.display = False
     self.progressFrame = Frame(parent=progressCont,
                                name='progressFrame',
                                texturePath=self.progressBackground,
                                cornerSize=2,
                                width=0.0,
                                align=uiconst.TOLEFT_PROP)
     self.checkmark = Sprite(name='checkmark',
                             parent=headerCont,
                             pos=(0, 0, 16, 16),
                             texturePath=self.checkmarkPath,
                             state=uiconst.UI_DISABLED,
                             align=uiconst.CENTERRIGHT)
     self.SetProgress()
     if self.isExpanded:
         self.AddAchievementEntries()
         self.AddExtraInfo()
         self.AddPadding()
コード例 #25
0
 def ApplyAttributes(self, attributes):
     ContainerAutoSize.ApplyAttributes(self, attributes)
     self.ResetOpacity()
     self.UpdateEntryHeight()