Exemplo n.º 1
0
    def prerequisites(self, respawnCompactDescr=None):
        if self.respawnCompactDescr is not None:
            respawnCompactDescr = self.respawnCompactDescr
            self.isCrewActive = True
            self.respawnCompactDescr = None
        if respawnCompactDescr is None and self.typeDescriptor is not None:
            return ()
        else:
            prereqs = []
            if respawnCompactDescr is not None:
                descr = vehicles.VehicleDescr(respawnCompactDescr)
                self.health = descr.maxHealth
            else:
                descr = vehicles.VehicleDescr(
                    compactDescr=_stripVehCompDescrIfRoaming(
                        self.publicInfo.compDescr))
            self.typeDescriptor = descr
            prereqs += descr.prerequisites(
                self.physicsMode == VEHICLE_PHYSICS_MODE.DETAILED)
            for hitTester in descr.getHitTesters():
                if hitTester.bspModelName is not None and not hitTester.isBspModelLoaded(
                ):
                    prereqs.append(hitTester.bspModelName)

            self.assembler = vehicle_assembler.createAssembler(self)
            self.appearance = self.assembler.appearance
            prereqs += self.assembler.prerequisites()
            return prereqs
Exemplo n.º 2
0
    def __cacheApperance(self, vId, info):
        assembler = vehicle_assembler.createAssembler()
        prereqs = info.typeDescr.prerequisites(True)
        for hitTester in info.typeDescr.getHitTesters():
            if hitTester.bspModelName is not None and not hitTester.isBspModelLoaded():
                prereqs.append(hitTester.bspModelName)

        compoundAssembler, assemblerPrereqs = assembler.prerequisites(info.typeDescr, vId, info.health, info.isCrewActive, info.isTurretDetached)
        prereqs += assemblerPrereqs
        self.__assemblersCache[vId] = _AssemblerData(compoundAssembler, assembler, info, prereqs)
        if self.__spaceLoaded:
            BigWorld.loadResourceListBG(prereqs, partial(_resourceLoaded, prereqs, vId))
        return (compoundAssembler, prereqs)
    def __cacheApperance(self, vId, info):
        assembler = vehicle_assembler.createAssembler()
        prereqs = info.typeDescr.prerequisites(True)
        for hitTester in info.typeDescr.getHitTesters():
            if hitTester.bspModelName is not None and not hitTester.isBspModelLoaded():
                prereqs.append(hitTester.bspModelName)

        compoundAssembler, assemblerPrereqs = assembler.prerequisites(info.typeDescr, vId, info.health, info.isCrewActive, info.isTurretDetached)
        prereqs += assemblerPrereqs
        self.__assemblersCache[vId] = _AssemblerData(compoundAssembler, assembler, info, prereqs)
        if self.__spaceLoaded:
            BigWorld.loadResourceListBG(prereqs, partial(_resourceLoaded, prereqs, vId))
        return (compoundAssembler, prereqs)
 def __cacheApperance(self, vId, info):
     assembler = vehicle_assembler.createAssembler()
     prereqs = info.typeDescr.prerequisites(True)
     compoundAssembler, assemblerPrereqs = assembler.prerequisites(
         info.typeDescr, vId, info.health, info.isCrewActive,
         info.isTurretDetached, info.outfitCD)
     prereqs += assemblerPrereqs
     self.__assemblersCache[vId] = _AssemblerData(compoundAssembler,
                                                  assembler, info, prereqs)
     if self.__spaceLoaded:
         BigWorld.loadResourceListBG(prereqs,
                                     partial(_resourceLoaded, prereqs, vId),
                                     loadingPriority(vId))
     return (compoundAssembler, prereqs)
Exemplo n.º 5
0
 def __cacheApperance(self, vId, info):
     assembler = vehicle_assembler.createAssembler()
     prereqs = info.typeDescr.prerequisites(True)
     compoundAssembler, assemblerPrereqs = assembler.prerequisites(
         info.typeDescr, vId, info.health, info.isCrewActive,
         info.isTurretDetached, info.outfitCD)
     prereqs += assemblerPrereqs
     if vId in self.__assemblersCache:
         assemblerData = self.__assemblersCache.get(vId, None)
         if assemblerData is not None:
             oldAssembler = assemblerData.assembler
             LOG_WARNING(
                 'The latest resources for the vehicle are not loaded yet, deleting old assember and creating new one %s %s'
                 % (info.typeDescr.name, assemblerData.info.typeDescr))
             del oldAssembler
         del self.__assemblersCache[vId]
     self.__assemblersCache[vId] = _AssemblerData(compoundAssembler,
                                                  assembler, info, prereqs)
     if self.__spaceLoaded:
         BigWorld.loadResourceListBG(prereqs,
                                     partial(_resourceLoaded, prereqs, vId),
                                     loadingPriority(vId))
     return (compoundAssembler, prereqs)
Exemplo n.º 6
0
    def prerequisites(self, respawnCompactDescr = None):
        if self.respawnCompactDescr is not None:
            respawnCompactDescr = self.respawnCompactDescr
            self.isCrewActive = True
            self.respawnCompactDescr = None
        if respawnCompactDescr is None and self.typeDescriptor is not None:
            return ()
        else:
            prereqs = []
            if respawnCompactDescr is not None:
                descr = vehicles.VehicleDescr(respawnCompactDescr)
                self.health = descr.maxHealth
            else:
                descr = vehicles.VehicleDescr(compactDescr=_stripVehCompDescrIfRoaming(self.publicInfo.compDescr))
            self.typeDescriptor = descr
            prereqs += descr.prerequisites(self.physicsMode == VEHICLE_PHYSICS_MODE.DETAILED)
            for hitTester in descr.getHitTesters():
                if hitTester.bspModelName is not None and not hitTester.isBspModelLoaded():
                    prereqs.append(hitTester.bspModelName)

            self.assembler = vehicle_assembler.createAssembler(self)
            self.appearance = self.assembler.appearance
            prereqs += self.assembler.prerequisites()
            return prereqs