예제 #1
0
 def ApplyAttributes(self, attributes):
     uicls.ContainerAutoSize.ApplyAttributes(self, attributes)
     self.infoPanelsByTypeID = {}
     self.infoPanelButtonsByTypeID = {}
     self.isDraggingButton = False
     self.topCont = uicls.Container(name='topCont',
                                    parent=self,
                                    align=uiconst.TOTOP,
                                    height=self.ICONSIZE,
                                    padding=(infoPanel.LEFTPAD, 0, 0, 5))
     self.dropIndicatorLine = uicls.Line(name='dropIndicatorLine',
                                         parent=self.topCont,
                                         align=uiconst.TOLEFT_NOPUSH,
                                         state=uiconst.UI_HIDDEN,
                                         color=util.Color.GetGrayRGBA(
                                             1.0, 0.6),
                                         padding=(0, 2, 0, 2))
     self.iconCont = uicls.ContainerAutoSize(name='iconCont',
                                             parent=self.topCont,
                                             state=uiconst.UI_NORMAL,
                                             align=uiconst.TOLEFT)
     self.mainCont = uicls.ContainerAutoSize(name='mainCont',
                                             parent=self,
                                             align=uiconst.TOTOP)
     self.Reconstruct()
예제 #2
0
 def _ConstructBaseLayout(self):
     self.charCont = uicls.ContainerAutoSize(parent=self.mainCont,
                                             name='charCont',
                                             align=uiconst.TOTOP)
     self.clockCont = neocom.WrapperButton(parent=self.mainCont,
                                           name='clockCont',
                                           align=uiconst.TOBOTTOM,
                                           height=20,
                                           cmdName='OpenCalendar')
     self.fixedButtonCont = uicls.ContainerAutoSize(parent=self.mainCont,
                                                    name='fixedButtonCont',
                                                    align=uiconst.TOBOTTOM)
     uicls.Fill(bgParent=self.fixedButtonCont,
                color=self.COLOR_CORNERFILL,
                blendMode=trinity.TR2_SBM_ADD)
     self.overflowBtn = neocom.OverflowButton(parent=self.mainCont,
                                              align=uiconst.TOBOTTOM,
                                              state=uiconst.UI_HIDDEN,
                                              height=20)
     self.buttonCont = uicls.Container(parent=self.mainCont,
                                       name='buttonCont',
                                       align=uiconst.TOALL)
     self.dropIndicatorLine = uicls.Line(parent=self.mainCont,
                                         name='dropIndicatorLine',
                                         align=uiconst.TOPLEFT,
                                         color=util.Color.GetGrayRGBA(
                                             0.7, 0.3),
                                         pos=(0, 0, 0, 1))
예제 #3
0
 def GetUtilMenu(self, parent):
     cont = uicls.ContainerAutoSize(parent=parent,
                                    align=uiconst.TOTOP,
                                    padRight=10)
     self.infoPanelCls(parent=cont,
                       mode=infoPanel.MODE_NORMAL,
                       isModeFixed=True)
예제 #4
0
파일: base_fw.py 프로젝트: R4M80MrX/eve-1
 def ConstructNewFWPlayerHeader(self):
     self.topCont.Flush()
     iconSize = 50
     firstLine = uicls.Container(parent=self.topCont,
                                 align=uiconst.TOTOP_PROP,
                                 height=0.4,
                                 padLeft=20)
     uicls.Sprite(
         parent=firstLine,
         align=uiconst.CENTERLEFT,
         pos=(0, 0, iconSize, iconSize),
         texturePath='res:/UI/Texture/Icons/FactionalWarfare_64.png')
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     enemyAllyID = facwarCommon.GetFactionSecondaryEnemy(self.factionID)
     text = localization.GetByLabel(
         'UI/FactionWarfare/NonFWPlayerHeader1',
         typeID=const.typeFaction,
         factionID=self.factionID,
         factionName=self.factionName,
         enemyID=enemyID,
         enemyName=cfg.eveowners.Get(enemyID).name,
         enemyAllyID=enemyAllyID,
         enemyAllyName=cfg.eveowners.Get(enemyAllyID).name)
     uicls.EveLabelLarge(parent=firstLine,
                         align=uiconst.CENTERLEFT,
                         state=uiconst.UI_NORMAL,
                         left=iconSize + 20,
                         text=text)
     secondLine = uicls.Container(parent=self.topCont,
                                  align=uiconst.TOTOP_PROP,
                                  height=0.6,
                                  padLeft=20)
     uicls.Sprite(parent=secondLine,
                  align=uiconst.CENTERLEFT,
                  pos=(0, 0, iconSize, iconSize),
                  texturePath='res:/UI/Texture/Icons/34_64_8.png')
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     labelCont = uicls.ContainerAutoSize(parent=secondLine,
                                         align=uiconst.CENTERLEFT,
                                         left=iconSize + 20)
     uicls.EveCaptionSmall(parent=labelCont,
                           text=localization.GetByLabel(
                               'UI/FactionWarfare/FightForFaction',
                               factionName=cfg.eveowners.Get(
                                   self.factionID).name))
     uicls.EveLabelMedium(
         state=uiconst.UI_NORMAL,
         parent=labelCont,
         top=25,
         text=localization.GetByLabel(
             'UI/FactionWarfare/FightForFactionText',
             url='localsvc:service=facwar&method=ShowRulesOfEngagementTab'))
예제 #5
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self._mode = None
     self.isInModeTransition = False
     self.isModeFixed = attributes.Get('isModeFixed',
                                       self.default_isModeFixed)
     self.topCont = uicls.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 = uicls.Fill(bgParent=self.topCont,
                               color=util.Color.WHITE,
                               opacity=0.0)
     self.headerBtnCont = uicls.Container(name='headerBtnCont',
                                          parent=self.topCont,
                                          align=uiconst.TOLEFT,
                                          width=infoPanel.LEFTPAD)
     self.headerCont = uicls.Container(name='headerCont',
                                       parent=self.topCont)
     self.headerButton = self.ConstructHeaderButton()
     self.collapseArrow = uicls.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 = uicls.ContainerAutoSize(name='mainCont',
                                             parent=self,
                                             align=uiconst.TOTOP,
                                             padLeft=infoPanel.LEFTPAD,
                                             padBottom=self.MAINPADBOTTOM)
예제 #6
0
 def ApplyAttributes(self, attributes):
     uicls.Container.ApplyAttributes(self, attributes)
     self.scrollbarsDisabled = False
     self.scrollToVerticalPending = None
     self.scrollToHorizontalPending = None
     self.verticalScrollBar = uicls.ScrollBar(parent=self,
                                              align=uiconst.TORIGHT)
     self.verticalScrollBar.OnScrolled = self._OnVerticalScrollBar
     self.horizontalScrollBar = uicls.ScrollBar(parent=self,
                                                align=uiconst.TOBOTTOM)
     self.horizontalScrollBar.OnScrolled = self._OnHorizontalScrollBar
     self.clipCont = uicls.Container(name='clipCont',
                                     parent=self,
                                     clipChildren=True)
     self.mainCont = uicls.ContainerAutoSize(name='mainCont',
                                             parent=self.clipCont)
     self.mainCont._OnSizeChange_NoBlock = self._OnMainContSizeChange
     self.children.insert = self._InsertChild
     self.children.append = self._AppendChild
     self.children.remove = self._RemoveChild
     self._mouseHoverCookie = uicore.uilib.RegisterForTriuiEvents(
         uiconst.UI_MOUSEHOVER, self.OnGlobalMouseHover)
예제 #7
0
 def Startup(self, *args):
     listentry.Generic.Startup(self, *args)
     sm.RegisterNotify(self)
     self.sr.line.display = False
     self.portraitCont = uicls.Container(name='portraitCont',
                                         parent=self,
                                         align=uiconst.TOLEFT,
                                         width=64)
     self.utilMenuCont = uicls.Container(name='utilMenuCont',
                                         parent=self,
                                         align=uiconst.TORIGHT,
                                         width=28)
     self.utilMenuCont.display = False
     myTextCont = uicls.Container(name='myTextCont',
                                  parent=self,
                                  align=uiconst.TOALL,
                                  padLeft=2 * const.defaultPadding,
                                  clipChildren=True)
     self.textCont = uicls.ContainerAutoSize(name='textCont',
                                             parent=myTextCont,
                                             align=uiconst.CENTERLEFT)
     self.nameLabel = uicls.EveLabelMedium(text='',
                                           parent=self.textCont,
                                           maxLines=1,
                                           align=uiconst.TOPLEFT,
                                           state=uiconst.UI_NORMAL)
     self.saleLabel = uicls.EveLabelSmall(text='',
                                          parent=self.textCont,
                                          maxLines=1,
                                          align=uiconst.TOPLEFT,
                                          top=19,
                                          state=uiconst.UI_NORMAL)
     self.availableLabel = uicls.EveLabelSmall(text='',
                                               parent=self.textCont,
                                               maxLines=1,
                                               align=uiconst.TOPLEFT,
                                               top=32,
                                               state=uiconst.UI_NORMAL)
예제 #8
0
    def ConstructLayout(self):
        cont = uicls.Container(parent=self.sr.main,
                               align=uiconst.TOTOP,
                               padding=const.defaultPadding,
                               height=16)
        checkBoxCont = uicls.ContainerAutoSize(
            parent=self.sr.main,
            name='checkBoxCont',
            align=uiconst.TOTOP,
            padding=(const.defaultPadding, 0, const.defaultPadding,
                     const.defaultPadding))
        selectLabel = uicls.EveLabelSmallBold(
            parent=cont,
            text=localization.GetByLabel(
                'UI/Corporations/CorporationWindow/Alliances/Home/SelectShortName'
            ),
            height=16,
            align=uiconst.TOTOP)
        shortNames = sm.GetService('corp').GetSuggestedAllianceShortNames(
            self.allianceName)
        checked = True
        for shortNameRow in shortNames:
            shortName = shortNameRow.shortName
            if shortName is None:
                continue
            checkBox = uicls.Checkbox(text=shortName,
                                      parent=checkBoxCont,
                                      configName='shortNames',
                                      retval=shortName,
                                      checked=checked,
                                      groupname='state',
                                      align=uiconst.TOTOP,
                                      height=19)
            self.checkBoxes.append(checkBox)
            checked = False

        self.height = checkBoxCont.height + 70
예제 #9
0
파일: base_fw.py 프로젝트: R4M80MrX/eve-1
 def ConstructExistingFWPlayerHeader(self):
     self.topCont.Flush()
     iconSize = 50
     rightCont = uicls.Container(name='rightCont',
                                 parent=self.topCont,
                                 align=uiconst.TORIGHT,
                                 width=200,
                                 padLeft=2)
     leftCont = uicls.Container(name='leftCont',
                                parent=self.topCont,
                                clipChildren=True)
     firstLine = uicls.Container(parent=leftCont,
                                 align=uiconst.TOTOP_PROP,
                                 height=0.4,
                                 padLeft=20)
     uicls.Sprite(
         parent=firstLine,
         align=uiconst.CENTERLEFT,
         pos=(0, 0, iconSize, iconSize),
         texturePath='res:/UI/Texture/Icons/FactionalWarfare_64.png')
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     enemyAllyID = facwarCommon.GetFactionSecondaryEnemy(self.factionID)
     text = localization.GetByLabel(
         'UI/FactionWarfare/FWPlayerHeader1',
         typeID=const.typeFaction,
         factionID=self.factionID,
         factionName=self.factionName,
         enemyID=enemyID,
         enemyName=cfg.eveowners.Get(enemyID).name,
         enemyAllyID=enemyAllyID,
         enemyAllyName=cfg.eveowners.Get(enemyAllyID).name)
     uicls.EveLabelLarge(parent=firstLine,
                         align=uiconst.CENTERLEFT,
                         state=uiconst.UI_NORMAL,
                         left=iconSize + 20,
                         text=text)
     secondLine = uicls.Container(parent=leftCont,
                                  align=uiconst.TOTOP_PROP,
                                  height=0.6,
                                  padLeft=20)
     logo = uicls.LogoIcon(itemID=self.factionID,
                           parent=secondLine,
                           align=uiconst.CENTERLEFT,
                           size=iconSize,
                           ignoreSize=True)
     enemyID = facwarCommon.GetFactionMainEnemy(self.factionID)
     labelCont = uicls.ContainerAutoSize(parent=secondLine,
                                         align=uiconst.CENTERLEFT,
                                         left=iconSize + 20)
     rank, rankDesc = self.GetCurrentRank()
     timeServed = self.GetTimeServed()
     text = localization.GetByLabel('UI/FactionWarfare/FWPlayerHeader2',
                                    rank=rank,
                                    corp=cfg.eveowners.Get(
                                        session.corpid).name,
                                    faction=self.factionName,
                                    time=timeServed)
     uicls.EveLabelMedium(parent=labelCont, text=text, tabs=[100])
     firstLine = uicls.Container(name='firstLine',
                                 parent=rightCont,
                                 align=uiconst.TOTOP,
                                 height=80)
     secondLine = uicls.Container(name='secondLine',
                                  parent=rightCont,
                                  align=uiconst.TOTOP,
                                  height=40,
                                  top=3)
     totalPointsCont = uicls.Container(
         parent=firstLine,
         pos=(0, 30, 55, 30),
         align=uiconst.TOPLEFT,
         state=uiconst.UI_NORMAL,
         hint=localization.GetByLabel(
             'UI/FactionWarfare/WarzoneProgress',
             points=self.warZoneInfo.factionPoints,
             pointsTotal=int(self.warZoneInfo.maxWarZonePoints)))
     uicls.EveLabelSmall(
         parent=totalPointsCont,
         text=localization.GetByLabel('UI/FactionWarfare/Points'),
         align=uiconst.CENTERTOP,
         top=-15)
     uicls.Frame(bgParent=totalPointsCont, color=(0.392, 0.635, 0.212, 0.2))
     uicls.GradientSprite(bgParent=totalPointsCont,
                          rotation=-pi / 2,
                          rgbData=[(0, (0.239, 0.42, 0.235)),
                                   (1, (0.075, 0.157, 0.086))],
                          alphaData=[(0, 1.0), (1, 0.9)])
     self.totalPointsLabel = uicls.EveCaptionMedium(
         parent=totalPointsCont,
         align=uiconst.CENTER,
         text=self.warZoneInfo.factionPoints)
     systemsCont = uicls.Container(
         parent=firstLine,
         align=uiconst.TOPLEFT,
         pos=(65, 5, 50, 100),
         state=uiconst.UI_NORMAL,
         hint=localization.GetByLabel(
             'UI/FactionWarfare/NumConqueredSystems'))
     uicls.Sprite(parent=systemsCont,
                  align=uiconst.CENTERTOP,
                  state=uiconst.UI_DISABLED,
                  pos=(0, 0, 32, 32),
                  texturePath='res:/UI/Texture/Icons/Systems_64.png')
     numSystems = len(
         sm.GetService('facwar').GetSolarSystemsOccupiedByFactions(
             [self.factionID]))
     self.numSystemsLabel = uicls.EveHeaderLarge(parent=systemsCont,
                                                 align=uiconst.CENTERTOP,
                                                 top=30,
                                                 text=numSystems)
     numUpgrades = self.GetSystemUpgradeNumbers()
     for i, num in enumerate(numUpgrades):
         if num:
             bgColor = util.Color.GetGrayRGBA(0.5, 0.5)
         else:
             bgColor = util.Color.GetGrayRGBA(0.2, 0.5)
         cont = uicls.Container(parent=secondLine,
                                bgColor=bgColor,
                                align=uiconst.TOLEFT,
                                state=uiconst.UI_NORMAL,
                                width=35,
                                padTop=15,
                                padRight=4,
                                hint=localization.GetByLabel(
                                    'UI/FactionWarfare/UpgradeLevelHint',
                                    level=util.IntToRoman(i + 1)))
         uicls.EveLabelMedium(parent=cont,
                              align=uiconst.CENTERTOP,
                              text=util.IntToRoman(i + 1),
                              top=-20)
         uicls.EveHeaderLarge(parent=cont, align=uiconst.CENTER, text=num)
예제 #10
0
파일: base_fw.py 프로젝트: R4M80MrX/eve-1
 def ConstructBottomButtons(self):
     fwSvc = sm.GetService('facwar')
     self.bottomCont.Flush()
     buttons = []
     self.factionalWarStatus = fwSvc.GetFactionalWarStatus()
     fwStatus = self.factionalWarStatus.status
     pendingFactionID = self.factionalWarStatus.factionID
     hasReqCorporationRole = session.corprole & const.corpRoleDirector == const.corpRoleDirector
     hasReqAllianceRole = hasReqCorporationRole and session.allianceid and sm.GetService(
         'alliance').GetAlliance().executorCorpID == session.corpid
     notEnlisted = not session.warfactionid
     if notEnlisted:
         if fwStatus == const.facwarCorporationJoining and hasReqCorporationRole:
             buttons.append(
                 ('UI/FactionWarfare/WithdrawApplication',
                  self.CancelApplication, pendingFactionID, None))
         else:
             isInFWStation = fwSvc.CheckStationElegibleForMilitia()
             if isInFWStation:
                 disabledTxt = None
             else:
                 disabledTxt = 'UI/FactionWarfare/EnlistDisabledHint'
             buttons.append(('UI/FactionWarfare/EnlistMe', self.OnEnlistMe,
                             (), disabledTxt))
             if isInFWStation and hasReqCorporationRole:
                 disabledTxt = None
             else:
                 disabledTxt = 'UI/FactionWarfare/EnlistCorpDisabledHint'
             buttons.append(('UI/FactionWarfare/EnlistCorporation',
                             self.OnEnlistMyCorp, (), disabledTxt))
             if isInFWStation and hasReqAllianceRole:
                 disabledTxt = None
             else:
                 disabledTxt = 'UI/FactionWarfare/EnlistAllianceDisabledHint'
             buttons.append(('UI/FactionWarfare/EnlistAlliance',
                             self.OnEnlistMyAlliance, (), disabledTxt))
     elif util.IsNPC(session.corpid):
         if session.warfactionid:
             buttons.append(
                 ('UI/FactionWarfare/Retire', self.Retire, (), None))
     elif hasReqCorporationRole:
         if fwStatus == const.facwarCorporationActive:
             if session.allianceid:
                 buttons.append(
                     ('UI/FactionWarfare/RetireAlliance',
                      self.RetireAlliance, pendingFactionID, None))
             else:
                 buttons.append(('UI/FactionWarfare/RetireCorporation',
                                 self.RetireCorp, pendingFactionID, None))
         elif fwStatus == const.facwarCorporationLeaving:
             buttons.append(('UI/FactionWarfare/CancelRetirement',
                             self.CancelRetirement, pendingFactionID, None))
     if buttons:
         height = 54 if notEnlisted else 36
         buttonCont = uicls.ContainerAutoSize(parent=self.bottomCont,
                                              align=uiconst.CENTER,
                                              height=height,
                                              padding=8)
         self.bottomCont.height = height
         for label, func, args, disabledTxt in buttons:
             btn = uicls.Button(parent=buttonCont,
                                align=uiconst.TOLEFT,
                                func=func,
                                args=args,
                                label=localization.GetByLabel(label),
                                padLeft=8)
             if disabledTxt:
                 btn.hint = localization.GetByLabel(disabledTxt)
                 btn.Disable()
예제 #11
0
    def ApplyAttributes(self, attributes):
        uicls.Window.ApplyAttributes(self, attributes)
        self.itemID = attributes.Get('itemID')
        lpPool = sm.GetService('facwar').GetSolarSystemLPs()
        topCont = uicls.Container(name='topCont',
                                  parent=self.sr.main,
                                  align=uiconst.TOTOP,
                                  height=40,
                                  padding=(self.PADSIDE, self.PADTOP,
                                           self.PADSIDE, self.PADSIDE))
        mainCont = uicls.ContainerAutoSize(name='mainCont',
                                           parent=self.sr.main,
                                           align=uiconst.TOTOP)
        bottomCont = uicls.Container(name='bottomCont',
                                     parent=self.sr.main,
                                     align=uiconst.TOBOTTOM,
                                     height=100,
                                     padTop=self.PADTOP)
        uicls.EveLabelLarge(parent=topCont,
                            text=localization.GetByLabel(
                                'UI/FactionWarfare/IHub/SystemUpgradePanel',
                                systemName=cfg.evelocations.Get(
                                    session.solarsystemid2).name),
                            align=uiconst.TOPLEFT,
                            top=5)
        uicls.EveLabelLarge(
            parent=topCont,
            text=localization.GetByLabel('UI/FactionWarfare/IHub/TotalLP'),
            align=uiconst.TOPRIGHT,
            top=5)
        self.lpPoolLabel = uicls.EveCaptionSmall(parent=topCont,
                                                 align=uiconst.TOPRIGHT,
                                                 top=25)
        limits = [0] + const.facwarSolarSystemUpgradeThresholds + [
            const.facwarSolarSystemMaxLPPool
        ]
        self.upgradeBars = []
        for i in xrange(1, 7):
            bar = uicls.FWUpgradeLevelCont(parent=mainCont,
                                           align=uiconst.TOTOP,
                                           padding=(self.PADSIDE, 0, 10, 10),
                                           lowerLimit=limits[i - 1],
                                           upperLimit=limits[i],
                                           lpAmount=lpPool,
                                           level=i,
                                           idx=0)
            self.upgradeBars.append(bar)

        self.bottomGradient = uicls.GradientSprite(bgParent=bottomCont,
                                                   rotation=-pi / 2,
                                                   rgbData=[(0, (0.3, 0.3,
                                                                 0.3))],
                                                   alphaData=[(0, 0.3),
                                                              (0.9, 0.0)])
        self.bottomFlashEffect = uicls.GradientSprite(bgParent=bottomCont,
                                                      rotation=-pi / 2,
                                                      rgbData=[(0, (0.6, 0.6,
                                                                    0.6))],
                                                      alphaData=[(0, 0.3),
                                                                 (0.9, 0.0)],
                                                      opacity=0.0)
        uicls.Line(parent=bottomCont,
                   align=uiconst.TOTOP,
                   color=(0.3, 0.3, 0.3, 0.3))
        bottomMainCont = uicls.Container(name='bottomMainCont',
                                         parent=bottomCont,
                                         align=uiconst.CENTER,
                                         width=450,
                                         height=100)
        self.myLPLabel = uicls.Label(parent=bottomMainCont,
                                     text=self.GetLPOwnedLabel(),
                                     align=uiconst.TOPLEFT,
                                     left=self.PADSIDE,
                                     top=self.PADTOP)
        self.bottomBottomCont = uicls.Container(name='bottomBottom',
                                                align=uiconst.TOPLEFT,
                                                pos=(self.PADSIDE, 40, 450,
                                                     25),
                                                parent=bottomMainCont)
        self.donateAmountEdit = uicls.SinglelineEdit(
            parent=self.bottomBottomCont,
            name='donateAmountEdit',
            align=uiconst.TOLEFT,
            setvalue=0,
            width=155,
            OnReturn=self.OnDonateLPBtn,
            OnChange=self.OnDonateValueChanged)
        self.donateBtn = uicls.Button(
            parent=self.bottomBottomCont,
            align=uiconst.TOLEFT,
            func=self.OnDonateLPBtn,
            label=localization.GetByLabel('UI/FactionWarfare/IHub/DonateLPs'),
            padLeft=4)
        self.donationReceivedLabel = uicls.EveCaptionMedium(
            name='donationReceivedLabel',
            parent=bottomMainCont,
            align=uiconst.TOPLEFT,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/DonationReceived'),
            left=self.PADSIDE,
            top=50,
            opacity=0.0)
        self.bottomTaxCont = uicls.Container(name='bottomTax',
                                             align=uiconst.TOPLEFT,
                                             pos=(self.PADSIDE, 73, 400, 25),
                                             parent=bottomMainCont)
        self.myLPToIhubLabel = None
        factionID = sm.GetService('facwar').GetSystemOccupier(
            session.solarsystemid)
        self.myLPTaxLabel = uicls.Label(
            name='myLPTaxLabel',
            parent=self.bottomTaxCont,
            text=localization.GetByLabel(
                'UI/FactionWarfare/IHub/maintenanceTax',
                tax=int(facwarCommon.GetDonationTax(factionID) * 100)),
            align=uiconst.TOLEFT,
            state=uiconst.UI_NORMAL,
            left=5)
        self.SetLPPoolAmount(lpPool)
        self.UpdateMyLPAmount()
        self.UpdateMyLPToIHubLabel()
        uthread.new(self.CheckOpenThread)
예제 #12
0
    def Startup(self, slimItem):
        sm.RegisterNotify(self)
        obs = sm.GetService('target').IsObserving()
        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.iconSize = iconSize = 94
        barAndImageCont = uicls.Container(parent=self,
                                          name='barAndImageCont',
                                          align=uiconst.TOTOP,
                                          height=100,
                                          state=uiconst.UI_NORMAL)
        iconPar = uicls.Container(parent=barAndImageCont,
                                  name='iconPar',
                                  width=iconSize,
                                  height=iconSize,
                                  align=uiconst.CENTERTOP,
                                  state=uiconst.UI_DISABLED)
        barAndImageCont.OnMouseDown = self.OnTargetMouseDown
        barAndImageCont.OnMouseUp = self.OnTargetMouseUp
        barAndImageCont.OnClick = self.OnTargetClick
        barAndImageCont.GetMenu = self.GetTargetMenu
        barAndImageCont.OnMouseEnter = self.OnTargetMouseEnter
        barAndImageCont.OnMouseExit = self.OnTargetMouseExit
        self.barAndImageCont = barAndImageCont
        maskSize = 50
        iconPadding = (iconSize - maskSize) / 2
        icon = uicls.Icon(
            parent=iconPar,
            left=iconPadding,
            top=iconPadding,
            width=maskSize,
            height=maskSize,
            typeID=slimItem.typeID,
            textureSecondaryPath='res:/UI/Texture/classes/Target/shipMask.png',
            color=(1.0, 1.0, 1.0, 1.0),
            blendMode=1,
            spriteEffect=trinity.TR2_SFX_MODULATE,
            state=uiconst.UI_DISABLED,
            ignoreSize=True)
        if slimItem.groupID == const.groupOrbitalTarget:
            sm.GetService('photo').GetPortrait(slimItem.ownerID, 64, icon)
        if self.updatedamage:
            self.healthBar = uicls.TargetHealthBars(parent=iconPar,
                                                    itemID=self.itemID)
        self.sr.activeTarget = uicls.ActiveTargetOnBracket(parent=iconPar,
                                                           itemID=self.itemID)
        self.sr.iconPar = iconPar
        self.slimForFlag = slimItem
        self.SetStandingIcon()
        self.sr.hilite = uicls.Sprite(
            name='hiliteSprite',
            parent=iconPar,
            left=-5,
            top=-5,
            width=100,
            height=100,
            texturePath='res:/UI/Texture/classes/Target/targetUnderlay.png',
            color=(1.0, 1.0, 1.0, 0.05))
        circle = uicls.Sprite(
            name='circle',
            align=uiconst.CENTER,
            parent=iconPar,
            width=iconSize + 2,
            height=iconSize + 2,
            texturePath='res:/UI/Texture/classes/Target/outerCircle.png',
            color=(1.0, 1.0, 1.0, 0.5),
            state=uiconst.UI_DISABLED)
        self.circle = circle
        self.sr.activeTarget.RotateArrows()
        if not obs:
            labelClass = uicls.EveLabelSmall
        else:
            labelClass = uicls.EveLabelMedium
        labelContainer = uicls.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 = uicls.Container(name='assignedPar',
                                              align=uiconst.TOTOP,
                                              parent=self,
                                              height=32)
        self.sr.assigned = uicls.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)
예제 #13
0
 def ApplyAttributes(self, attributes):
     uicls.InfoPanelBase.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     self.lastInfluence = None
     self.headerTextCont = uicls.Container(name='headerTextCont',
                                           parent=self.headerCont,
                                           align=uiconst.TOALL)
     self.title = self.headerCls(
         name='title',
         text=
         '<color=white url=localsvc:service=journal&method=ShowIncursionTab&constellationID=%d&open=1>%s</url>'
         % (session.constellationid, localization.GetByLabel(self.label)),
         parent=self.headerTextCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_NORMAL)
     self.subTitle = uicls.EveHeaderMedium(name='subtitle',
                                           parent=self.headerTextCont,
                                           left=self.title.width + 4,
                                           align=uiconst.CENTERLEFT,
                                           state=uiconst.UI_NORMAL,
                                           top=3)
     self.bossIcon = uicls.IncursionBossIcon(name='bossIcon',
                                             parent=self.headerCont,
                                             align=uiconst.CENTERRIGHT,
                                             left=8)
     self.headerInfluenceBar = uicls.SystemInfluenceBar(
         parent=self.headerCont,
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOALL,
         height=0,
         padding=(0, 6, 24, 6))
     self.headerInfluenceBar.OnClick = self.topCont.OnClick
     self.headerInfluenceBar.OnMouseEnter = self.topCont.OnMouseEnter
     self.headerInfluenceBar.OnMouseExit = self.topCont.OnMouseExit
     self.influenceBar = uicls.SystemInfluenceBar(parent=self.mainCont,
                                                  padding=(0, 0, 0, 2))
     self.bottomContainer = uicls.Container(name='bottomContainer',
                                            parent=self.mainCont,
                                            align=uiconst.TOTOP,
                                            height=33)
     self.severityIcon = uicls.Icon(name='severityIcon',
                                    parent=self.bottomContainer,
                                    align=uiconst.RELATIVE,
                                    color=COLOR_ENABLED,
                                    pos=(0, 0, 32, 32),
                                    ignoreSize=True,
                                    size=48,
                                    state=uiconst.UI_NORMAL)
     iconCont = uicls.ContainerAutoSize(name='iconCont',
                                        parent=self.bottomContainer,
                                        align=uiconst.CENTERLEFT,
                                        pos=(45, 0, 0, 22))
     iconParams = {
         'align': uiconst.TOLEFT,
         'parent': iconCont,
         'color': COLOR_ENABLED,
         'width': iconCont.height,
         'padRight': 6
     }
     self.effects = [
         uicls.Sprite(name='effectIcon_cyno',
                      texturePath=
                      'res:/UI/Texture/classes/InfluenceBar/effectCyno.png',
                      hint=localization.GetByLabel(
                          'UI/Incursion/HUD/SystemEffectCynoHint'),
                      **iconParams),
         uicls.Sprite(name='effectIcon_tax',
                      texturePath=
                      'res:/UI/Texture/classes/InfluenceBar/effectTax.png',
                      hint=localization.GetByLabel(
                          'UI/Incursion/HUD/SystemEffectTaxHint'),
                      **iconParams),
         uicls.Sprite(
             name='effectIcon_tank',
             texturePath=
             'res:/UI/Texture/classes/InfluenceBar/effectResistance.png',
             hint=localization.GetByLabel(
                 'UI/Incursion/HUD/SystemEffectTankingHint'),
             **iconParams),
         uicls.Sprite(
             name='effectIcon_damage',
             texturePath=
             'res:/UI/Texture/classes/InfluenceBar/effectDamage.png',
             hint=localization.GetByLabel(
                 'UI/Incursion/HUD/SystemEffectDamageHint'),
             **iconParams)
     ]
     uthread.new(self.UpdateInfluenceThread)
예제 #14
0
 def ApplyAttributes(self, attributes):
     uicls.ContainerAutoSize.ApplyAttributes(self, attributes)
     self.activeBuildEntry = None
     self.buildContainer = uicls.ContainerAutoSize(parent=self, name='buildContainer', align=uiconst.TOTOP)
     self.CreateLayout()
     sm.RegisterNotify(self)
예제 #15
0
파일: filterSvc.py 프로젝트: R4M80MrX/eve-1
    def ApplyAttributes(self, attributes):
        uicls.Window.ApplyAttributes(self, attributes)
        self.MakeUnMinimizable()
        self.MakeUncollapseable()
        filter = attributes.get('filter', None)
        if filter:
            self.name, self.allOrAny, conditions = filter
            self.originalName = self.name
        else:
            self.name = ''
            self.allOrAny = RESULT_ALL
            conditions = None
            self.originalName = None
        self.entryCont = uicls.ScrollContainer(name='entryCont',
                                               parent=self.sr.main,
                                               align=uiconst.TOALL,
                                               padding=(10, 10, 10, 0))
        bottomPar = uicls.Container(name='bottomPar',
                                    parent=self.sr.main,
                                    align=uiconst.TOBOTTOM,
                                    height=75,
                                    idx=0)
        uicls.GradientSprite(bgParent=bottomPar,
                             rotation=-pi / 2,
                             rgbData=[(0, (0.3, 0.3, 0.3))],
                             alphaData=[(0, 0.3), (0.9, 0.0)])
        uicls.Line(parent=bottomPar,
                   align=uiconst.TOTOP,
                   color=(0.3, 0.3, 0.3, 0.3))
        buttonCont1 = uicls.ContainerAutoSize(name='bottomCont1',
                                              parent=bottomPar,
                                              align=uiconst.CENTERTOP,
                                              top=20,
                                              height=20)
        buttonCont2 = uicls.ContainerAutoSize(name='bottomCont2',
                                              parent=bottomPar,
                                              align=uiconst.CENTERTOP,
                                              top=50,
                                              height=20)
        uicls.EveLabelSmall(
            parent=uicls.Container(align=uiconst.TOLEFT,
                                   parent=buttonCont1,
                                   width=1),
            left=3,
            top=-14,
            text=localization.GetByLabel('UI/Inventory/Filters/Match'))
        uicls.Checkbox(
            parent=buttonCont1,
            text=localization.GetByLabel('UI/Inventory/Filters/All'),
            wrapLabel=False,
            groupname='allOrAny',
            align=uiconst.TOLEFT,
            checked=self.allOrAny == RESULT_ALL,
            callback=self.OnRadioButtonsChanged,
            retval=RESULT_ALL)
        self.radiButtons = uicls.Checkbox(
            parent=buttonCont1,
            text=localization.GetByLabel('UI/Inventory/Filters/Any'),
            wrapLabel=False,
            groupname='allOrAny',
            align=uiconst.TOLEFT,
            checked=self.allOrAny == RESULT_ANY,
            callback=self.OnRadioButtonsChanged,
            retval=RESULT_ANY)
        self.nameEdit = uicls.SinglelineEdit(
            name='nameEdit',
            parent=buttonCont1,
            align=uiconst.TOLEFT,
            label=localization.GetByLabel('UI/Inventory/Filters/FilterName'),
            width=120,
            padLeft=20,
            setvalue=self.name)
        uicls.Button(label=localization.GetByLabel('UI/Common/Buttons/Save'),
                     parent=buttonCont2,
                     align=uiconst.TOLEFT,
                     func=self.Save,
                     padLeft=4)
        uicls.Button(label=localization.GetByLabel('UI/Common/Buttons/Close'),
                     parent=buttonCont2,
                     align=uiconst.TOLEFT,
                     func=self.Close,
                     padLeft=4)
        if conditions:
            for condition in conditions:
                self.AddEntry(isRemovable=True, condition=condition)

        self.AddEntry(isRemovable=False)