Esempio n. 1
0
    // Token: 0x06002A8B RID: 10891 RVA: 0x000F981C File Offset: 0x000F7A1C
    public virtual void Update()
    {
        this.KeyPress();
        if (this.keyListen(this.SpawnCarKey, this.finder))
        {
            base.StartCoroutine(this.SpawnCar());
            this.finder = null;
            return;
        }
        if ((Input.GetKey(KeyCode.LeftShift) & Input.GetKeyDown(KeyCode.Delete)) | (Input.GetKey(KeyCode.RightShift) & Input.GetKeyDown(KeyCode.Delete)))
        {
            int shedsAvailable = GlobalData.ShedsAvailable;
            for (int i = 0; i < GlobalData.ShedsVisible.Length; i++)
            {
                GlobalData.ShedsVisible[i] = false;
            }
            GlobalData.ShedsAvailable = 0;
            GlobalData.Save();
            GameLoader.Get().Save();
            UIManager.Get().ShowPopup("System:", "deleted " + shedsAvailable + " Barns, Now Reload Save", PopupType.Normal);
            return;
        }
        if (this.keyListen(this.IncreseConfigKey, this.finder))
        {
            if (this.version > 0)
            {
                this.version--;
                UIManager.Get().ShowPopup("System:", "Version set to " + this.version, PopupType.Normal);
            }
            UIManager.Get().ShowPopup("System:", "Can't set Version below 0", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.DecreaseConfigKey, this.finder))
        {
            this.version++;
            UIManager.Get().ShowPopup("System:", "Version set to " + this.version, PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.RandomChangeCondition, this.finder))
        {
            if (GameScript.Get().GetIOMouseOverCarLoader2() != null)
            {
                ((CarDebug)GameScript.Get().GetIOMouseOverCarLoader2().GetComponent(typeof(CarDebug))).Test_AuctionCar();
                UIManager.Get().ShowPopup("System:", "Random Condition Set", PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.RandomChangeColor, this.finder) && GameScript.Get().GetIOMouseOverCarLoader2())
        {
            if (GameScript.Get().GetIOMouseOverCarLoader2() != null)
            {
                GameScript.Get().GetIOMouseOverCarLoader2().SetRandomCarColor();
                UIManager.Get().ShowPopup("System:", "Random Color Set", PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.CarIsExamined, this.finder) && GameScript.Get().GetIOMouseOverCarLoader2())
        {
            if (GameScript.Get().GetIOMouseOverCarLoader2() != null)
            {
                GameScript.Get().GetIOMouseOverCarLoader2().ExamineAllParts();
                UIManager.Get().ShowPopup("System:", "Car is Examined", PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.PartIsExamined, this.finder) && GameScript.Get().GetPartMouseOver())
        {
            if (GameScript.Get().GetPartMouseOver() != null)
            {
                GameScript.Get().GetPartMouseOver().SetIsExamined(true);
                UIManager.Get().ShowPopup("System:", "Part is Examined", PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.ReloadLiveries, this.finder))
        {
            Singleton <LiverysManager> .Instance.Prepare();

            UIManager.Get().ShowPopup("System:", "Liveries reloaded", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.SetMileage, this.finder))
        {
            this.getFromIni();
            if (GameScript.Get().GetIOMouseOverCarLoader2() != null)
            {
                GameScript.Get().GetIOMouseOverCarLoader2().SetMileage(this.mileage);
                UIManager.Get().ShowPopup("System:", "Mileage set to " + this.mileage, PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.GenerateJunkyard, this.finder) && GameScript.Get().CurrentSceneType == SceneType.Junkyard)
        {
            Singleton <JunkyardGenerator> .Instance.GenerateNewJunkyard = true;
            Singleton <JunkyardGenerator> .Instance.Update();

            UIManager.Get().ShowPopup("System:", "Junkyard Generated", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.FullyRepairCar, this.finder) && GameScript.Get().GetIOMouseOverCarLoader2())
        {
            if (GameScript.Get().GetIOMouseOverCarLoader2() != null)
            {
                base.StartCoroutine(this.ReloadCar(GameScript.Get().GetIOMouseOverCarLoader2()));
                UIManager.Get().ShowPopup("System:", "All shiny and new again", PopupType.Normal);
            }
            this.finder = null;
            return;
        }
        if (this.keyListen(this.PhotoMode, this.finder))
        {
            GameMode.Get().SetCurrentMode(gameMode.PhotoMode);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.DuplicateEngine, this.finder))
        {
            this.getFromIni();
            if (UIManager.Get().IsActive("Inventory"))
            {
                UIManager.Get().Hide("Inventory");
            }
            this.engine = new NewGroupItem(GameScript.Get().GetGroupOnEngineStand());
            GroupInventory.Get().Add(this.engine);
            string groupName = GameScript.Get().GetGroupOnEngineStand().GroupName;
            UIManager.Get().ShowPopup("System:", "Engine " + groupName + " added to inventory", PopupType.Normal);
            foreach (NewGroupItem newGroupItem in GroupInventory.Get().GetGroupInventory(groupName))
            {
                foreach (NewInventoryItem newInventoryItem in newGroupItem.ItemList)
                {
                    newInventoryItem.Condition = this.condition;
                    newInventoryItem.extraParameters.Add("Quality", this.quality);
                    newInventoryItem.IsExamined = true;
                }
            }
            base.StartCoroutine(UIManager.Get().PrepareInventory());
            UIManager.Get().Show("Inventory");
            this.finder = null;
            return;
        }
        if (this.keyListen(this.AddAllEngineParts, this.finder))
        {
            this.getFromIni();
            if (UIManager.Get().IsActive("Inventory"))
            {
                UIManager.Get().Hide("Inventory");
            }
            string groupName2 = GameScript.Get().GetGroupOnEngineStand().GroupName;
            UIManager.Get().ShowPopup("System:", "Engine: " + groupName2, PopupType.Normal);
            foreach (NewInventoryItem newInventoryItem2 in GameScript.Get().GetGroupOnEngineStand().ItemList)
            {
                string normalID = newInventoryItem2.GetNormalID();
                Inventory.Get().Add(normalID, 1f, Color.white, true, true);
                foreach (NewInventoryItem newInventoryItem3 in Inventory.Get().GetItems(normalID))
                {
                    newInventoryItem3.Condition = this.condition;
                    newInventoryItem3.extraParameters.Add("Quality", this.quality);
                }
            }
            UIManager.Get().ShowPopup("System:", "Part " + groupName2 + "added to inventory", PopupType.Normal);
            base.StartCoroutine(UIManager.Get().PrepareInventory());
            UIManager.Get().Show("Inventory");
            this.finder = null;
            return;
        }
        if (this.keyListen(this.RepairAllItems, this.finder))
        {
            this.getFromIni();
            if (UIManager.Get().IsActive("Inventory"))
            {
                UIManager.Get().Hide("Inventory");
            }
            foreach (NewInventoryItem newInventoryItem4 in Inventory.Get().GetItems("All"))
            {
                newInventoryItem4.Condition = this.condition;
                newInventoryItem4.extraParameters.Add("Quality", this.quality);
            }
            foreach (NewGroupItem newGroupItem2 in GroupInventory.Get().GetGroupInventory())
            {
                foreach (NewInventoryItem newInventoryItem5 in newGroupItem2.ItemList)
                {
                    newInventoryItem5.Condition = this.condition;
                    newInventoryItem5.extraParameters.Add("Quality", this.quality);
                }
            }
            UIManager.Get().ShowPopup("System:", string.Concat(new object[]
            {
                "All items repaired to ",
                this.quality,
                " quality and ",
                this.condition * 100f,
                "% condition"
            }), PopupType.Normal);
            base.StartCoroutine(UIManager.Get().PrepareInventory());
            UIManager.Get().Show("Inventory");
            this.finder = null;
            return;
        }
        if (this.keyListen(this.AddBarn, this.finder))
        {
            GlobalData.AddShed(1);
            UIManager.Get().ShowPopup("System:", "Barn added", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.AddMoney, this.finder))
        {
            this.getFromIni();
            GlobalData.AddPlayerMoney(this.addMoneyAmount);
            UIManager.Get().ShowPopup("System:", this.addMoneyAmount + " Money added", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.SetMoney, this.finder))
        {
            this.getFromIni();
            GlobalData.SetPlayerMoney(this.setMoneyAmount);
            UIManager.Get().ShowPopup("System:", "Money set to: " + this.setMoneyAmount, PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.AddXP, this.finder))
        {
            this.getFromIni();
            GlobalData.AddPlayerExp(this.addXPAmount);
            UIManager.Get().ShowPopup("System:", this.addXPAmount + " XP added", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.UnlockAllUpgrades, this.finder))
        {
            Singleton <UpgradeSystem> .Instance.UnlockAll();

            UIManager.Get().ShowPopup("System:", "All unlocked. Re-enter garage to activate", PopupType.Normal);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.RotateEngineRight, this.finder))
        {
            GameScript.Get().IncraseEngineStandAngle(45f);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.RotateEngineLeft, this.finder))
        {
            GameScript.Get().IncraseEngineStandAngle(-45f);
            this.finder = null;
            return;
        }
        if (this.keyListen(this.OpenShop, this.finder))
        {
            base.StartCoroutine(GameScript.Get().EnterToShop());
            this.finder = null;
            return;
        }
        if (this.keyListen(this.AddThisPart, this.finder))
        {
            this.getFromIni();
            this.finder = null;
            string id = GameScript.Get().GetPartMouseOver().GetID();
            if (id != null)
            {
                Inventory.Get().Add(id, 1f, Color.white, true, true);
                foreach (NewInventoryItem newInventoryItem6 in Inventory.Get().GetItems(id))
                {
                    newInventoryItem6.Condition = this.condition;
                    newInventoryItem6.extraParameters.Add("Quality", this.quality);
                }
            }
            if (this.showInventory == "false")
            {
                UIManager.Get().ShowPopup("System:", "Part " + id + " added to inventory", PopupType.Normal);
                return;
            }
            UIManager.Get().ShowPopup("System:", "Part " + id + " added to inventory", PopupType.Normal);
            base.StartCoroutine(UIManager.Get().PrepareInventory());
            UIManager.Get().Show("Inventory");
        }
        this.finder = null;
    }