예제 #1
0
파일: slider.py 프로젝트: connoryang/1v1dec
 def DrawIncrement(self):
     if self.increments:
         l, t, w, h = self.parent.GetAbsolute()
         maxX = w - self.width
         uiprimitives.Line(parent=self.parent,
                           align=uiconst.RELATIVE,
                           height=2,
                           width=maxX - 1,
                           left=self.width / 2,
                           top=self.height + 2)
         i = 0
         for each in self.increments[1]:
             height = 5
             if i in (0, len(self.increments[1]) - 1):
                 height = 10
             uiprimitives.Line(parent=self.parent,
                               align=uiconst.RELATIVE,
                               height=height,
                               width=1,
                               left=int(each * maxX) + self.width / 2 - 1,
                               top=self.height - 6)
             i += 1
예제 #2
0
 def ApplyAttributes(self, attributes):
     uicontrols.ContainerAutoSize.ApplyAttributes(self, attributes)
     self.infoPanelsByTypeID = {}
     self.infoPanelButtonsByTypeID = {}
     self.isDraggingButton = False
     self.topCont = uiprimitives.Container(name='topCont', parent=self, align=uiconst.TOTOP, height=self.ICONSIZE, padding=(infoPanelConst.LEFTPAD,
      0,
      0,
      5))
     self.dropIndicatorLine = uiprimitives.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 = uicontrols.ContainerAutoSize(name='iconCont', parent=self.topCont, state=uiconst.UI_NORMAL, align=uiconst.TOLEFT)
     self.mainCont = uicontrols.ContainerAutoSize(name='mainCont', parent=self, align=uiconst.TOTOP)
     self.Reconstruct()
예제 #3
0
    def ApplyAttributes(self, attributes):
        uicontrols.Window.ApplyAttributes(self, attributes)
        self.SetTopparentHeight(0)
        self.SetMinSize([525, 400])
        self.ownerID = session.charid
        self.fitting = None
        self.wordFilter = None
        self.exportButton = None
        self.fittingSvc = sm.GetService('fittingSvc')
        if session.role & service.ROLEMASK_ELEVATEDPLAYER:
            try:
                self.fittingSpawner = sm.GetService('fittingspawner')
            except ServiceNotFound:
                self.fittingSpawner = None

        self.DrawLeftSide()
        divider = Divider(name='divider', align=uiconst.TOLEFT, width=const.defaultPadding, parent=self.sr.main, state=uiconst.UI_NORMAL)
        divider.Startup(self.sr.leftside, 'width', 'x', 256, 350)
        uiprimitives.Line(parent=divider, align=uiconst.TORIGHT, top=const.defaultPadding)
        uiprimitives.Line(parent=divider, align=uiconst.TOLEFT)
        self.DrawRightSide()
        self.HideRightPanel()
예제 #4
0
 def LoadPanels(self):
     bottomparent = uiprimitives.Container(name='bottomparent',
                                           parent=self.sr.main,
                                           align=uiconst.TOBOTTOM,
                                           height=25)
     uiprimitives.Line(parent=bottomparent, align=uiconst.TOTOP)
     self.sr.bottomparent = bottomparent
     panel = uiprimitives.Container(name='panel',
                                    parent=self.sr.main,
                                    left=const.defaultPadding,
                                    top=const.defaultPadding,
                                    width=const.defaultPadding,
                                    height=const.defaultPadding)
     self.sr.panel = panel
예제 #5
0
 def SetDoublePaneView(self, briefingHtml=None, objectiveHtml=None):
     if self.viewMode == 'DoublePaneView':
         if briefingHtml:
             self.LoadHTML(briefingHtml, 'briefingBrowser')
         if objectiveHtml:
             self.LoadHTML(objectiveHtml, 'objectiveBrowser')
         if self.buttonCache:
             uix.Flush(self.sr.rightPaneBottom)
             self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom)
         return
     if briefingHtml:
         self.SetHTML(briefingHtml, 'briefingBrowser')
     if objectiveHtml:
         self.SetHTML(objectiveHtml, 'objectiveBrowser')
     uix.Flush(self.sr.main)
     self.sr.leftPane = uiprimitives.Container(name='leftPane',
                                               parent=self.sr.main,
                                               align=uiconst.TOLEFT,
                                               height=self.paneHeight,
                                               width=self.paneWidth,
                                               left=0,
                                               top=0)
     uiprimitives.Container(name='bottomBorder',
                            parent=self.sr.leftPane,
                            align=uiconst.TOBOTTOM,
                            height=1)
     self.sr.rightPane = uiprimitives.Container(name='rightPane',
                                                parent=self.sr.main,
                                                align=uiconst.TOALL,
                                                pos=(0, 0, 0, 0))
     uiprimitives.Line(parent=self.sr.rightPane, align=uiconst.TOLEFT)
     self.sr.rightPaneBottom = FlowContainer(
         name='rightPaneBottom',
         parent=self.sr.rightPane,
         align=uiconst.TOBOTTOM,
         contentSpacing=uiconst.BUTTONGROUPMARGIN,
         centerContent=True,
         padding=(6, 0, 6, 6))
     self.sr.rightPaneTop = uiprimitives.Container(name='rightPaneTop',
                                                   parent=self.sr.rightPane,
                                                   align=uiconst.TOALL,
                                                   pos=(0, 0, 0, 0))
     self.SetMinSize([self.windowWidth, self.windowHeight])
     self.LockWidth(self.windowWidth)
     self.viewMode = 'DoublePaneView'
     if self.buttonCache:
         self._InsertButtons(self.buttonCache, self.sr.rightPaneBottom)
     self.InitializeBrowsers()
     for browserName in self.htmlCache:
         self.LoadHTML(self.htmlCache[browserName], browserName)
예제 #6
0
 def ApplyAttributes(self, attributes):
     Transform.ApplyAttributes(self, attributes)
     borderColor = attributes.get('borderColor',
                                  redeemColors.REDEEM_BUTTON_BORDER_COLOR)
     backgroundColor = attributes.get(
         'backgroundColor', redeemColors.REDEEM_BUTTON_BACKGROUND_COLOR)
     fillColor = attributes.get('fillColor',
                                redeemColors.REDEEM_BUTTON_FILL_COLOR)
     textColor = attributes.get('textColor', redeemColors.TEXT_COLOR)
     uiprimitives.Line(parent=self,
                       color=borderColor,
                       align=uiconst.TOTOP,
                       weight=1)
     uiprimitives.Fill(bgParent=self, color=backgroundColor)
     borderFillColor = fillColor[:3]
     self.borderFill = uicontrols.GradientSprite(bgParent=self,
                                                 rgbData=[
                                                     (0, borderFillColor),
                                                     (0.5, borderFillColor),
                                                     (1.0, borderFillColor)
                                                 ],
                                                 alphaData=[(0.3, 0.1),
                                                            (0.5, 0.4),
                                                            (0.7, 0.1)],
                                                 idx=0,
                                                 state=uiconst.UI_DISABLED)
     self.OnClick = attributes.get('OnClick', self.DefaultOnClick)
     self.captionCont = Container(parent=self,
                                  name='captionCont',
                                  align=uiconst.CENTERTOP)
     self.expanderIcon = uiprimitives.Sprite(
         parent=self.captionCont,
         texturePath='res:/UI/Texture/Icons/105_32_5.png',
         align=uiconst.CENTERRIGHT,
         pos=(0, 0, 32, 32),
         state=uiconst.UI_DISABLED,
         color=textColor)
     self.availableLabel = uicontrols.EveCaptionMedium(
         parent=self.captionCont,
         align=uiconst.CENTERLEFT,
         text=localization.GetByLabel('UI/RedeemWindow/RedeemableItems'),
         state=uiconst.UI_DISABLED,
         color=textColor,
         bold=False)
     self.availableLabel.letterspace = 1
     self.captionCont.width = self.availableLabel.textwidth + 10 + self.expanderIcon.width
     self.captionCont.height = max(self.availableLabel.textheight + 10,
                                   self.expanderIcon.height)
     self.height = self.captionCont.height
 def ConstructLayout(self):
     if eve.session.corprole & const.corpRoleDirector > 0:
         self.SetHeaderIcon()
         hicon = self.sr.headerIcon
         hicon.GetMenu = self.OpenMenu
         hicon.expandOnLeft = 1
         hicon.hint = localization.GetByLabel('UI/InfrastructureHub/HubSettings')
         hicon.name = 'ihHeaderIcon'
         self.sr.presetMenu = hicon
     self.sr.upgradesTab = uiprimitives.Container(name='upgradesTab', parent=self.sr.main, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(0, 0, 0, 0))
     self.sr.index = uiprimitives.Container(name='hubs', parent=self.sr.upgradesTab, align=uiconst.TOLEFT, pos=(0, 0, 155, 0), padding=(0, 0, 2, 0))
     self.sr.index.state = uiconst.UI_NORMAL
     self.sr.upgrades = uiprimitives.Container(name='upgrades', parent=self.sr.upgradesTab, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(0, 0, 0, 0))
     self.sr.upgrades.state = uiconst.UI_NORMAL
     uiprimitives.Line(parent=self.sr.upgrades, align=uiconst.TOLEFT)
     uiprimitives.Line(parent=self.sr.index, align=uiconst.TORIGHT)
     self.sr.infoContainer = uiprimitives.Container(name='infoContainer', parent=self.sr.upgrades, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 90), padding=(0, 5, 0, 0))
     self.sr.upgradesContainer = uiprimitives.Container(name='upgradesContainer', parent=self.sr.upgrades, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(0, 0, 0, 0))
     self.sr.hubs = uiprimitives.Container(name='hubs', parent=self.sr.index, align=uiconst.TOALL, pos=(0, 0, 0, 0), padding=(0, 0, 0, 0))
     self.DrawUpgrades()
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Strategic'), const.attributeDevIndexSovereignty)
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Military'), const.attributeDevIndexMilitary)
     self.DrawIndex(localization.GetByLabel('UI/Sovereignty/Industry'), const.attributeDevIndexIndustrial)
     self.DrawInfo()
예제 #8
0
 def ApplyAttributes(self, attributes):
     uicls.LayerCore.ApplyAttributes(self, attributes)
     self.locked = 0
     self.sr.tcursor = None
     self.hoverbracket = None
     self.sr.spacemenu = None
     self.marqueeCont = None
     self.locks = {}
     self.cameraController = None
     self.positionalControl = positionalControl.PositionalControl()
     self.sr.tcursor = uiprimitives.Container(name='targetingcursor',
                                              parent=self,
                                              align=uiconst.ABSOLUTE,
                                              width=1,
                                              height=1,
                                              state=uiconst.UI_HIDDEN)
     uiprimitives.Line(parent=self.sr.tcursor,
                       align=uiconst.RELATIVE,
                       left=10,
                       width=3000,
                       height=1)
     uiprimitives.Line(parent=self.sr.tcursor,
                       align=uiconst.TOPRIGHT,
                       left=10,
                       width=3000,
                       height=1)
     uiprimitives.Line(parent=self.sr.tcursor,
                       align=uiconst.RELATIVE,
                       top=10,
                       width=1,
                       height=3000)
     uiprimitives.Line(parent=self.sr.tcursor,
                       align=uiconst.BOTTOMLEFT,
                       top=10,
                       width=1,
                       height=3000)
예제 #9
0
 def Startup(self, *etc):
     self.sr.label = uicontrols.EveLabelMedium(text='',
                                               parent=self,
                                               left=5,
                                               state=uiconst.UI_DISABLED,
                                               color=None,
                                               maxLines=1,
                                               align=uiconst.CENTERLEFT)
     self.sr.line = uiprimitives.Container(name='lineparent',
                                           align=uiconst.TOBOTTOM,
                                           parent=self,
                                           height=1)
     uiprimitives.Line(parent=self.sr.line,
                       align=uiconst.TOALL,
                       color=uiconst.ENTRY_LINE_COLOR)
예제 #10
0
 def Startup(self, *etc):
     uiprimitives.Line(parent=self,
                       align=uiconst.TOBOTTOM,
                       color=uiconst.ENTRY_LINE_COLOR)
     self.icon = uicontrols.Icon(parent=self,
                                 top=TOPMARGIN,
                                 size=32,
                                 ignoreSize=True,
                                 left=4)
     self.header = uicontrols.EveLabelLarge(parent=self,
                                            left=50,
                                            top=TOPMARGIN,
                                            state=uiconst.UI_NORMAL)
     self.text = uicontrols.EveLabelMedium(parent=self,
                                           left=50,
                                           state=uiconst.UI_NORMAL)
예제 #11
0
    def Startup(self, *args):
        uiprimitives.Line(align=uiconst.TOBOTTOM,
                          parent=self,
                          color=uiconst.ENTRY_LINE_COLOR)
        turretTopContainer = Container(parent=self,
                                       align=uiconst.TOLEFT_PROP,
                                       width=0.5,
                                       state=uiconst.UI_NORMAL)
        turretTopContainer.LoadTooltipPanel = self.LoadTooltipPanelForTurret
        uiprimitives.Sprite(name='turretHardpointsIcon',
                            texturePath='res:/UI/Texture/Icons/26_64_1.png',
                            parent=turretTopContainer,
                            align=uiconst.TOPLEFT,
                            pos=(1, 2, 24, 24),
                            ignoreSize=True,
                            state=uiconst.UI_DISABLED)
        self.sr.turretBubbles = []
        for i in range(8):
            x = i * 14 + 26
            bubble = uiprimitives.Sprite(parent=turretTopContainer,
                                         pos=(x, 7, 14, 16),
                                         useSizeFromTexture=True,
                                         align=uiconst.TOPLEFT,
                                         state=uiconst.UI_DISABLED)
            self.sr.turretBubbles.append(bubble)

        launcherTopContainer = Container(parent=self,
                                         align=uiconst.TOLEFT_PROP,
                                         width=0.5,
                                         state=uiconst.UI_NORMAL)
        launcherTopContainer.LoadTooltipPanel = self.LoadTooltipPanelForLauncher
        uiprimitives.Sprite(name='launcherHardpointsIcon',
                            texturePath='res:/UI/Texture/Icons/81_64_16.png',
                            parent=launcherTopContainer,
                            align=uiconst.TOPRIGHT,
                            pos=(1, 2, 24, 24),
                            ignoreSize=True,
                            state=uiconst.UI_DISABLED)
        self.sr.launcherBubbles = []
        for i in range(8):
            x = i * 14 + 26
            bubble = uiprimitives.Sprite(parent=launcherTopContainer,
                                         pos=(x, 7, 14, 16),
                                         useSizeFromTexture=True,
                                         align=uiconst.TOPRIGHT,
                                         state=uiconst.UI_DISABLED)
            self.sr.launcherBubbles.append(bubble)
 def Startup(self, *etc):
     uiprimitives.Line(parent=self,
                       align=uiconst.TOBOTTOM,
                       color=uiconst.ENTRY_LINE_COLOR)
     self.sr.label = uicontrols.EveLabelMedium(text='',
                                               parent=self,
                                               left=6,
                                               align=uiconst.CENTERLEFT,
                                               state=uiconst.UI_DISABLED,
                                               idx=0,
                                               maxLines=1)
     self.sr.icon = uicontrols.Icon(
         icon='res:/ui/Texture/WindowIcons/personallocations.png',
         parent=self,
         pos=(4, 1, 16, 16),
         align=uiconst.RELATIVE,
         ignoreSize=True)
예제 #13
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     value = attributes.Get('value')
     text = attributes.Get('text', '%s' % value)
     l, t, w, h = self.parent.GetAbsolute()
     self.top = int(h * value)
     LabelText(parent=self,
               text=text,
               align=uiconst.BOTTOMRIGHT,
               top=-5,
               left=5)
     uiprimitives.Line(parent=self,
                       color=COLOR_FRAME,
                       align=uiconst.BOTTOMRIGHT,
                       width=4,
                       height=1,
                       top=-1)
예제 #14
0
    def Reload(self):
        if self.destroyed:
            return
        self.local.DisableAutoSize()
        self.local.Flush()
        self.remote.Flush()
        self.homeStationID = self.medicalController.GetHomeStation()
        stations, remoteStationDate = self.medicalController.GetPotentialHomeStations(
        )
        hasRemote = bool(len([s for s in stations if s.isRemote]))
        showRemoteStations = self.medicalController.ShowRemoteStations()
        if showRemoteStations and hasRemote:
            self.remoteTitle.display = True
            self.remoteText.display = True
            self.remoteTimer.display = True
            if remoteStationDate and remoteStationDate > blue.os.GetWallclockTime(
            ):
                self.remote.state = uiconst.UI_DISABLED
                self.remote.opacity = 0.2
                self.remoteTimer.text = localization.GetByLabel(
                    'UI/Medical/Clone/NextRemoteChangeDate',
                    nextDate=remoteStationDate)
            else:
                self.remote.state = uiconst.UI_PICKCHILDREN
                self.remote.opacity = 1.0
                self.remoteTimer.text = localization.GetByLabel(
                    'UI/Medical/Clone/NextRemoteChangeNow')
        else:
            self.remoteTitle.display = False
            self.remoteText.display = False
            self.remote.state = uiconst.UI_HIDDEN
            self.remoteTimer.display = False
        uiprimitives.Line(parent=self.remote,
                          align=uiconst.TOTOP,
                          color=self.LINE_COLOR)
        for station in stations:
            if not showRemoteStations and station.isRemote:
                continue
            self.AddStation(station.stationID, station.isRemote)

        if session.structureid is not None and not IsWormholeRegion(
                session.regionid):
            self.AddStructure(session.structureid)
        self.remote.height = min(self.remote.mainCont.height + 45, 305)
        self.local.EnableAutoSize()
예제 #15
0
    def ApplyAttributes(self, attributes):
        uicontrols.Window.ApplyAttributes(self, attributes)
        self.itemID = attributes.Get('itemID')
        lpPool = sm.GetService('facwar').GetSolarSystemLPs()
        topCont = uiprimitives.Container(name='topCont', parent=self.sr.main, align=uiconst.TOTOP, height=40, padding=(self.PADSIDE,
         self.PADTOP,
         self.PADSIDE,
         self.PADSIDE))
        mainCont = uicontrols.ContainerAutoSize(name='mainCont', parent=self.sr.main, align=uiconst.TOTOP)
        bottomCont = uiprimitives.Container(name='bottomCont', parent=self.sr.main, align=uiconst.TOBOTTOM, height=100, padTop=self.PADTOP)
        uicontrols.EveLabelLarge(parent=topCont, text=localization.GetByLabel('UI/FactionWarfare/IHub/SystemUpgradePanel', systemName=cfg.evelocations.Get(session.solarsystemid2).name), align=uiconst.TOPLEFT, top=5)
        uicontrols.EveLabelLarge(parent=topCont, text=localization.GetByLabel('UI/FactionWarfare/IHub/TotalLP'), align=uiconst.TOPRIGHT, top=5)
        self.lpPoolLabel = uicontrols.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 = uicontrols.GradientSprite(bgParent=bottomCont, rotation=-pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.3), (0.9, 0.0)])
        self.bottomFlashEffect = uicontrols.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)
        uiprimitives.Line(parent=bottomCont, align=uiconst.TOTOP, color=(0.3, 0.3, 0.3, 0.3))
        bottomMainCont = uiprimitives.Container(name='bottomMainCont', parent=bottomCont, align=uiconst.CENTER, width=450, height=100)
        self.myLPLabel = uicontrols.Label(parent=bottomMainCont, text=self.GetLPOwnedLabel(), align=uiconst.TOPLEFT, left=self.PADSIDE, top=self.PADTOP)
        self.bottomBottomCont = uiprimitives.Container(name='bottomBottom', align=uiconst.TOPLEFT, pos=(self.PADSIDE,
         40,
         450,
         25), parent=bottomMainCont)
        self.donateAmountEdit = uicontrols.SinglelineEdit(parent=self.bottomBottomCont, name='donateAmountEdit', align=uiconst.TOLEFT, setvalue=0, width=155, OnReturn=self.OnDonateLPBtn, OnChange=self.OnDonateValueChanged)
        self.donateBtn = uicontrols.Button(parent=self.bottomBottomCont, align=uiconst.TOLEFT, func=self.OnDonateLPBtn, label=localization.GetByLabel('UI/FactionWarfare/IHub/DonateLPs'), padLeft=4)
        self.donationReceivedLabel = uicontrols.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 = uiprimitives.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 = uicontrols.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)
예제 #16
0
    def ApplyAttributes(self, attributes):
        uiprimitives.Container.ApplyAttributes(self, attributes)
        self.minSec = attributes.minSec
        self.maxSec = attributes.maxSec
        self.secRange = self.maxSec - self.minSec
        self.typeID = attributes.typeID
        self.numSecSections = int(self.secRange / 0.5)
        sectionWidth = self.width / self.numSecSections
        uiprimitives.Line(parent=self,
                          align=uiconst.TORIGHT,
                          color=(0, 0, 0, 0.5))
        icon = uicontrols.Icon(parent=self,
                               typeID=self.typeID,
                               size=48,
                               align=uiconst.CENTER,
                               ignoreSize=True,
                               OnClick=self.OnIconClick,
                               state=uiconst.UI_NORMAL)
        icon.GetMenu = lambda: sm.GetService('menu').GetMenuFormItemIDTypeID(
            None, self.typeID, ignoreMarketDetails=False)
        secMeter = uiprimitives.Container(parent=self,
                                          align=uiconst.TOTOP,
                                          height=SEC_METER_HEIGHT)
        for n in xrange(self.numSecSections):
            sec = self.minSec + n * const.securityGainPerTag
            for data in SEC_BAND_DATA:
                if sec < data.maxSec:
                    break

            if data.altColor is not None and n % 2 == 1:
                color = data.altColor
            else:
                color = data.color
            uiprimitives.Fill(parent=secMeter,
                              align=uiconst.TOLEFT,
                              width=sectionWidth,
                              color=color.GetRGBA(),
                              hint=localization.GetByLabel(data.pveHintLable) +
                              '<br>' +
                              localization.GetByLabel(data.pvpHintLabel),
                              state=uiconst.UI_NORMAL)

        self.quantitySpentText = uicontrols.EveLabelSmallBold(
            parent=self, align=uiconst.CENTER, top=30, color=(1, 1, 1, 1))
        self.SetQuantity(0)
예제 #17
0
 def ApplyAttributes(self, attributes):
     super(uicls.AIDebugWindow, self).ApplyAttributes(attributes)
     self.SetMinSize([self.default_width, self.default_height])
     self.SetCaption('AI Debug Window')
     self.sr.content.padding = 5
     self.perceptionClient = sm.GetService('perceptionClient')
     self.aimingClient = sm.GetService('aimingClient')
     clientContainer = uiprimitives.Container(parent=self.sr.content, align=uiconst.TOLEFT_PROP, width=0.5)
     uiprimitives.Line(parent=clientContainer, align=uiconst.TORIGHT)
     uicontrols.Label(parent=clientContainer, align=uiconst.TOTOP, text='----- CLIENT -----', pos=(0, 0, 0, 0), padding=(5, 5, 5, 5))
     uicontrols.Checkbox(parent=clientContainer, text='Perception', checked=self.perceptionClient.GetPerceptionManager(session.worldspaceid).IsDebugRendering(), callback=self.OnTogglePerception)
     uicontrols.Checkbox(parent=clientContainer, text='Aiming', checked=self.aimingClient.GetAimingManager(session.worldspaceid).IsDebugRendering(), callback=self.OnToggleAiming)
     uicontrols.Button(parent=clientContainer, align=uiconst.CENTERBOTTOM, label='Gaze at Nearest', func=self.GazeNearest, top=6)
     serverContainer = uiprimitives.Container(parent=self.sr.content, align=uiconst.TORIGHT_PROP, width=0.5)
     uicontrols.Label(parent=serverContainer, align=uiconst.TOTOP, text='----- SERVER -----', padding=(5, 5, 5, 5))
     uicontrols.Checkbox(parent=serverContainer, text='Perception', checked=self.perceptionClient.GetPerceptionManager(session.worldspaceid).IsDebugRenderingServer(), callback=self.OnTogglePerceptionServer)
     uicontrols.Checkbox(parent=serverContainer, text='Aiming', checked=self.aimingClient.GetAimingManager(session.worldspaceid).IsDebugRenderingServer(), callback=self.OnToggleAimingServer)
     uicontrols.Button(parent=serverContainer, align=uiconst.CENTERBOTTOM, label='Gaze at Nearest', func=self.GazeNearestServer, top=6)
예제 #18
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     l, t, w, h = self.GetAbsolute()
     self.influence = attributes.get('influence', 0.0)
     self.targetInfluence = self.influence
     self.blueBar = uiprimitives.Container(parent=self, name='blueBar', align=uiconst.TOLEFT_PROP, width=0, clipChildren=True)
     uiprimitives.Fill(name='blueBase', parent=self.blueBar, color=(0, 0, 1, 0.25))
     self.blueArrows = uicls.BarFill(name='blueFill', pos=(0,
      0,
      w,
      h), parent=self.blueBar, color=(0, 0, 1, 0.75))
     self.knob = uiprimitives.Line(parent=self, name='sliderKnob', color=self.FRAME_COLOR, align=uiconst.TOLEFT)
     self.redBar = uiprimitives.Container(parent=self, name='redBar', align=uiconst.TOALL, clipChildren=True)
     uiprimitives.Fill(name='redBase', parent=self.redBar, color=(1, 0, 0, 0.25))
     self.redArrows = uicls.BarFill(pos=(0,
      0,
      w,
      h), name='redFill', parent=self.redBar, color=(1, 0, 0, 0.75))
예제 #19
0
 def ConstructLayout(self):
     self.sr.label = uicontrols.EveLabelMedium(parent=self,
                                               state=uiconst.UI_DISABLED,
                                               align=uiconst.CENTERLEFT,
                                               idx=3,
                                               lineSpacing=-0.2,
                                               maxLines=1)
     container = uiprimitives.Container(parent=self,
                                        pos=(21, 20, 16, 16),
                                        name='container',
                                        state=uiconst.UI_PICKCHILDREN,
                                        align=uiconst.RELATIVE)
     self.iconCont = uiprimitives.Container(parent=self,
                                            pos=(5, 0, 32, 32),
                                            align=uiconst.CENTERLEFT)
     uiprimitives.Line(parent=self,
                       align=uiconst.TOBOTTOM,
                       idx=1,
                       color=uiconst.ENTRY_LINE_COLOR)
예제 #20
0
    def Reload(self):
        """
        Refetch data and update the state of the window.
        """
        if self.destroyed:
            return
        self.local.DisableAutoSize()
        self.local.Flush()
        self.remote.Flush()
        self.homeStationID = sm.RemoteSvc('charMgr').GetHomeStation()
        stations, remoteStationDate = sm.GetService(
            'corp').GetCorpStationManager().GetPotentialHomeStations()
        hasRemote = bool(len([s for s in stations if s.isRemote]))
        if hasRemote:
            self.remoteTitle.state = uiconst.UI_DISABLED
            self.remoteText.state = uiconst.UI_DISABLED
            self.remoteTimer.state = uiconst.UI_DISABLED
            if remoteStationDate and remoteStationDate > blue.os.GetWallclockTime(
            ):
                self.remote.state = uiconst.UI_DISABLED
                self.remote.opacity = 0.2
                self.remoteTimer.text = localization.GetByLabel(
                    'UI/Medical/Clone/NextRemoteChangeDate',
                    nextDate=remoteStationDate)
            else:
                self.remote.state = uiconst.UI_PICKCHILDREN
                self.remote.opacity = 1.0
                self.remoteTimer.text = localization.GetByLabel(
                    'UI/Medical/Clone/NextRemoteChangeNow')
        else:
            self.remoteTitle.state = uiconst.UI_HIDDEN
            self.remoteText.state = uiconst.UI_HIDDEN
            self.remote.state = uiconst.UI_HIDDEN
            self.remoteTimer.state = uiconst.UI_HIDDEN
        uiprimitives.Line(parent=self.remote,
                          align=uiconst.TOTOP,
                          color=self.LINE_COLOR)
        for station in stations:
            self.AddStation(station.stationID, station.typeID,
                            station.serviceMask, station.isRemote)

        self.remote.height = min(self.remote.mainCont.height + 45, 305)
        self.local.EnableAutoSize()
예제 #21
0
 def InitBroadcastBottom(self):
     self.sr.broadcastBottom = uiprimitives.Container(name='broadcastBottom', parent=self.sr.main, align=uiconst.TOBOTTOM, height=BROADCAST_HEIGHT, state=uiconst.UI_HIDDEN)
     broadcastHeaderParent = uiprimitives.Container(name='lastbroadcastheader', parent=self.sr.main, align=uiconst.TOBOTTOM, state=uiconst.UI_NORMAL, height=24)
     broadcastHeaderParent.padBottom = 3
     expanderCont = uiprimitives.Container(name='expanderCont', parent=broadcastHeaderParent, align=uiconst.TORIGHT, state=uiconst.UI_NORMAL, width=18)
     expanderCont.OnClick = self.ToggleBroadcasts
     broadcastHeaderParent.height = uix.GetTextHeight('Xg')
     self.sr.broadcastHeaderParent = broadcastHeaderParent
     expander = uiprimitives.Sprite(parent=expanderCont, pos=(5, 0, 11, 11), name='expandericon', state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/Shared/expanderUp.png', align=uiconst.TOPRIGHT)
     self.sr.broadcastExpanderIcon = expander
     uix.Flush(self.sr.broadcastBottom)
     self.sr.lastBroadcastCont = uiprimitives.Container(name='lastBroadcastCont', parent=broadcastHeaderParent, align=uiconst.TOALL, pos=(0, 0, 0, 0), state=uiconst.UI_NORMAL)
     uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoBroadcasts'), parent=self.sr.lastBroadcastCont, left=6, top=1, width=500, state=uiconst.UI_NORMAL)
     self.sr.lastVoiceEventCont = uiprimitives.Container(name='lastVoiceEventCont', parent=self.sr.broadcastBottom, align=uiconst.TOTOP_PROP, top=0, left=0, height=1.0, width=1.0, state=uiconst.UI_PICKCHILDREN)
     uicontrols.EveLabelMedium(text=localization.GetByLabel('UI/Fleet/FleetBroadcast/NoVoiceBroadcasts'), parent=self.sr.lastVoiceEventCont, left=6, top=0, width=500)
     self.sr.actionsCont = uiprimitives.Container(name='actionsCont', parent=self.sr.broadcastBottom, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_NORMAL)
     self.sr.toggleCont = uiprimitives.Container(name='toggleCont', parent=self.sr.actionsCont, align=uiconst.TOBOTTOM, height=26, state=uiconst.UI_PICKCHILDREN)
     self.sr.line = uiprimitives.Container(name='lineparent', align=uiconst.TOTOP, parent=self.sr.actionsCont, idx=0, height=1)
     uiprimitives.Line(parent=self.sr.line, align=uiconst.TOALL)
     self.InitActions()
 def ApplyAttributes(self, attributes):
     uicontrols.Window.ApplyAttributes(self, attributes)
     transmission = attributes.transmission
     self.isDockWnd = 0
     caption = getattr(transmission, 'caption', None) or localization.GetByLabel('UI/Generic/Information')
     hasDungeonWarp = getattr(transmission, 'hasDungeonWarp', False)
     self.scope = 'inflight'
     self.sr.main = uiutil.GetChild(self, 'main')
     uiprimitives.Line(parent=self.sr.topParent, align=uiconst.TOBOTTOM)
     uiprimitives.Container(name='push', parent=self.sr.topParent, align=uiconst.TOLEFT, width=70)
     self.sr.header = uicontrols.EveCaptionMedium(text=' ', parent=self.sr.topParent, align=uiconst.TOTOP, padTop=8)
     self.sr.messageArea = uicls.EditPlainText(parent=self.sr.main, padding=const.defaultPadding, readonly=1)
     self.sr.messageArea.HideBackground()
     self.sr.messageArea.RemoveActiveFrame()
     self.NoSeeThrough()
     self.SetMinSize([360, 240], 1)
     self.SetCaption(caption)
     self.MakeUnResizeable()
     self.MakeUnKillable()
     self.SetTopparentHeight(58)
     if not hasDungeonWarp:
         self.DefineButtons(uiconst.OK, okLabel=localization.GetByLabel('UI/Generic/Close'), okFunc=self.Close)
     else:
         self.sr.instanceID = getattr(transmission.rec.rec, 'instanceID', 0)
         self.sr.solarSystemID = getattr(transmission.rec.rec, 'solarSystemID', 0)
         if self.sr.solarSystemID == eve.session.solarsystemid:
             okLabel = localization.GetByLabel('UI/Commands/WarpTo')
             okFunc = self.WarpToEPLocation
         else:
             inFleet = bool(eve.session.fleetid)
             isLeader = sm.GetService('menu').ImFleetLeaderOrCommander()
             if inFleet and isLeader:
                 okLabel = localization.GetByLabel('UI/Fleet/FleetBroadcast/Commands/BroadcastTravelTo')
                 okFunc = self.SetFleetDestination
             else:
                 okLabel = localization.GetByLabel('UI/Inflight/SetDestination')
                 okFunc = self.SetDestination
         if self.sr.instanceID and self.sr.solarSystemID:
             self.DefineButtons(uiconst.OKCANCEL, okLabel=okLabel, okFunc=okFunc, cancelLabel=localization.GetByLabel('UI/Generic/Close'), cancelFunc=self.Close)
         else:
             self.DefineButtons(uiconst.OK, okLabel=localization.GetByLabel('UI/Generic/Close'), okFunc=self.Close)
예제 #23
0
 def ConstructSpriteEffectColumn(self):
     spriteEffectCont = uiprimitives.Container(parent=self.bottomCont,
                                               align=uiconst.TOLEFT,
                                               width=self.COLUMN_WIDTH)
     uiprimitives.Line(parent=spriteEffectCont, align=uiconst.TORIGHT)
     uicontrols.Label(parent=spriteEffectCont,
                      text='spriteEffect',
                      align=uiconst.TOTOP)
     for constName in dir(trinity):
         if not constName.startswith('TR2_SFX_'):
             continue
         constVal = getattr(trinity, constName)
         uicontrols.Checkbox(
             parent=spriteEffectCont,
             text=constName,
             align=uiconst.TOTOP,
             configName='spriteEffectGroup',
             groupname='spriteEffectGroup',
             checked=constVal == uiprimitives.Sprite.default_spriteEffect,
             callback=self.OnSpriteEffectRadioChanged,
             retval=constVal)
예제 #24
0
 def Startup(self, *etc):
     uiprimitives.Line(parent=self,
                       align=uiconst.TOBOTTOM,
                       color=uiconst.ENTRY_LINE_COLOR)
     self.sr.label = uicontrols.EveLabelMedium(text='',
                                               parent=self,
                                               left=6,
                                               align=uiconst.CENTERLEFT,
                                               state=uiconst.UI_DISABLED,
                                               idx=0,
                                               maxLines=1)
     self.icon = uiprimitives.Container(name='icon',
                                        parent=self,
                                        align=uiconst.TOPLEFT,
                                        padding=(0, 0, 0, 0),
                                        pos=(0, 0, 14, 14),
                                        state=uiconst.UI_DISABLED)
     self.sr.loss = uiprimitives.Fill(parent=self,
                                      padTop=1,
                                      padBottom=1,
                                      color=(1.0, 0.0, 0.0, 0.25))
예제 #25
0
 def _ConstructBackground(self):
     self.bgGradient = uicontrols.GradientSprite(bgParent=self,
                                                 rgbData=((0, (1.0, 1.0,
                                                               1.0)), ),
                                                 alphaData=((0.0, 0.0),
                                                            (1.0, 0.07)))
     self.blurredUnderlay = BlurredSceneUnderlay(bgParent=self,
                                                 isPinned=True,
                                                 isInFocus=True)
     if self.align == uiconst.TOLEFT:
         align = uiconst.TORIGHT
     else:
         align = uiconst.TOLEFT
     self.resizeLine = uiprimitives.Line(parent=self.resizeLineCont,
                                         color=(0, 0, 0, 0),
                                         align=align,
                                         weight=3,
                                         state=uiconst.UI_NORMAL)
     self.resizeLine.OnMouseDown = self.OnReisizeLineMouseDown
     self.resizeLine.OnMouseEnter = self.OnResizeLineMouseEnter
     self.SetResizeLineCursor()
예제 #26
0
 def SetupService(self, wnd, servicename):
     uix.Flush(wnd.sr.svcparent)
     svc = None
     topheight = 128
     btmheight = 0
     icon = 'ui_9_64_14'
     sz = 128
     top = -16
     icon = uicontrols.Icon(icon=icon,
                            parent=wnd.sr.svcparent,
                            left=0,
                            top=top,
                            size=sz,
                            idx=0)
     iconpar = uiprimitives.Container(name='iconpar',
                                      parent=wnd.sr.svcparent,
                                      align=uiconst.TOTOP,
                                      height=96,
                                      clipChildren=1,
                                      state=uiconst.UI_PICKCHILDREN)
     bigicon = icon.CopyTo()
     bigicon.width = bigicon.height = sz * 2
     bigicon.top = -64
     bigicon.color.a = 0.1
     iconpar.children.append(bigicon)
     closeX = uicontrols.Icon(icon='ui_38_16_220')
     closeX.align = uiconst.TOPRIGHT
     closeX.left = closeX.top = 2
     closeX.OnClick = self.CloseSvc
     iconpar.children.append(closeX)
     line = uiprimitives.Line(parent=iconpar,
                              align=uiconst.TOPRIGHT,
                              height=1,
                              left=2,
                              top=16,
                              width=18)
     icon.state = uiconst.UI_DISABLED
     wnd.sr.caption.text = self.GetServiceDisplayName(servicename)
     wnd.sr.caption.state = uiconst.UI_DISABLED
     return (svc, 'service')
예제 #27
0
 def AddLayout(self):
     pad = const.defaultPadding
     uicontrols.WndCaptionLabel(text=cfg.invgroups.Get(
         cfg.invtypes.Get(self.typeID).groupID).groupName,
                                subcaption=localization.GetByLabel(
                                    'UI/UpgradeWindow/TypeUpgradesTo',
                                    type1=self.typeID,
                                    type2=self.GetUpgradeTypeID()),
                                parent=self.sr.topParent,
                                align=uiconst.RELATIVE)
     uicontrols.Icon(parent=self.sr.topParent,
                     align=uiconst.TOPLEFT,
                     state=uiconst.UI_DISABLED,
                     pos=(0, 0, 64, 64),
                     padding=(pad, pad, pad, pad),
                     typeID=self.typeID)
     self.sr.footer = uiprimitives.Container(name='footer',
                                             parent=self.sr.main,
                                             align=uiconst.TOBOTTOM,
                                             pos=(0, 0, 0, 25),
                                             padding=(pad, pad, pad, pad))
     uiprimitives.Line(align=uiconst.TOBOTTOM, parent=self.sr.main)
     self.sr.iconContainer = uiprimitives.Container(name='iconContainer',
                                                    parent=self.sr.main,
                                                    align=uiconst.TOALL,
                                                    padding=(pad + 5,
                                                             pad + 5, 0, 0),
                                                    columns=4)
     self.sr.iconContainer.OnDropData = self.OnDropData
     self.sr.iconContainer.OnDragEnter = self.OnDragEnter
     self.sr.iconContainer.OnDragExit = self.OnDragExit
     btns = [(localization.GetByLabel('UI/UpgradeWindow/StartUpgrade'),
              self.InitiateUpgrade, (), None)]
     self.buttons = btns = uicontrols.ButtonGroup(btns=btns,
                                                  parent=self.sr.footer,
                                                  line=0)
     self.transferBtn = btns.GetBtnByIdx(0)
예제 #28
0
파일: neocom.py 프로젝트: connoryang/1v1dec
 def _ConstructBaseLayout(self):
     self.charCont = uicontrols.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.resourceLoadingIndicator = ResourceLoadingIndicator(
         parent=self.mainCont,
         name='resourceLoadingContainer',
         align=uiconst.TOBOTTOM,
         height=30)
     Fill(bgParent=self.resourceLoadingIndicator, color=(0, 0, 0, 0.2))
     self.fixedButtonCont = uicontrols.ContainerAutoSize(
         parent=self.mainCont,
         name='fixedButtonCont',
         align=uiconst.TOBOTTOM)
     uiprimitives.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 = uiprimitives.Container(parent=self.mainCont,
                                              name='buttonCont',
                                              align=uiconst.TOALL)
     self.buttonCont._OnSizeChange_NoBlock = self.OnButtonContainerSizeChanged
     self.dropIndicatorLine = uiprimitives.Line(
         parent=self.mainCont,
         name='dropIndicatorLine',
         align=uiconst.TOPLEFT,
         color=util.Color.GetGrayRGBA(0.7, 0.3),
         pos=(0, 0, 0, 1))
예제 #29
0
 def ApplyAttributes(self, attributes):
     uicontrols.SE_BaseClassCore.ApplyAttributes(self, attributes)
     self.sr.line = uiprimitives.Line(parent=self,
                                      align=uiconst.TOBOTTOM,
                                      color=uiconst.ENTRY_LINE_COLOR)
     self.sr.contractParent = uiprimitives.Container(
         parent=self,
         name='contractParent',
         align=uiconst.TOLEFT,
         state=uiconst.UI_PICKCHILDREN,
         padTop=2)
     self.sr.contractIconParent = uiprimitives.Container(
         parent=self.sr.contractParent,
         name='contractIconParent',
         align=uiconst.TOLEFT,
         width=self.iconSize + 5)
     self.sr.techIcon = uicontrols.Icon(parent=self.sr.contractIconParent,
                                        pos=(2, 2, 16, 16),
                                        align=uiconst.TOPLEFT,
                                        state=uiconst.UI_NORMAL)
     self.sr.icon = uicontrols.Icon(parent=self.sr.contractIconParent,
                                    pos=(2, 2, 32, 32),
                                    ignoreSize=True,
                                    align=uiconst.TOPLEFT,
                                    state=uiconst.UI_DISABLED)
     subPar = uiprimitives.Container(parent=self.sr.contractParent,
                                     name='contractLabelClipper',
                                     state=uiconst.UI_DISABLED,
                                     align=uiconst.TOALL,
                                     clipChildren=True,
                                     padLeft=2)
     self.sr.contractLabel = uicontrols.EveLabelMedium(
         parent=subPar,
         left=self.labelMargin,
         align=uiconst.TOTOP,
         padRight=const.defaultPadding)
예제 #30
0
    def ShowHint(self, hint, pointer=0, textMaxWidth=200):
        self.content.Flush()
        if type(hint) != types.ListType:
            hint = [hint]
        maxWidth = 0
        for entryData in hint:
            if entryData in ('<line>', '<dotline>'):
                uiprimitives.Line(parent=self.content,
                                  align=uiconst.TOTOP,
                                  height=1)
                continue
            entry = HintEntry(name='entryparent',
                              parent=self.content,
                              align=uiconst.TOTOP)
            entry.Startup(entryData, textMaxWidth)
            entry.OnMouseEnter = self.DecoEntryMouseEnter(
                entry, getattr(entry, 'OnMouseEnter', None))
            entry.OnMouseExit = self.DecoEntryMouseExit(
                entry, getattr(entry, 'OnMouseExit', None))

        self.width = max([each.width for each in self.content.children]) + 12
        self.height = sum([each.height for each in self.content.children]) + 8
        self.SetPointer(pointer)
        self.data = (hint, pointer)