Exemple #1
0
 def _AnimFlash(self, diff, duration, timeOffset):
     w, h = self.gaugeCont.GetAbsoluteSize()
     align = TOPLEFT if self.gauge.align == TOLEFT_PROP else TOPRIGHT
     if not self.flashGradient:
         self.flashGradient = uicontrols.GradientSprite(
             parent=self.gauge,
             idx=0,
             name='flashGradient',
             align=align,
             width=w,
             height=h,
             rgbData=[(0, (0.99, 1.0, 1.0))],
             alphaData=[(0, 0.0), (0.9, 0.5), (1.0, 0.0)])
     self.flashGradient.opacity = 1.0
     if diff > 0:
         self.flashGradient.rotation = 0
         uicore.animations.MorphScalar(self.flashGradient,
                                       'left',
                                       -w,
                                       w,
                                       duration - 0.4,
                                       timeOffset=timeOffset)
     else:
         self.flashGradient.rotation = pi
         uicore.animations.MorphScalar(self.flashGradient,
                                       'left',
                                       w,
                                       -w,
                                       duration - 0.4,
                                       timeOffset=timeOffset)
     uicore.animations.FadeOut(self.flashGradient,
                               duration=duration,
                               timeOffset=timeOffset)
Exemple #2
0
 def ConstructLayout(self):
     uicontrols.EveLabelLargeBold(
         name='caption',
         parent=self.sr.topParent,
         text=localization.GetByLabel('UI/SecurityOffice/HeaderCaption'),
         top=20,
         left=98)
     uicontrols.EveLabelSmall(
         name='subcaption',
         parent=self.sr.topParent,
         text=localization.GetByLabel(
             'UI/SecurityOffice/WindowSubheaderDescription'),
         top=40,
         left=98)
     self.securityTagBar = uicls.SecurityTagBar(parent=self.sr.main)
     bottomContainer = uiprimitives.Container(name='bottomContainer',
                                              parent=self.sr.main,
                                              align=uiconst.TOBOTTOM,
                                              height=40)
     self.iskCostText = uicontrols.EveLabelMediumBold(
         parent=bottomContainer, align=uiconst.CENTERLEFT, left=8)
     self.submitButton = uicontrols.Button(
         parent=bottomContainer,
         align=uiconst.CENTERRIGHT,
         left=8,
         label=localization.GetByLabel('UI/SecurityOffice/ExchangeTags'),
         func=self.Submit)
     self.CreateTextFeedback()
     uicontrols.GradientSprite(parent=bottomContainer,
                               align=uiconst.TOALL,
                               rotation=-math.pi / 2,
                               rgbData=[(0, (0.3, 0.3, 0.3))],
                               alphaData=[(0, 0.5), (0.9, 0.15)],
                               state=uiconst.UI_DISABLED)
Exemple #3
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.onSetValueCallback = None
     targetWidth = attributes.get('sliderWidth', 100)
     bitHeight = attributes.bitHeight or self.default_bitHeight
     self.height = bitHeight + 4
     self._value = 0.0
     self.sr.handle = uiprimitives.Container(parent=self, align=uiconst.RELATIVE, state=uiconst.UI_DISABLED, pos=(0,
      -2,
      3,
      self.height + 4), bgColor=ccConst.COLOR + (1.0,))
     if attributes.get('alphaValues'):
         alphaValues = attributes.get('alphaValues')
         rgbValues = [(0, (0, 0, 0))]
     else:
         alphaValues = (1, 1)
         rgbValues = [(0, (0, 0, 0)), (1.0, (1, 1, 1))]
     self.gradientSprite = uicontrols.GradientSprite(parent=self, pos=(0,
      0,
      targetWidth,
      self.height), rgbData=rgbValues, alphaData=[alphaValues, (1.0, 1.0)], alphaInterp=uicls.GradientConst.INTERP_LINEAR, colorInterp=uicls.GradientConst.INTERP_LINEAR, state=uiconst.UI_DISABLED)
     self.gradientSprite.width = targetWidth
     if attributes.setvalue is not None:
         self.SetValue(attributes.setvalue)
     self.onSetValueCallback = attributes.OnSetValue
     self.ChangeGradientColor(secondColor=(1.0, (1, 1, 0)))
Exemple #4
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)
 def _CreateBar(self, text):
     self.bar = Container(parent=self.topParent, align=uiconst.TOBOTTOM, height=self.barHeight, state=uiconst.UI_NORMAL)
     uicontrols.GradientSprite(bgParent=self.bar, rotation=-pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.5), (0.9, 0.15)])
     barLabelParent = Container(parent=self.bar, align=uiconst.CENTER, height=self.barHeight, width=300, state=uiconst.UI_DISABLED)
     self.isUpIcons = [uiprimitives.Sprite(parent=barLabelParent, align=uiconst.CENTERLEFT, pos=(-15, 0, 32, 32), name='statusIcon', state=uiconst.UI_NORMAL, texturePath='res:/UI/Texture/Icons/105_32_4.png', idx=0), uiprimitives.Sprite(parent=barLabelParent, align=uiconst.CENTERRIGHT, pos=(-15, 0, 32, 32), name='statusIcon', state=uiconst.UI_NORMAL, texturePath='res:/UI/Texture/Icons/105_32_4.png', idx=0)]
     self.barLabel = EveCaptionSmall(parent=barLabelParent, text=text, align=uiconst.CENTER)
     w = self.barLabel.width
     barLabelParent.left -= 25
     barLabelParent.width = w + 50
     self.bar.OnClick = self.ToggleBar
Exemple #6
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     sm.RegisterNotify(self)
     invCont = attributes.invCont
     self.secondaryVolume = 0.0
     self.additionalVolume = 0.0
     self.refreshGaugesThread = None
     self.resetPending = False
     self.capacityText = uicontrols.EveLabelSmall(name='capacityText', parent=self, align=uiconst.CENTER, top=1)
     self.bg = FillThemeColored(bgParent=self, colorType=uiconst.COLORTYPE_UIBASECONTRAST, opacity=0.5)
     uicontrols.Frame(parent=self, color=(0.5, 0.5, 0.5, 0.05))
     self.capacityGaugeParentSec = uiprimitives.Container(name='capacityGaugeParent', parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
     self.capacityGaugeSec = uicontrols.GradientSprite(parent=self.capacityGaugeParentSec, align=uiconst.TOLEFT_PROP, rotation=-pi / 2, rgbData=[(0, self.COLOR_SECONDARY)], alphaData=[(0, 0.7), (0.5, 1.0), (1.0, 0.7)])
     self.capacityGaugeParent = uiprimitives.Container(name='capacityGaugeParent', parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
     self.capacityGauge = uicontrols.GradientSprite(parent=self.capacityGaugeParent, align=uiconst.TOLEFT_PROP, rotation=-pi / 2, rgbData=[(0, self.COLOR_PRIMARY)], alphaData=[(0, 0.7), (0.5, 1.0), (1.0, 0.7)])
     self.capacityGaugeParentAdd = uiprimitives.Container(name='capacityGaugeParentAdd', parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
     self.capacityGaugeAdd = uicontrols.GradientSprite(parent=self.capacityGaugeParent, align=uiconst.TOLEFT_PROP, rotation=-pi / 2, rgbData=[(0, self.COLOR_SECONDARY)], alphaData=[(0, 0.7), (0.5, 1.0), (1.0, 0.7)])
     if invCont:
         self.SetInvCont(invCont)
     else:
         self.invCont = None
Exemple #7
0
 def _CreateGradient(self, parent, color):
     colBase = util.Color(*color).GetRGB()
     colBright = util.Color(*color)
     colBright = colBright.SetBrightness(
         min(1.0, self.gradientBrightnessFactor *
             colBright.GetBrightness())).GetRGB()
     return uicontrols.GradientSprite(align=uiconst.TOALL,
                                      parent=parent,
                                      rotation=-pi / 2,
                                      rgbData=[(0, colBright),
                                               (0.5, colBase),
                                               (1.0, colBase)],
                                      alphaData=[(0, 1.0)])
Exemple #8
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 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)
 def ConstructWarzonePanel(self):
     self.warzonePanel.Flush()
     self.warzoneControl = uicls.FWWarzoneControl(parent=self.warzonePanel, align=uiconst.TOTOP, padding=(0, 10, 0, 10))
     bottomCont = uiprimitives.Container(parent=self.warzonePanel, align=uiconst.TOALL, height=0.3)
     systemStatsCont = uicontrols.DragResizeCont(name='systemStatsCont', settingsID='FWsystemStatsCont', parent=bottomCont, align=uiconst.TORIGHT_PROP, minSize=0.1, maxSize=0.5, defaultSize=0.45)
     mapCont = uiprimitives.Container(parent=bottomCont, align=uiconst.TOALL)
     uicontrols.GradientSprite(bgParent=mapCont, rotation=-pi / 2, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.1), (0.9, 0.0)])
     self.bracketParent = uiprimitives.Container(name='bracketCont', parent=mapCont, clipChildren=True)
     from eve.client.script.ui.control.scenecontainer import SceneContainerBaseNavigation
     self.sceneContainerNav = SceneContainerBaseNavigation(parent=mapCont, state=uiconst.UI_NORMAL)
     from eve.client.script.ui.control.scenecontainer import SceneContainerBrackets
     self.sceneContainerNav.cursor = uiconst.UICURSOR_DRAGGABLE
     self.sceneContainer = SceneContainerBrackets(parent=mapCont, align=uiconst.TOALL)
     self.sceneContainerNav.Startup(self.sceneContainer)
     self.ConstructMap()
     self.systemsScroll = uicontrols.Scroll(name='systemsScroll', parent=systemStatsCont)
     self.systemsScroll.sr.id = 'FWSystemsScroll'
     self.UpdateSystemsScroll()
 def ConstructExistingFWPlayerHeader(self):
     self.topCont.Flush()
     iconSize = 50
     rightCont = uiprimitives.Container(name='rightCont', parent=self.topCont, align=uiconst.TORIGHT, width=200, padLeft=2)
     leftCont = uiprimitives.Container(name='leftCont', parent=self.topCont, clipChildren=True)
     firstLine = uiprimitives.Container(parent=leftCont, align=uiconst.TOTOP_PROP, height=0.4, padLeft=20)
     uiprimitives.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)
     uicontrols.EveLabelLarge(parent=firstLine, align=uiconst.CENTERLEFT, state=uiconst.UI_NORMAL, left=iconSize + 20, text=text)
     secondLine = uiprimitives.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 = uicontrols.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)
     uicontrols.EveLabelMedium(parent=labelCont, text=text, tabs=[100])
     firstLine = uiprimitives.Container(name='firstLine', parent=rightCont, align=uiconst.TOTOP, height=80)
     secondLine = uiprimitives.Container(name='secondLine', parent=rightCont, align=uiconst.TOTOP, height=40, top=3)
     totalPointsCont = uiprimitives.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)))
     uicontrols.EveLabelSmall(parent=totalPointsCont, text=localization.GetByLabel('UI/FactionWarfare/Points'), align=uiconst.CENTERTOP, top=-15)
     uicontrols.Frame(bgParent=totalPointsCont, color=(0.392, 0.635, 0.212, 0.2))
     uicontrols.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 = uicontrols.EveCaptionMedium(parent=totalPointsCont, align=uiconst.CENTER, text=self.warZoneInfo.factionPoints)
     systemsCont = uiprimitives.Container(parent=firstLine, align=uiconst.TOPLEFT, pos=(65, 5, 50, 100), state=uiconst.UI_NORMAL, hint=localization.GetByLabel('UI/FactionWarfare/NumConqueredSystems'))
     uiprimitives.Sprite(parent=systemsCont, align=uiconst.CENTERTOP, state=uiconst.UI_DISABLED, pos=(0, 0, 32, 32), texturePath='res:/UI/Texture/WindowIcons/systems.png')
     numSystems = len(sm.GetService('facwar').GetSolarSystemsOccupiedByFactions([self.factionID]))
     self.numSystemsLabel = uicontrols.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 = uiprimitives.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)))
         uicontrols.EveLabelMedium(parent=cont, align=uiconst.CENTERTOP, text=util.IntToRoman(i + 1), top=-20)
         uicontrols.EveHeaderLarge(parent=cont, align=uiconst.CENTER, text=num)
Exemple #12
0
    def CreateBar(self):
        self.barContainer = uiprimitives.Container(name='barContainer', parent=self, align=uiconst.TOTOP, height=BAR_HEIGHT, padTop=20, padLeft=BAR_PADDING, padRight=BAR_PADDING)
        uicontrols.Frame(parent=self.barContainer, color=(0.5, 0.5, 0.5, 0.5), offset=1)
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPLEFT, text='-10', padTop=3, left=1, color=(1, 1, 1, 1))
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-8', padTop=3, left=4 * BOX_WIDTH - 3, color=(1, 1, 1, 1))
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-5', padTop=3, left=3 * BOX_WIDTH - 3, color=(1, 1, 1, 1))
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='-2', padTop=3, left=2 * BOX_WIDTH - 3, color=(1, 1, 1, 1))
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='0', padTop=3, left=BOX_WIDTH - 3, color=(1, 1, 1, 1))
        uicontrols.EveLabelSmallBold(parent=self.barContainer, align=uiconst.TOPRIGHT, text='10', padTop=3, left=1, color=(1, 1, 1, 1))
        bucketContainer = uiprimitives.Container(name='bucketContainer', parent=self.barContainer, align=uiconst.TOPLEFT, height=BAR_HEIGHT, width=BAR_WIDTH)
        self.buckets = []
        for data in TAG_BUCKETS:
            if data.typeID is None:
                bucket = uicls.LastBucket(parent=bucketContainer)
            else:
                bucket = uicls.BucketOfTags(parent=bucketContainer, name='bucket_%s' % data.typeID, typeID=data.typeID, minSec=data.minSec, maxSec=data.maxSec)
            self.buckets.append(bucket)

        self.sliderContainer = uiprimitives.Container(name='sliderContainer', parent=self.barContainer, align=uiconst.TOALL)
        uicontrols.GradientSprite(parent=self.barContainer, align=uiconst.TOALL, rgbData=[(0, (0.3, 0.3, 0.3))], alphaData=[(0, 0.5), (0.9, 0.15)], state=uiconst.UI_DISABLED, rotation=math.pi / 2)
 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()
Exemple #14
0
 def ShowDustBackground(self):
     dustBackground = getattr(self, 'dustBackground', None)
     blueColor = util.Color.DUST[:3]
     from carbonui.primitives.gradientSprite import GradientConst
     from carbonui.primitives.gradientSprite import Gradient2DSprite
     if dustBackground is None:
         blueColorSqrt = (math.sqrt(blueColor[0]), math.sqrt(blueColor[1]),
                          math.sqrt(blueColor[2]))
         self.dustBackground = Gradient2DSprite(
             bgParent=self,
             idx=0,
             name='gradient2d',
             rgbHorizontal=[0, 1],
             rgbVertical=[0, 1],
             rgbDataHorizontal=[blueColorSqrt, blueColorSqrt],
             rgbDataVertical=[blueColorSqrt, blueColorSqrt],
             rgbInterp='bezier',
             alphaHorizontal=[0, 1],
             alphaDataHorizontal=[1.0, 1.0],
             alphaVertical=[0, 0.5, 1],
             alphaDataVertical=[0.25, 0.1, 0.0],
             textureSize=16)
     self.dustBackground.display = True
     dustBackgroundLine = getattr(self, 'dustBackgroundLine', None)
     if dustBackgroundLine is None:
         self.dustBackgroundLine = uicontrols.GradientSprite(
             parent=self,
             pos=(0, 0, 0, 1),
             align=uiconst.TOTOP,
             rgbData=[(0, blueColor), (0.5, blueColor), (1.0, blueColor)],
             alphaData=[(0, 0.2), (0.5, 1), (1.0, 0.2)],
             alphaInterp=GradientConst.INTERP_LINEAR,
             colorInterp=GradientConst.INTERP_LINEAR,
             idx=0,
             state=uiconst.UI_DISABLED)
     self.dustBackgroundLine.display = True
Exemple #15
0
    def ApplyAttributes(self, attributes):
        uicontrols.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 = uiprimitives.Container(name='bottomPar',
                                           parent=self.sr.main,
                                           align=uiconst.TOBOTTOM,
                                           height=75,
                                           idx=0)
        uicontrols.GradientSprite(bgParent=bottomPar,
                                  rotation=-pi / 2,
                                  rgbData=[(0, (0.3, 0.3, 0.3))],
                                  alphaData=[(0, 0.3), (0.9, 0.0)])
        uiprimitives.Line(parent=bottomPar,
                          align=uiconst.TOTOP,
                          color=(0.3, 0.3, 0.3, 0.3))
        buttonCont1 = uicontrols.ContainerAutoSize(name='bottomCont1',
                                                   parent=bottomPar,
                                                   align=uiconst.CENTERTOP,
                                                   top=20,
                                                   height=20)
        buttonCont2 = uicontrols.ContainerAutoSize(name='bottomCont2',
                                                   parent=bottomPar,
                                                   align=uiconst.CENTERTOP,
                                                   top=50,
                                                   height=20)
        uicontrols.EveLabelSmall(
            parent=uiprimitives.Container(align=uiconst.TOLEFT,
                                          parent=buttonCont1,
                                          width=1),
            left=3,
            top=-14,
            text=localization.GetByLabel('UI/Inventory/Filters/Match'))
        uicontrols.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 = uicontrols.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 = uicontrols.SinglelineEdit(
            name='nameEdit',
            parent=buttonCont1,
            align=uiconst.TOLEFT,
            label=localization.GetByLabel('UI/Inventory/Filters/FilterName'),
            width=120,
            padLeft=20,
            setvalue=self.name)
        uicontrols.Button(
            label=localization.GetByLabel('UI/Common/Buttons/Save'),
            parent=buttonCont2,
            align=uiconst.TOLEFT,
            func=self.Save,
            padLeft=4)
        uicontrols.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)