예제 #1
0
 static void Postfix(ref Job __result, int carLoaderID)
 {
     try
     {
         SortOrderParts.SortJob(ref __result, CarLoaderPlaces.Get().GetCarLoaderByIndex(carLoaderID));
     }
     catch (Exception e)
     {
         UMMLogger.LogException(e);
     }
 }
예제 #2
0
    // Token: 0x06002A8E RID: 10894 RVA: 0x0001B2AB File Offset: 0x000194AB
    public IEnumerator SpawnCar()
    {
        this.getFromIni();
        if (!string.IsNullOrEmpty(this.car))
        {
            if (this.car == "car_random")
            {
                this.car = Singleton <CarBundleLoader> .Instance.RandomCarName();
            }
            int configCounts = Singleton <CarBundleLoader> .Instance.GetConfigCounts(this.car);

            if (this.version + 1 > configCounts)
            {
                UIManager.Get().ShowPopup("System:", string.Concat(new object[]
                {
                    "There are only ",
                    configCounts,
                    " versions of this car, i'll set it to config",
                    configCounts - 1,
                    " for you."
                }), PopupType.Normal);
                this.version = configCounts - 1;
            }
            UIManager.Get().ShowPopup("System:", "Spawning Car " + this.car, PopupType.Normal);
            if (this.spawnLocation == "garage1")
            {
                if (CarLoaderPlaces.Get().GetOccupied(CarPlace.Entrance1))
                {
                    UIManager.Get().ShowPopup("System:", "Car exists Garage 1, deleting", PopupType.Normal);
                    this.carLoader = CarLoaderPlaces.Get().GetCarLoaderForPlace(CarPlace.Entrance1);
                    this.carLoader.DeleteCar(true);
                }
                else
                {
                    UIManager.Get().ShowPopup("System:", "Garage 1 Empty Spot", PopupType.Normal);
                    this.carLoader = CarLoaderPlaces.Get().GetPlaceForLoadCar();
                    this.carLoader.groundPosition = CarLoaderPlaces.Get().GetPlaceTransform(CarPlace.Entrance1);
                }
            }
            if (this.spawnLocation == "paintshop")
            {
                if (CarLoaderPlaces.Get().GetOccupied(CarPlace.Paintshop))
                {
                    UIManager.Get().ShowPopup("System:", "Car exists Paintshop, deleting", PopupType.Normal);
                    this.carLoader = CarLoaderPlaces.Get().GetCarLoaderForPlace(CarPlace.Paintshop);
                    this.carLoader.DeleteCar(true);
                }
                else
                {
                    UIManager.Get().ShowPopup("System:", "Paintshop Empty Spot", PopupType.Normal);
                    this.carLoader = CarLoaderPlaces.Get().GetPlaceForLoadCar();
                    this.carLoader.groundPosition = CarLoaderPlaces.Get().GetPlaceTransform(CarPlace.Paintshop);
                }
            }
            this.carLoader.ConfigVersion = this.version;
            base.StartCoroutine(this.carLoader.LoadCarFromFile(this.car));
            while (!this.carLoader.IsLoadedFromFile())
            {
                yield return(new WaitForEndOfFrame());
            }
            base.StartCoroutine(this.carLoader.LoadCar(this.car));
            while (!this.carLoader.IsCarLoaded())
            {
                yield return(new WaitForEndOfFrame());
            }
            yield return(new WaitForEndOfFrame());

            this.carLoader.PlaceAtPosition();
            this.carLoader.SetRandomCarColor();
            this.carLoader.SetOilLevelAndCondition(1f, 1f);
            this.carLoader.SetMileage(this.mileage);
            this.carLoader.SetNewLicensePlateNumber(this.licensePlate, true);
            this.carLoader.SetNewLicensePlateNumber(this.licensePlate, false);
            if (this.spawnIsExamined == "true")
            {
                this.carLoader.ExamineAllParts();
            }
            yield break;
        }
        UIManager.Get().ShowPopup("System:", "No car found in swiss.ini or the name is wrong.", PopupType.Normal);
        yield break;
    }