Example #1
0
 def _getActiveOutfit(self, vDesc):
     tankInfo = self.__tankInfo
     if tankInfo is None:
         if vDesc:
             vehicleCD = vDesc.makeCompactDescr()
             return self.customizationService.getEmptyOutfitWithNationalEmblems(
                 vehicleCD=vehicleCD)
         return self.itemsFactory.createOutfit()
     else:
         vehCompDescr = tankInfo.vehCompDescr
         if tankInfo.vehOutfitCD:
             if vDesc is None:
                 vDesc = vehicles.VehicleDescr(vehCompDescr)
             outfitComp = camouflages.getOutfitComponent(
                 outfitCD=tankInfo.vehOutfitCD,
                 vehicleDescriptor=vDesc,
                 seasonType=tankInfo.seasonType)
             outfit = self.itemsFactory.createOutfit(component=outfitComp,
                                                     vehicleCD=vehCompDescr)
             forceHistorical = self.settingsCore.getSetting(
                 GAME.CUSTOMIZATION_DISPLAY_TYPE
             ) < outfit.customizationDisplayType()
             if forceHistorical:
                 outfit = None
         else:
             outfit = None
         if outfit is None:
             outfit = self.customizationService.getEmptyOutfitWithNationalEmblems(
                 vehicleCD=vehCompDescr)
         return outfit
Example #2
0
def new_cacheAppearance(base, self, vId, info, *args, **kwargs):
    if g_config.data['enabled'] and getattr(info.typeDescr, 'modelDesc', None) is None:
        outfitComponent = camouflages.getOutfitComponent(info.outfitCD)
        outfit = Outfit(component=outfitComponent)
        player = BigWorld.player()
        forceHistorical = player.isHistoricallyAccurate and player.playerVehicleID != vId and not outfit.isHistorical()
        outfit = Outfit() if forceHistorical else outfit
        vDesc_process(vId, info.typeDescr, 'battle', outfit.modelsSet or 'default')
    return base(self, vId, info, *args, **kwargs)
Example #3
0
    def updateSpawnList(self, spawnListData):
        toAdd = spawnListData.difference(self._spawnList)
        toRemove = self._spawnList.difference(spawnListData)
        for data in toAdd:
            vDesc = VehicleDescriptor(compactDescr=data.vehicleCD)
            prereqs = set(vDesc.prerequisites())
            outfit = Outfit(component=getOutfitComponent(data.outfitCD),
                            vehicleCD=data.vehicleCD)
            modelsSetParams = ModelsSetParams(outfit.modelsSet,
                                              ModelStates.UNDAMAGED, [])
            compoundAssembler = model_assembler.prepareCompoundAssembler(
                vDesc, modelsSetParams,
                BigWorld.camera().spaceID)
            prereqs.add(compoundAssembler)
            self._appearanceCache.loadResources(data.vehicleCD, list(prereqs))

        for data in toRemove:
            self._appearanceCache.unloadResources(data.vehicleCD)

        self._spawnList = spawnListData
        _logger.debug('SpawnList cache updated=%s', spawnListData)
 def _prepareOutfit(self, outfitCD):
     outfitComponent = camouflages.getOutfitComponent(outfitCD)
     return Outfit(component=outfitComponent,
                   vehicleCD=self.typeDescriptor.makeCompactDescr())