Advertisement
Guest User

Untitled

a guest
Oct 6th, 2023
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.01 KB | None | 0 0
  1. this.uiColor = new Color4(0.5f, 0.5f, 1f, 1f);
  2.       this.uiRaces = new UIMenu();
  3.       for (int index = 0; index < 3; ++index)
  4.       {
  5.         RaceParameters p = this.GenerateRace();
  6.         this.uiRaces.AddItem(p.Name, (Action) (() => this.game.StartRace(p)), this.uiColor);
  7.       }
  8.       this.uiUpgrades = new UIMenu[7];
  9.       for (int index1 = 0; index1 < this.uiUpgrades.Length; ++index1)
  10.       {
  11.         this.uiUpgrades[index1] = new UIMenu();
  12.         for (int index2 = 0; index2 < this.playerCar.CarInfo.Parts.Count; ++index2)
  13.         {
  14.           if (this.playerCar.CarInfo.Parts[index2].Class == index1)
  15.           {
  16.             string text = string.Format("{0} - {1}руб.", (object) this.playerCar.CarInfo.Parts[index2].Name, (object) this.playerCar.CarInfo.Parts[index2].Price);
  17.             int partId = index2;
  18.             this.uiUpgrades[index1].AddItem(text, (Action) (() => this.OnPurchasePart(partId)), this.uiColor);
  19.           }
  20.         }
  21.         this.uiUpgrades[index1].AddItem("Вернуться", (Action) (() => this.currMenu = this.uiUpgrade), this.uiColor);
  22.       }
  23.       this.uiPaintBooth = new UIMenu();
  24.       this.uiUpgrade = new UIMenu();
  25.       this.uiUpgrade.AddItem("Блок цилиндров", (Action) (() => this.currMenu = this.uiUpgrades[0]), this.uiColor);
  26.       this.uiUpgrade.AddItem("Топливная система", (Action) (() => this.currMenu = this.uiUpgrades[1]), this.uiColor);
  27.       this.uiUpgrade.AddItem("Валы", (Action) (() => this.currMenu = this.uiUpgrades[2]), this.uiColor);
  28.       this.uiUpgrade.AddItem("Зажигание", (Action) (() => this.currMenu = this.uiUpgrades[3]), this.uiColor);
  29.       this.uiUpgrade.AddItem("Турбонаддув", (Action) (() => this.currMenu = this.uiUpgrades[4]), this.uiColor);
  30.       this.uiUpgrade.AddItem("Трансмиссия", (Action) (() => this.currMenu = this.uiUpgrades[5]), this.uiColor);
  31.       this.uiUpgrade.AddItem("Шины", (Action) (() => this.currMenu = this.uiUpgrades[6]), this.uiColor);
  32.       this.uiUpgrade.AddItem("Высота пружин", (Action) (() => { }), this.uiColor);
  33.       this.uiUpgrade.AddItem("Покраска", (Action) (() => this.currentState = GarageState.PaintBooth), this.uiColor);
  34.       this.uiUpgrade.AddItem("Вернуться", (Action) (() => this.currMenu = this.uiMain), this.uiColor);
  35.       this.InitCarDealer();
  36.       this.uiMain = new UIMenu();
  37.       this.uiMain.AddItem("События", (Action) (() => this.currMenu = this.uiRaces), this.uiColor);
  38.       this.uiMain.AddItem("Тюнинг", (Action) (() => this.currMenu = this.uiUpgrade), this.uiColor);
  39.       this.uiMain.AddItem("Автосалон", (Action) (() =>
  40.       {
  41.         this.currMenu = this.uiCarDealer;
  42.         this.playerCar.Destroy();
  43.         this.playerCar = (Car) null;
  44.       }), this.uiColor);
  45.       this.uiMain.AddItem("Статистика", (Action) (() => { }), this.uiColor);
  46.       this.uiMain.AddItem("Главное меню", (Action) (() => { }), this.uiColor);
  47.       this.currMenu = this.uiMain;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement