Esempio n. 1
0
 def PreviewType(self, typeID, **kwargs):
     if not IsPreviewable(typeID):
         raise InvalidPreviewType('%s (%s) is not previewable' %
                                  (evetypes.GetName(typeID), typeID))
     groupID = evetypes.GetGroupID(typeID)
     categoryID = evetypes.GetCategoryIDByGroup(groupID)
     if IsModularShip(typeID):
         return self.PreviewTech3Ship(typeID,
                                      subsystems=kwargs.get('subsystems'),
                                      scenePath=kwargs.get('scenePath'))
     if categoryID == invconst.categoryApparel:
         return self.PreviewApparel(typeID,
                                    gender=kwargs.get('gender'),
                                    background=kwargs.get('background'))
     if groupID in invconst.turretModuleGroups:
         return self.PreviewTurret(typeID,
                                   scenePath=kwargs.get('scenePath'))
     if groupID in invconst.turretAmmoGroups:
         return self.PreviewAmmo(typeID, scenePath=kwargs.get('scenePath'))
     if groupID == invconst.groupShipSkins or categoryID == invconst.categoryShip:
         controller = kwargs.get('controller')
         if controller is None:
             return self.PreviewSkin(typeID,
                                     scenePath=kwargs.get('scenePath'))
         else:
             return self.PreviewSkinnedEntity(
                 typeID,
                 controller=kwargs.get('controller'),
                 scenePath=kwargs.get('scenePath'))
     else:
         return self.PreviewSpaceEntity(typeID,
                                        itemID=kwargs.get('itemID'),
                                        scenePath=kwargs.get('scenePath'))
Esempio n. 2
0
 def PickFirstPreviewableType(self):
     for typeID, _ in self.offer.productQuantities.itervalues():
         if IsPreviewable(GetPreviewType(typeID)):
             self.typeID = typeID
             break
     else:
         self.previewContainer.SetState(uiconst.UI_HIDDEN)
         uicore.animations.SpMaskOut(self.cover, duration=0.4)
Esempio n. 3
0
 def OnIndustryViewExpandCollapse(self):
     if not self.previewCont or not self.jobData or self.jobData.activityID != industry.MANUFACTURING:
         return
     isCollapsed = settings.user.ui.Get('industryWndIsViewCollapsed', False)
     if not isCollapsed and IsPreviewable(self.jobData.GetProductTypeID()):
         self.AnimFadeSceneContIn()
     else:
         self.previewCont.Hide()
         self.previewContFill.opacity = 1.0
Esempio n. 4
0
 def ShowPreview(self):
     typeID = GetPreviewType(self.typeID)
     if not IsPreviewable(typeID):
         return
     if IsApparel(self.typeID) and self.charID:
         self.previewContainer.PreviewCharacter(self.charID,
                                                apparel=[self.typeID])
     else:
         self.previewContainer.PreviewType(
             typeID, scenePath='res:/dx9/scene/fitting/fitting.red')
     if IsApparel(typeID):
         self.previewContainer.AnimEntry(-0.1, 0.0, 0.5, -0.2)
     else:
         self.previewContainer.AnimEntry(0.3, 0.2, 0.6, -0.3)
Esempio n. 5
0
 def ApplyAttributes(self, attributes):
     super(VgsDetailProduct, self).ApplyAttributes(attributes)
     self.typeID = attributes.typeID
     self.onClick = attributes.onClick
     self.highlight = Sprite(
         name='hoverGradient',
         bgParent=self,
         texturePath='res:/UI/Texture/Vgs/store-button-gradient2.png',
         color=(0.2, 0.7, 1.0))
     iconCont = Container(parent=self,
                          align=uiconst.TOLEFT,
                          width=64,
                          height=64,
                          padding=(TEXT_PADDING, 1, TEXT_PADDING, 1),
                          state=uiconst.UI_DISABLED)
     Sprite(bgParent=iconCont,
            name='background',
            texturePath='res:/UI/Texture/classes/InvItem/bgNormal.png')
     techIcon = uix.GetTechLevelIcon(typeID=self.typeID)
     isCopy = evetypes.GetCategoryID(
         self.typeID) == invconst.categoryBlueprint
     if techIcon:
         iconCont.children.append(techIcon)
     Icon(parent=iconCont,
          align=uiconst.TOPLEFT,
          typeID=self.typeID,
          size=64,
          state=uiconst.UI_DISABLED,
          isCopy=isCopy)
     container = Container(parent=self,
                           align=uiconst.TOALL,
                           state=uiconst.UI_DISABLED)
     VgsLabelSmall(parent=container,
                   align=uiconst.CENTERLEFT,
                   text=localization.GetByLabel(
                       'UI/Contracts/ContractsWindow/TypeNameWithQuantity',
                       typeID=self.typeID,
                       quantity=attributes.quantity))
     if IsPreviewable(GetPreviewType(self.typeID)):
         self.cursor = uiconst.UICURSOR_MAGNIFIER
     else:
         self.disabled = True
Esempio n. 6
0
 def PreviewType(self, typeID, **kwargs):
     typeInfo = cfg.invtypes.Get(typeID)
     if not IsPreviewable(typeID):
         raise InvalidPreviewType(
             '{0.name} ({0.typeID}) is not previewable'.format(typeInfo))
     if IsModularShip(typeID):
         return self.PreviewTech3Ship(typeID,
                                      subsystems=kwargs.get('subsystems'),
                                      scenePath=kwargs.get('scenePath'))
     elif typeInfo.categoryID == invconst.categoryApparel:
         return self.PreviewApparel(typeID,
                                    gender=kwargs.get('gender'),
                                    background=kwargs.get('background'))
     elif typeInfo.groupID in invconst.turretModuleGroups:
         return self.PreviewTurret(typeID,
                                   scenePath=kwargs.get('scenePath'))
     elif typeInfo.groupID in invconst.turretAmmoGroups:
         return self.PreviewAmmo(typeID, kwargs.get('scenePath'))
     else:
         return self.PreviewSpaceEntity(typeID,
                                        itemID=kwargs.get('itemID'),
                                        scenePath=kwargs.get('scenePath'))
Esempio n. 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()
Esempio n. 8
0
 def OnPickType(self, _):
     if IsPreviewable(self.typeID) and IsApparel(
             self.typeID) and not IsWearableBy(self.typeID, self.charID):
         self.charID = None
         return
     uthread.new(self.ShowPreview)