def _GetInfoCont(self):
     self.storageGauge = uicls.Gauge(
         parent=self.infoContLeft,
         value=0.0,
         color=planetCommonUI.PLANET_COLOR_STORAGE,
         label=localization.GetByLabel('UI/PI/Common/Capacity'),
         top=0)
     self.launchTimeTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/NextLaunchTime'),
         top=45)
     self.cooldownTimer = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel(
             'UI/PI/Common/NextTransferAvailable'),
         top=80)
     self.cpuGauge = uicls.Gauge(parent=self.infoContRight,
                                 value=0.0,
                                 color=planetCommonUI.PLANET_COLOR_CPU,
                                 top=0)
     self.powerGauge = uicls.Gauge(parent=self.infoContRight,
                                   value=0.0,
                                   color=planetCommonUI.PLANET_COLOR_POWER,
                                   top=40)
     self.upgradeLevelGauge = uicls.Gauge(
         parent=self.infoContRight,
         value=self._GetUpgradeLevelGaugeValue(),
         color=planetCommonUI.PLANET_COLOR_CURRLEVEL,
         backgroundColor=util.Color.GetGrayRGBA(0.5, 0.5),
         label=localization.GetByLabel('UI/PI/Common/UpgradeLevel'),
         top=80)
     self.upgradeLevelGauge.ShowMarkers([0.167, 0.333, 0.5, 0.667, 0.833],
                                        color=util.Color.BLACK)
 def CreateEditModeContainer(self):
     uicontrols.EveHeaderLarge(parent=self.editModeContent, text=localization.GetByLabel('UI/PI/Common/EditsPending'), align=uiconst.RELATIVE)
     self.powerGauge = uicls.Gauge(parent=self.editModeContent, pos=(0, 22, 115, 34), color=planetCommon.PLANET_COLOR_POWER, label=localization.GetByLabel('UI/PI/Common/PowerUsage'))
     self.cpuGauge = uicls.Gauge(parent=self.editModeContent, pos=(130, 22, 115, 34), color=planetCommon.PLANET_COLOR_CPU, label=localization.GetByLabel('UI/PI/Common/CpuUsage'))
     self.UpdatePowerAndCPUGauges()
     btns = [[localization.GetByLabel('UI/Common/Submit'), self.Submit, ()], [localization.GetByLabel('UI/Common/Cancel'), self.Cancel, ()]]
     bottom = uiprimitives.Container(parent=self.editModeContent, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 40))
     btns = uicontrols.ButtonGroup(btns=btns, subalign=uiconst.CENTERRIGHT, parent=bottom, line=False, alwaysLite=True)
     self.costText = CaptionAndSubtext(parent=bottom, align=uiconst.TOPLEFT, top=13, caption=localization.GetByLabel('UI/Common/Cost'), subtext='')
Example #3
0
 def _GetInfoCont(self):
     p = self.infoContPad
     infoCont = self._DrawAlignTopCont(55, 'infoCont', padding=(p, p, p, p))
     link = self.pin.link
     totalBandwidth = localization.GetByLabel(
         'UI/PI/Common/CapacityAmount', amount=link.GetTotalBandwidth())
     bandwidthUsed = localization.GetByLabel(
         'UI/PI/Common/CapacityAmount', amount=link.GetBandwidthUsage())
     self.totalBandwidth = planet.ui.CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/LinkMaxCapacity'),
         subtext=totalBandwidth)
     self.bandwidthUsed = planet.ui.CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/CapacityUsed'),
         subtext=bandwidthUsed,
         top=30)
     left = self.infoContRightColAt
     self.bandwidthGauge = uicls.Gauge(
         parent=infoCont,
         value=link.GetBandwidthUsage() / link.GetTotalBandwidth(),
         color=planetCommon.PLANET_COLOR_BANDWIDTH,
         label=localization.GetByLabel('UI/PI/Common/CapacityUsed'),
         left=left)
     levelStr = localization.GetByLabel(
         'UI/PI/Common/LinkUpgradeLevelAndName',
         upgradeLevel=uiutil.IntToRoman(link.level),
         upgradeLevelName=self.GetCaptionForUpgradeLevel(link.level))
     self.upgradeLevel = planet.ui.CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/UpgradeLevel'),
         subtext=levelStr,
         top=30,
         left=left)
     return infoCont
 def _GetInfoCont(self):
     p = self.infoContPad
     infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p, p, p, p))
     self.storageGauge = uicls.Gauge(
         parent=infoCont,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         label=localization.GetByLabel('UI/PI/Common/Storage'))
     self.cooldownTimer = planet.ui.CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel(
             'UI/PI/Common/NextTransferAvailable'),
         top=40)
     left = self.infoContRightColAt
     self.itemsTxt = planet.ui.CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/StoredItems'),
         left=left,
         state=uiconst.UI_DISABLED)
     self.iconCont = uicls.Container(parent=infoCont,
                                     pos=(left, 12, 120, 60),
                                     align=uiconst.TOPLEFT,
                                     state=uiconst.UI_PICKCHILDREN)
     self._DrawStoredCommoditiesIcons()
     return infoCont
 def _GetInfoCont(self):
     p = self.infoContPad
     infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p, p, p, p))
     self.currDepositTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/Extracting'),
         top=0)
     self.timeToDeplTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'),
         top=40)
     left = self.infoContRightColAt
     self.currCycleGauge = uicls.Gauge(
         parent=infoCont,
         value=0.0,
         color=planetCommon.PLANET_COLOR_CYCLE,
         label=localization.GetByLabel('UI/PI/Common/CurrentCycle'),
         cyclic=True,
         width=120)
     self.currCycleGauge.left = left
     self.currCycleOutputTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/CurrentCycleOutput'),
         top=40,
         left=left)
     return infoCont
Example #6
0
 def _GetInfoCont(self):
     self.currDepositTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/Extracting'),
         top=0)
     self.depositsLeftTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/TotalAmountLeft'),
         top=40)
     self.timeToDeplTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'),
         top=70)
     self.currCycleGauge = uicls.Gauge(
         parent=self.infoContRight,
         value=0.0,
         color=planetCommonUI.PLANET_COLOR_CYCLE,
         label=localization.GetByLabel('UI/PI/Common/CurrentCycle'),
         cyclic=True)
     self.amountPerCycleTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerCycle'),
         top=40)
     self.amountPerHourTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'),
         top=70)
 def _GetInfoCont(self):
     p = self.infoContPad
     infoCont = self._DrawAlignTopCont(95, 'infoCont', padding=(p, p, p, p))
     self.currProductTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/Producing'))
     self.ingredientsTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/SchematicInput'),
         top=50)
     self.ingredientsTxt.state = uiconst.UI_DISABLED
     self.ingredientCont = uiprimitives.Container(
         parent=infoCont,
         pos=(0, 63, 100, 0),
         state=uiconst.UI_PICKCHILDREN)
     self.RenderIngredientGauges()
     left = self.infoContRightColAt
     self.currCycleGauge = uicls.Gauge(
         parent=infoCont,
         value=0.0,
         color=planetCommon.PLANET_COLOR_CYCLE,
         left=left,
         width=140)
     self.amountPerCycleTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerCycle'),
         left=left,
         top=40)
     self.amountPerHourTxt = CaptionAndSubtext(
         parent=infoCont,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'),
         left=left,
         top=70)
     return infoCont
Example #8
0
 def _GetInfoCont(self):
     self.currProductTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/Producing'))
     self.ingredientsTxt = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/SchematicInput'),
         top=50)
     self.ingredientsTxt.state = uiconst.UI_DISABLED
     self.ingredientCont = ContainerAutoSize(parent=self.infoContLeft,
                                             top=63,
                                             state=uiconst.UI_PICKCHILDREN)
     self.RenderIngredientGauges()
     self.currCycleGauge = uicls.Gauge(
         parent=self.infoContRight,
         value=0.0,
         color=planetCommon.PLANET_COLOR_CYCLE,
         width=140)
     self.amountPerCycleTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerCycle'),
         top=40)
     self.amountPerHourTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'),
         top=70)
Example #9
0
 def _GetInfoCont(self):
     link = self.pin.link
     totalBandwidth = localization.GetByLabel(
         'UI/PI/Common/CapacityAmount', amount=link.GetTotalBandwidth())
     bandwidthUsed = localization.GetByLabel(
         'UI/PI/Common/CapacityAmount', amount=link.GetBandwidthUsage())
     self.totalBandwidth = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/LinkMaxCapacity'),
         subtext=totalBandwidth)
     self.bandwidthUsed = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel('UI/PI/Common/CapacityUsed'),
         subtext=bandwidthUsed,
         top=30)
     self.bandwidthGauge = uicls.Gauge(
         parent=self.infoContRight,
         value=link.GetBandwidthUsage() / link.GetTotalBandwidth(),
         color=planetCommonUI.PLANET_COLOR_BANDWIDTH,
         label=localization.GetByLabel('UI/PI/Common/CapacityUsed'))
     levelStr = localization.GetByLabel(
         'UI/PI/Common/LinkUpgradeLevelAndName',
         upgradeLevel=uiutil.IntToRoman(link.level),
         upgradeLevelName=self.GetCaptionForUpgradeLevel(link.level))
     self.upgradeLevel = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/UpgradeLevel'),
         subtext=levelStr,
         top=30)
 def ApplyAttributes(self, attributes):
     uicls.InfoPanelBase.ApplyAttributes(self, attributes)
     self.isGaugeInitialized = False
     self.benefitIcons = []
     self.factionIcon = None
     self.headerTextCont = uiprimitives.Container(name='headerTextCont',
                                                  parent=self.headerCont,
                                                  align=uiconst.TOALL)
     self.title = self.headerCls(
         name='title',
         text=
         '<color=white url=localsvc:service=cmd&method=OpenMilitia>%s</url>'
         % localization.GetByLabel('UI/FactionWarfare/FactionalWarfare'),
         parent=self.headerTextCont,
         align=uiconst.CENTERLEFT,
         state=uiconst.UI_NORMAL)
     self.subTitle = uicontrols.EveHeaderMedium(name='subtitle',
                                                parent=self.headerTextCont,
                                                align=uiconst.CENTERLEFT,
                                                state=uiconst.UI_NORMAL,
                                                left=self.title.width + 5,
                                                top=2,
                                                bold=True)
     self.headerControlGauge = uicls.Gauge(parent=self.headerCont,
                                           align=uiconst.TOALL,
                                           gaugeHeight=16,
                                           padTop=6,
                                           padRight=6,
                                           color=(0.5, 0.5, 0.5, 1.0),
                                           width=0,
                                           height=0,
                                           state=uiconst.UI_HIDDEN)
     self.headerControlGauge.OnClick = self.topCont.OnClick
     self.headerControlGauge.OnMouseEnter = self.topCont.OnMouseEnter
     self.headerControlGauge.OnMouseExit = self.topCont.OnMouseExit
     self.headerControlGauge.GetHint = self.GetGaugeHint
     self.controlGauge = uicls.Gauge(parent=self.mainCont,
                                     align=uiconst.TOTOP,
                                     padTop=2,
                                     gaugeHeight=15,
                                     color=(0.5, 0.5, 0.5, 1.0))
     self.controlGauge.GetHint = self.GetGaugeHint
     self.bottomContainer = uicontrols.ContainerAutoSize(
         parent=self.mainCont, name='bottomContainer', align=uiconst.TOTOP)
     self.bottomContainer.EnableAutoSize()
     self.mainCont.EnableAutoSize()
Example #11
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)
Example #12
0
 def _GetInfoCont(self):
     self.storageGauge = uicls.Gauge(
         parent=self.infoContLeft,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         label=localization.GetByLabel('UI/PI/Common/Storage'))
     self.cooldownTimer = CaptionAndSubtext(
         parent=self.infoContLeft,
         caption=localization.GetByLabel(
             'UI/PI/Common/NextTransferAvailable'),
         top=40)
     self.itemsTxt = CaptionAndSubtext(
         parent=self.infoContRight,
         caption=localization.GetByLabel('UI/PI/Common/StoredItems'),
         state=uiconst.UI_DISABLED)
     self.iconCont = uiprimitives.Container(parent=self.infoContRight,
                                            pos=(0, 12, 120, 60),
                                            align=uiconst.TOPLEFT,
                                            state=uiconst.UI_PICKCHILDREN)
     self._DrawStoredCommoditiesIcons()
Example #13
0
 def Layout(self):
     self.SetMinSize([560, 400])
     self.SetWndIcon('53_11')
     self.SetTopparentHeight(56)
     self.MakeUnstackable()
     checkIsMyCorps = self.customsOfficeItem.ownerID == session.corpid
     checkIsStationManager = session.corprole & const.corpRoleStationManager == const.corpRoleStationManager
     if checkIsMyCorps and checkIsStationManager:
         self.SetHeaderIcon()
         self.settingsIcon = self.sr.headerIcon
         self.settingsIcon.state = uiconst.UI_NORMAL
         self.settingsIcon.GetMenu = self.GetSettingsMenu
         self.settingsIcon.expandOnLeft = 1
         self.settingsIcon.hint = localization.GetByLabel(
             'UI/DustLink/ConfigureOrbital')
     self.windowCaption = uicls.WndCaptionLabel(
         text=localization.GetByLabel(
             'UI/PI/Common/PlanetaryCustomsOfficeName',
             planetName=cfg.evelocations.Get(self.planet.planetID).name),
         subcaption=localization.GetByLabel(
             'UI/PI/Common/ImportExportSubHeading'),
         parent=self.sr.topParent,
         align=uiconst.RELATIVE)
     self.SetCaption(
         localization.GetByLabel('UI/PI/Common/PlanetaryCustomsOfficeName',
                                 planetName=cfg.evelocations.Get(
                                     self.planet.planetID).name))
     pad = const.defaultPadding
     self.sr.footer = uicls.Container(name='footer',
                                      parent=self.sr.main,
                                      align=uiconst.TOBOTTOM,
                                      pos=(0, 0, 0, 25),
                                      padding=(pad * 2, 0, pad, 2))
     self.sr.cols = uicls.Container(name='colums',
                                    parent=self.sr.main,
                                    align=uiconst.TOALL,
                                    padding=(pad, 0, 0, 0))
     uicls.Line(parent=self.sr.cols, align=uiconst.TOTOP)
     uicls.Line(parent=self.sr.cols, align=uiconst.TOBOTTOM)
     self.sr.leftColumn = uicls.Container(name='leftColumn',
                                          parent=self.sr.cols,
                                          align=uiconst.TOLEFT,
                                          padding=(pad, pad, pad, pad),
                                          clipChildren=True)
     self.sr.rightColumn = uicls.Container(name='rightColumn',
                                           parent=self.sr.cols,
                                           align=uiconst.TOLEFT,
                                           padding=(pad, pad, pad, pad),
                                           clipChildren=True)
     colTopHeight = 45
     self.sr.customsHeader = uicls.Container(name='customsHeader',
                                             parent=self.sr.leftColumn,
                                             align=uiconst.TOTOP,
                                             padding=(pad, 0, pad, pad),
                                             pos=(0, 0, 0, colTopHeight))
     self.sr.customsList = uicls.Container(name='customsList',
                                           parent=self.sr.leftColumn,
                                           align=uiconst.TOALL,
                                           state=uiconst.UI_PICKCHILDREN)
     self.sr.customsHeaderTitle = uicls.Label(text=localization.GetByLabel(
         'UI/PI/Common/PlanetaryCustomsOffice'),
                                              parent=self.sr.customsHeader,
                                              align=uiconst.TOPLEFT,
                                              fontsize=16,
                                              state=uiconst.UI_NORMAL)
     self.sr.customsGauge = uicls.Gauge(
         parent=self.sr.customsHeader,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         left=0,
         top=25,
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOPLEFT)
     self.sr.spaceportHeader = uicls.Container(name='spaceportHeader',
                                               parent=self.sr.rightColumn,
                                               align=uiconst.TOTOP,
                                               padding=(pad, 0, pad, pad),
                                               pos=(0, 0, 0, colTopHeight))
     self.sr.spaceportList = uicls.Container(name='spaceportList',
                                             parent=self.sr.rightColumn,
                                             align=uiconst.TOALL,
                                             state=uiconst.UI_PICKCHILDREN)
     self.sr.spaceportGauge = uicls.Gauge(
         parent=self.sr.spaceportHeader,
         value=0.0,
         color=planetCommon.PLANET_COLOR_STORAGE,
         left=0,
         top=25,
         state=uiconst.UI_HIDDEN,
         align=uiconst.TOPRIGHT)
     self.sr.spaceportCombo = uicls.Combo(
         label=None,
         parent=self.sr.spaceportHeader,
         options=[],
         name='imex_import_select',
         callback=self.OnSpaceportComboChanged,
         width=70,
         align=uiconst.TOTOP)
     self.sr.transferCostLabel = uicls.EveLabelSmall(
         parent=self.sr.footer, state=uiconst.UI_NORMAL, top=7)
     btns = [(localization.GetByLabel('UI/PI/Common/CustomsOfficeTransfer'),
              self.ConfirmCommodityTransfer, (), None)]
     btns = uicls.ButtonGroup(btns=btns,
                              parent=self.sr.footer,
                              line=0,
                              align=uiconst.TOPRIGHT)
     self.transferBtn = btns.GetBtnByIdx(0)
     self.__OnResizeUpdate()
     self.sr.customsListScroll = uicls.Scroll(parent=self.sr.customsList,
                                              name='customsList')
     self.sr.spaceportListScroll = uicls.Scroll(
         parent=self.sr.spaceportList, name='spaceportList')
Example #14
0
    def _ConstructRightContainer(self):
        self.resourceIconButtons = {}
        numIcons = len(self.resourceTypeIDs)
        ICONSIZE = 25
        PAD = 4
        stateParent = uiprimitives.Container(parent=self.rightCont,
                                             align=uiconst.TOTOP,
                                             height=20,
                                             padBottom=6)
        self._SetStateInfo()
        self.stateTxt = uicontrols.EveLabelSmall(parent=stateParent,
                                                 text='<center>' +
                                                 self.stateInfoText,
                                                 align=uiconst.TOALL,
                                                 top=4,
                                                 color=util.Color.WHITE,
                                                 state=uiconst.UI_NORMAL)
        uicontrols.Frame(parent=stateParent,
                         color=util.Color.GetGrayRGBA(1.0, 0.2))
        self.stateColorFill = uiprimitives.Fill(parent=stateParent,
                                                color=self.stateColor)
        if self.editsEnabled:
            state = uiconst.UI_PICKCHILDREN
        else:
            state = uiconst.UI_DISABLED
        iconCont = uiprimitives.Container(parent=self.rightCont,
                                          align=uiconst.TOTOP,
                                          pos=(0, 0,
                                               numIcons * (ICONSIZE + PAD),
                                               ICONSIZE),
                                          state=state,
                                          padding=(0, PAD, 0, PAD))
        resourceTypes = [(cfg.invtypes.Get(typeID).typeName, typeID)
                         for typeID in self.resourceTypeIDs]
        resourceTypes.sort()
        for i, (typeName, typeID) in enumerate(resourceTypes):
            ib = IconButton(parent=iconCont,
                            pos=(i * (ICONSIZE + PAD), 0, ICONSIZE, ICONSIZE),
                            size=ICONSIZE,
                            typeID=typeID,
                            ignoreSize=True)
            self.resourceIconButtons[typeID] = ib
            ib.OnClick = (self.OnResourceBtnClicked, typeID)
            ib.OnMouseEnter = (self.OnResourceBtnMouseEnter, ib, typeID)
            ib.OnMouseExit = (self.OnResourceBtnMouseExit, ib)

        self.selectedResourceTxt = SubTextLabel(parent=self.rightCont,
                                                text='',
                                                align=uiconst.TOTOP)
        self.SetCurrentResourceText(self.currResourceTypeID)
        self.currCycleGauge = uicls.Gauge(
            parent=self.rightCont,
            align=uiconst.TOTOP,
            value=0.0,
            color=planetCommonUI.PLANET_COLOR_CYCLE,
            label=localization.GetByLabel('UI/PI/Common/CurrentCycle'),
            padTop=18)
        uthread.new(self._UpdateCurrCycleGauge)
        outputTxtCont = uiprimitives.Container(parent=self.rightCont,
                                               align=uiconst.TOBOTTOM,
                                               height=40)
        CaptionLabel(parent=outputTxtCont,
                     text=localization.GetByLabel('UI/PI/Common/Output'),
                     align=uiconst.TOTOP)
        tabs = [-6, 60]
        self.outputPerHourTxt = SubTextLabel(
            parent=outputTxtCont,
            text=localization.GetByLabel('UI/Common/None'),
            align=uiconst.TOTOP,
            tabs=tabs)
        self.outputTotalTxt = SubTextLabel(parent=outputTxtCont,
                                           align=uiconst.TOTOP,
                                           tabs=tabs)
Example #15
0
    def ConstructLayout(self):
        pad = const.defaultPadding
        self.sr.footer = uicls.Container(name='footer',
                                         parent=self.sr.main,
                                         align=uiconst.TOBOTTOM,
                                         pos=(0, 0, 0, 25),
                                         padding=(pad, pad, pad, pad))
        self.sr.cols = uicls.Container(name='col1',
                                       parent=self.sr.main,
                                       align=uiconst.TOALL)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOTOP)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOBOTTOM)
        self.sr.col1 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        self.sr.col2 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        uicls.Line(parent=self.sr.cols, align=uiconst.TOLEFT)
        self.sr.col3 = uicls.Container(name='col1',
                                       parent=self.sr.cols,
                                       align=uiconst.TOLEFT,
                                       padding=(pad, pad, pad, pad),
                                       clipChildren=True)
        colTopHeight = 60
        self.sr.sourcePinHeader = uicls.Container(name='pinHeader',
                                                  parent=self.sr.col1,
                                                  align=uiconst.TOTOP,
                                                  padding=(pad, 0, pad, pad),
                                                  pos=(0, 0, 0, colTopHeight))
        self.sr.sourcePinList = uicls.Container(name='pinList',
                                                parent=self.sr.col1,
                                                align=uiconst.TOALL,
                                                state=uiconst.UI_PICKCHILDREN)
        self.sr.transferHeader = uicls.Container(name='transferHeader',
                                                 parent=self.sr.col2,
                                                 align=uiconst.TOTOP,
                                                 padding=(pad, 0, pad, pad),
                                                 pos=(0, 0, 0, colTopHeight))
        self.sr.transferList = uicls.Container(name='transferList',
                                               parent=self.sr.col2,
                                               align=uiconst.TOALL,
                                               state=uiconst.UI_PICKCHILDREN)
        self.sr.destPinHeader = uicls.Container(name='destPinHeader',
                                                parent=self.sr.col3,
                                                align=uiconst.TOTOP,
                                                padding=(pad, 0, pad, pad),
                                                pos=(0, 0, 0, colTopHeight))
        self.sr.destPinList = uicls.Container(name='destPinList',
                                              parent=self.sr.col3,
                                              align=uiconst.TOALL,
                                              state=uiconst.UI_PICKCHILDREN)
        self.sr.footerLeft = uicls.Container(name='footerLeft',
                                             parent=self.sr.footer,
                                             align=uiconst.TOLEFT)
        self.sr.footerRight = uicls.Container(name='footerRight',
                                              parent=self.sr.footer,
                                              align=uiconst.TORIGHT)
        btns = [(localization.GetByLabel('UI/PI/Common/ExecuteTransfer'),
                 self.GoForTransfer, (), None)]
        uicls.ButtonGroup(btns=btns, parent=self.sr.footerRight, line=0)
        self.sr.volumeText = uicls.EveLabelSmall(text='',
                                                 parent=self.sr.transferHeader,
                                                 left=0,
                                                 top=20,
                                                 state=uiconst.UI_NORMAL)
        self.sr.timeText = uicls.EveLabelSmall(text='',
                                               parent=self.sr.transferHeader,
                                               left=0,
                                               top=35,
                                               state=uiconst.UI_NORMAL)
        self.sr.timeText.hint = localization.GetByLabel(
            'UI/PI/Common/ExpeditedTransferProcessingHint')
        self.sr.cooldownTimeText = uicls.EveLabelSmall(
            parent=self.sr.transferHeader, left=0, top=46)
        self.sr.cooldownTimeText.hint = localization.GetByLabel(
            'UI/PI/Common/CoolDownTimeHint')
        btns = [(localization.GetByLabel('UI/PI/Common/Add'),
                 self.AddBtnClicked, (), None),
                (localization.GetByLabel('UI/PI/Common/Remove'),
                 self.RemoveBtnClicked, (), None)]
        btns = uicls.ButtonGroup(btns=btns, parent=self.sr.footerLeft, line=0)
        for b in btns.children[0].children:
            b.SetHint(
                localization.GetByLabel(
                    'UI/PI/Common/ExpeditedTransferSplitHint'))

        self.OnResizeUpdate()
        self.sr.sourcePinHeaderText = uicls.Label(
            text=planetCommon.GetGenericPinName(self.sourcePin.typeID,
                                                self.sourcePin.id),
            parent=self.sr.sourcePinHeader,
            align=uiconst.TOPLEFT,
            fontsize=16,
            left=0,
            state=uiconst.UI_NORMAL)
        self.sr.sourcePinSubGauge = uicls.Gauge(
            parent=self.sr.sourcePinHeader,
            value=0.0,
            color=planetCommon.PLANET_COLOR_STORAGE,
            label=localization.GetByLabel('UI/PI/Common/Capacity'),
            left=0,
            top=24,
            state=uiconst.UI_NORMAL)
        self.sr.sourcePinListScroll = uicls.Scroll(
            parent=self.sr.sourcePinList, name='pinList')
        content = self.sr.sourcePinListScroll.sr.content
        content.OnDropData = self.OnSourceScrollDropData
        self.sr.transferHeaderText = uicls.Label(
            text=localization.GetByLabel('UI/PI/Common/ToBeTransferred'),
            parent=self.sr.transferHeader,
            align=uiconst.TOPLEFT,
            fontsize=16,
            left=0,
            state=uiconst.UI_NORMAL)
        self.sr.transferListScroll = uicls.Scroll(parent=self.sr.transferList,
                                                  name='transferList')
        content = self.sr.transferListScroll.sr.content
        content.OnDropData = self.OnTransferScrollDropData
        self.sr.destPinText = uicls.Label(text='',
                                          parent=self.sr.destPinHeader,
                                          align=uiconst.TOTOP,
                                          fontsize=16,
                                          state=uiconst.UI_NORMAL,
                                          maxLines=1)
        self.sr.destPinSubText = uicls.EveLabelLarge(
            text='',
            parent=self.sr.destPinHeader,
            align=uiconst.TOTOP,
            top=5,
            state=uiconst.UI_HIDDEN)
        self.sr.destPinSubGauge = uicls.Gauge(
            parent=self.sr.destPinHeader,
            value=0.0,
            color=planetCommon.PLANET_COLOR_STORAGE,
            label=localization.GetByLabel('UI/PI/Common/Capacity'),
            left=0,
            top=24,
            state=uiconst.UI_HIDDEN)
        self.sr.destPinListScroll = uicls.Scroll(parent=self.sr.destPinList)