Пример #1
0
 def _Execute(self, title, buttons, icon, suppText, customicon, height,
              default, modal, okLabel, cancelLabel):
     if height is None:
         height = 210
     self.MakeUnMinimizable()
     self.HideHeader()
     self.SetMinSize([340, height])
     self.DefineIcons(icon, customicon)
     if title is None:
         title = localization.GetByLabel('UI/Common/Information')
     self.sr.main = uiutil.FindChild(self, 'main')
     caption = uicontrols.EveCaptionLarge(text=title,
                                          align=uiconst.CENTERLEFT,
                                          parent=self.sr.topParent,
                                          left=64,
                                          width=270)
     self.SetTopparentHeight(max(56, caption.textheight + 16))
     self.DefineButtons(buttons,
                        default=default,
                        okLabel=okLabel,
                        cancelLabel=cancelLabel)
     if suppText:
         self.ShowSupp(suppText)
     if modal:
         uicore.registry.SetFocus(self)
Пример #2
0
 def UpdateSubtitles(self):
     x, y, contWidth, contHeight = self.sr.movieCont.GetAbsolute()
     subsWidth = int(float(contWidth) * 0.6)
     currentTime = self.GetCurrentMovieTime()
     self.sr.subtitleCont.Flush()
     for subtitle in self.subtitles:
         if currentTime >= subtitle[1] and currentTime <= subtitle[2]:
             framesFromEnd = min(currentTime - subtitle[1], subtitle[2] - currentTime)
             alpha = min(1.0, float(framesFromEnd) / self.fadeTime)
             uicontrols.EveCaptionLarge(text='<center>%s' % subtitle[0], parent=self.sr.subtitleCont, color=(0.75,
              0.75,
              0.75,
              alpha), align=uiconst.TOALL, bold=False, state=uiconst.UI_DISABLED)
Пример #3
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.callback = attributes.get('callback', self.default_callback)
     self.speed = attributes.get('speed', self.default_speed)
     text = attributes.get('text', self.default_text)
     self.rollInColor = attributes.get('color', self.default_color)
     self.rollOutColor = self.rollInColor
     self.scrollOut = uiprimitives.Transform(parent=self,
                                             align=uiconst.TOPLEFT,
                                             height=self.height)
     self.scrollOutText = uicontrols.EveCaptionLarge(text=text,
                                                     parent=self.scrollOut,
                                                     align=uiconst.TOLEFT,
                                                     color=(1, 1, 1, 1))
     self.scrollIn = uiprimitives.Transform(parent=self,
                                            align=uiconst.TOPLEFT,
                                            height=self.height)
     self.scrollInText = uicontrols.EveCaptionLarge(text='',
                                                    parent=self.scrollIn,
                                                    align=uiconst.TOLEFT,
                                                    color=(1, 1, 1, 1))
     self.scrolling = False
Пример #4
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)
Пример #5
0
 def ApplyAttributes(self, attributes):
     uiprimitives.Container.ApplyAttributes(self, attributes)
     self.alertText = None
     self.fullScreen = uiprimitives.Container(name='shipAlerts',
                                              parent=uicore.layer.inflight,
                                              align=uiconst.TOALL,
                                              state=uiconst.UI_DISABLED)
     self.labelCont = uiprimitives.Container(name='fakeTextCont',
                                             parent=self,
                                             align=uiconst.CENTER,
                                             state=uiconst.UI_DISABLED,
                                             width=400)
     self.warningLabelCont = uiprimitives.Container(name='warningLabelCont',
                                                    parent=self.labelCont,
                                                    align=uiconst.TOBOTTOM,
                                                    height=40,
                                                    top=100)
     self.warningLabel = uicontrols.EveCaptionLarge(
         name='warningLabel',
         parent=self.warningLabelCont,
         align=uiconst.CENTER,
         bold=True,
         color=(1, 1, 1, 1.0),
         idx=0)
     self.warningLabel.uppercase = True
     self.warningLabel.opacity = 0.0
     self.exceptionLabel = uicontrols.Label(
         name='fakeException',
         parent=self.labelCont,
         align=uiconst.TOBOTTOM,
         fontsize=fontConst.EVE_SMALL_FONTSIZE,
         color=(1, 0, 0, 0.4))
     self.damageElements = self.AddSideElements()
     self.oldDamageState = [1, 1, 1, 1, 1]
     self.alertStartTimes = [None, None, None, None, None]
     self.isActuallyDamaged = [False, False, False, False, False]
     self.lastRTPCLevels = [None, None, None, None, None]
     self.animMethods = [
         self.DoShieldAnimation, self.DoArmorAnimation, self.DoHullAnimation
     ]
     self.animDuration = 2.0
     self.UpdatePosition()
     sm.RegisterNotify(self)
     self.enteringCapsule = False
Пример #6
0
    def WriteCloneActivationText_thread(self, *args):
        blue.synchro.SleepSim(1000)
        redColor = (0.9, 0.1, 0.1)
        cloneText = localization.GetByLabel('UI/Inflight/ActivatingClone')
        if session.stationid:
            locationName = cfg.evelocations.Get(session.stationid).name
        else:
            locationName = ''
        cloneSubText = localization.GetByLabel(
            'UI/Inflight/ActivatingCloneSubText', locationName=locationName)
        cloneSubTextLabel = uicontrols.EveLabelLarge(
            parent=self.notifyContainer,
            name='cloneSubTextLabel',
            text=cloneSubText,
            align=uiconst.TOPLEFT,
            bold=True)
        cloneText = localization.GetByLabel('UI/Inflight/ActivatingClone')
        cloneActivatingLabel = uicontrols.EveCaptionLarge(
            parent=self.notifyContainer,
            name='cloneActivatingLabel',
            text='',
            align=uiconst.TOPLEFT,
            top=cloneSubTextLabel.top + cloneSubTextLabel.textheight,
            bold=True)
        uicore.animations.BlinkIn(cloneActivatingLabel,
                                  startVal=0.0,
                                  endVal=1.0,
                                  duration=1.0,
                                  loops=uiconst.ANIM_REPEAT,
                                  curveType=uiconst.ANIM_WAVE)
        cloneSubTextLabel.text = ''
        for char in cloneSubText:
            cloneSubTextLabel.text += char
            sm.GetService('audio').SendUIEvent('ui_text_singlechar_play')
            blue.synchro.SleepSim(20)

        for char in cloneText:
            cloneActivatingLabel.text += char
            sm.GetService('audio').SendUIEvent('ui_text_singlechar_play')
            blue.synchro.SleepSim(20)