コード例 #1
0
    def AnimEntry(self):
        if self.jobData:
            color = GetJobColor(self.jobData)
            for pattern in (self.bgPattern, self.outcomeCaption):
                uicore.animations.SpColorMorphTo(pattern, pattern.GetRGBA(), color, duration=0.3)

        self.errorFrame.Hide()
コード例 #2
0
 def UpdateState(self, *args):
     if not self.jobData:
         return
     self.jobData.on_updated.connect(self.UpdateState)
     texturePath, _ = sm.GetService('skills').GetRequiredSkillsLevelTexturePathAndHint(self.skills)
     self.skillIcon.SetTexturePath(texturePath)
     color = GetJobColor(self.jobData)
     uicore.animations.SpColorMorphTo(self.patternSprite, self.patternSprite.GetRGBA(), color, duration=0.3)
コード例 #3
0
 def UpdateState(self):
     if self.jobData:
         self.outcomeLabel.text = self.jobData.GetProductLabel()
         self.UpdateCopyInfo()
         if self.jobData.activityID == industry.INVENTION:
             self.probabilityLabel.Show()
             color = Color.RGBtoHex(*GetJobColor(self.jobData))
             self.probabilityLabel.text = localization.GetByLabel('UI/Industry/SuccessProbabilityPerRun', probability=self.jobData.probability * 100, color=color)
         else:
             self.probabilityLabel.Hide()
     else:
         self.outcomeLabel.text = ''
         self.probabilityLabel.Hide()
コード例 #4
0
    def AnimEntry(self):
        duration = 0.7
        if self.jobData:
            self.HideDashes()
            if self.topWedge.top < WEDGE_TRAVEL:
                self.AnimWedges(0, WEDGE_TRAVEL, duration)
            else:
                self.AnimWedges(WEDGE_TRAVEL,
                                18,
                                0.5,
                                curveType=uiconst.ANIM_WAVE)
            if not self.IsSameBlueprint():
                uicore.animations.FadeTo(self.iconCont, 0.0, 1.0, duration=0.5)
            for obj in (self.containerME, self.containerTE):
                obj.Enable()
                uicore.animations.FadeIn(obj, duration=duration)

        else:
            self.AnimWedges(self.topWedge.top, 0.0, duration)
            for obj in (self.containerME, self.containerTE):
                obj.Disable()
                uicore.animations.FadeOut(obj, duration=duration)

            self.ShowDashes()
        if self.jobData and self.jobData.IsPreview():
            uicore.animations.FadeTo(self.iconCont, 0.0, 0.65, duration=0.5)
            self.errorFrame.Show()
            wedgeColor = industryUIConst.COLOR_NOTREADY
        else:
            self.errorFrame.Hide()
            wedgeColor = Color.WHITE
        for dots in self.wedgeDots:
            dots.SetRGBA(*wedgeColor)

        if self.gauge:
            uicore.animations.BlinkIn(self.gauge, 0.0, 1.0, timeOffset=0.98)
        for dots in self.wedgeDots:
            uicore.animations.BlinkIn(dots, 0.0, 0.85, timeOffset=0.78)

        for pattern in self.wedgeBg:
            if self.jobData and self.jobData.IsPreview():
                color = industryUIConst.COLOR_NOTREADY
            else:
                color = GetJobColor(self.jobData)
            uicore.animations.SpColorMorphTo(pattern,
                                             pattern.GetRGBA(),
                                             color,
                                             duration=0.3)
コード例 #5
0
 def ReconstructGauge(self):
     if self.gauge:
         self.gauge.Close()
         self.gauge = None
     if not self.jobData:
         return
     color = GetJobColor(self.jobData)
     h, s, b = Color(*color).GetHSB()
     colorEnd = Color(*color).SetBrightness(b * 0.5).GetRGBA()
     self.gauge = BlueprintGaugeCircular(name='gauge',
                                         parent=self,
                                         align=uiconst.CENTER,
                                         radius=64,
                                         lineWidth=4,
                                         colorStart=color,
                                         colorEnd=colorEnd,
                                         jobData=self.jobData)
コード例 #6
0
 def AnimEntry(self):
     color = GetJobColor(self.jobData)
     uicore.animations.SpColorMorphTo(self.pattern, self.pattern.GetRGBA(), color, duration=0.3)
コード例 #7
0
    def UpdateState(self, *args):
        if not self.jobData:
            self.previewCont.Hide()
            return
        typeID = self.jobData.GetProductTypeID()
        if IsPreviewable(typeID) and self.jobData.activityID == industry.MANUFACTURING:
            self.previewCont.Show()
            self.iconCont.Hide()
            newModel = self.previewCont.PreviewType(typeID)
            if newModel:
                self.previewContFill.Show()
                self.previewContFill.opacity = 1.0
                self.previewCont.AnimEntry(1.5, 0.0, 0.5, -0.3)
                self.previewCont.sceneContainer.scene.sunDirection = (-0.5, -1.0, -1.0)
            self.bg.Hide()
            self.qtyLabel.top = 86
            self.leftProbabilityGradient.Hide()
            self.rightProbabilityGradient.Hide()
        else:
            self.iconCont.Show()
            self.previewCont.Hide()
            self.bg.Show()
            self.qtyLabel.top = 42
            if self.jobData.activityID == industry.RESEARCH_MATERIAL:
                self.icon.LoadIcon('res:/UI/Texture/Classes/Industry/iconME.png')
                self.icon.width = self.icon.height = 17
                self.techIcon.texturePath = None
            elif self.jobData.activityID == industry.RESEARCH_TIME:
                self.icon.LoadIcon('res:/UI/Texture/Classes/Industry/iconTE.png')
                self.techIcon.texturePath = None
                self.icon.width = self.icon.height = 16
            else:
                isCopy = self.jobData.activityID in (industry.COPYING, industry.INVENTION)
                oldTypeID = self.icon.typeID
                self.icon.LoadIconByTypeID(typeID, ignoreSize=True, isCopy=isCopy)
                self.icon.width = self.icon.height = 64
                texturePath, hint = GetTechLevelIconPathAndHint(typeID)
                self.techIcon.texturePath = texturePath
                self.techIcon.hint = hint
                if oldTypeID != typeID:
                    uicore.animations.FadeTo(self.icon, 0.0, 1.0, duration=0.6)
            if self.jobData.activityID == industry.INVENTION:
                width = self.jobData.probability * 160
                color = GetJobColor(self.jobData)
                for gradient in (self.leftProbabilityGradient, self.rightProbabilityGradient):
                    gradient.Show()
                    gradient.SetRGBA(*color)
                    uicore.animations.MorphScalar(gradient, 'width', gradient.width, width, duration=0.6)

            else:
                self.leftProbabilityGradient.Hide()
                self.rightProbabilityGradient.Hide()
        if self.jobData and self.jobData.product:
            self.iconCont.opacity = 1.0
            uicore.animations.FadeTo(self.bgCont, self.bgCont.opacity, 1.0, duration=0.3)
            self.errorFrame.Hide()
        else:
            self.iconCont.opacity = 0.0
            uicore.animations.FadeTo(self.bgCont, 0.3, 1.0, duration=2.0, curveType=uiconst.ANIM_WAVE, loops=uiconst.ANIM_REPEAT)
            self.errorFrame.Show()
        self.UpdateOutputQty()
        self.StopVideo()
        if self.jobData.status == industry.STATUS_DELIVERED:
            self.PlayVideoDelivered()
コード例 #8
0
 def UpdateColor(self):
     self.color = GetJobColor(self.jobData)