помогите пожалуйста со скриптом, не могу понять в чем ошибка

Программирование на Юнити.

помогите пожалуйста со скриптом, не могу понять в чем ошибка

Сообщение pol1son 21 фев 2023, 19:12

ошибки:
GarageCarLineWindowV4.cs(471,72): error CS1003: Syntax error, ',' expected
GarageCarLineWindowV4.cs(471,73): error CS1002: ; expected
GarageCarLineWindowV4.cs(482,72): error CS1003: Syntax error, ',' expected
GarageCarLineWindowV4.cs(482,73): error CS1002: ; expected
GarageCarLineWindowV4.cs(484,72): error CS1003: Syntax error, ',' expected
GarageCarLineWindowV4.cs(484,73): error CS1002: ; expected

скрипт:
Синтаксис:
  1. using System; 
  2. using System.Collections.Generic; 
  3. using System.Linq; 
  4. using GlobalSequence; 
  5. using UnityEngine; 
  6.  
  7. public class GarageCarLineWindowV4 : TForm 
  8.     public static GarageCarLineWindowV4 instance 
  9.     { 
  10.         get 
  11.         { 
  12.             if (GarageCarLineWindowV4._instance == null) 
  13.             { 
  14.                 GarageCarLineWindowV4._instance = new GarageCarLineWindowV4(); 
  15.                 GarageCarLineWindowV4._instance.LoadFromXML("GarageCarLineWindowV4"); 
  16.             } 
  17.             return GarageCarLineWindowV4._instance; 
  18.         } 
  19.     } 
  20.  
  21.     private void ClearCarLineDrawers() 
  22.     { 
  23.         this.carTypeLineDictionary.Values.ToList<List<IGarageCarLineDrawer>>().ForEach(delegate(List<IGarageCarLineDrawer> x) 
  24.         { 
  25.             x.Clear(); 
  26.         }); 
  27.     } 
  28.  
  29.     private List<IGarageCarLineDrawer> GetCarLineDrawersByType(ServerDictionaries.ECarTypeIdEntity type) 
  30.     { 
  31.         return (!this.carTypeLineDictionary.ContainsKey(type)) ? null : this.carTypeLineDictionary[type]; 
  32.     } 
  33.  
  34.     private void SortCarLineDrawers() 
  35.     { 
  36.         foreach (List<IGarageCarLineDrawer> list in this.carTypeLineDictionary.Values) 
  37.         { 
  38.             list.Sort(new Comparison<IGarageCarLineDrawer>(GarageCarLineWindowV4.SortCarLineComparision)); 
  39.         } 
  40.     } 
  41.  
  42.     private static int SortCarLineComparision(IGarageCarLineDrawer x, IGarageCarLineDrawer y) 
  43.     { 
  44.         if (x == null) 
  45.         { 
  46.             return 0; 
  47.         } 
  48.         if (y == null) 
  49.         { 
  50.             return 0; 
  51.         } 
  52.         ShopItem shopItemOfCarByGOTypeId = ServerDictionariesManager.GetShopItemOfCarByGOTypeId(x.carDataInfo.carTypeEntityInstance.entityId); 
  53.         ShopItem shopItemOfCarByGOTypeId2 = ServerDictionariesManager.GetShopItemOfCarByGOTypeId(y.carDataInfo.carTypeEntityInstance.entityId); 
  54.         if (shopItemOfCarByGOTypeId == null || shopItemOfCarByGOTypeId2 == null) 
  55.         { 
  56.             return 0; 
  57.         } 
  58.         if (x is GarageDummyCarLineDrawer && !(y is GarageDummyCarLineDrawer)) 
  59.         { 
  60.             return 1; 
  61.         } 
  62.         if (!(x is GarageDummyCarLineDrawer) && y is GarageDummyCarLineDrawer) 
  63.         { 
  64.             return -1; 
  65.         } 
  66.         if (!(x is GarageDummyCarLineDrawer)) 
  67.         { 
  68.             return GarageCarLineWindowV4.CompareByGUIOrder(shopItemOfCarByGOTypeId, shopItemOfCarByGOTypeId2); 
  69.         } 
  70.         int userLevel = GamerController.gamer.UserExperience.GetUserLevel(); 
  71.         if (shopItemOfCarByGOTypeId.RequiredUserLevel > userLevel && shopItemOfCarByGOTypeId2.RequiredUserLevel <= userLevel) 
  72.         { 
  73.             return 1; 
  74.         } 
  75.         if (shopItemOfCarByGOTypeId.RequiredUserLevel <= userLevel && shopItemOfCarByGOTypeId2.RequiredUserLevel > userLevel) 
  76.         { 
  77.             return -1; 
  78.         } 
  79.         return GarageCarLineWindowV4.CompareByGUIOrder(shopItemOfCarByGOTypeId, shopItemOfCarByGOTypeId2); 
  80.     } 
  81.  
  82.     private static int CompareByGUIOrder(ShopItem x, ShopItem y) 
  83.     { 
  84.         if (x.GuiOrder > y.GuiOrder) 
  85.         { 
  86.             return -1; 
  87.         } 
  88.         if (x.GuiOrder < y.GuiOrder) 
  89.         { 
  90.             return 1; 
  91.         } 
  92.         return x.name.CompareTo(y.name); 
  93.     } 
  94.  
  95.     public static void SetCarsInGarageLineWindow() 
  96.     { 
  97.         GarageCarLineWindowV4.instance.showedGarageCarLines.Clear(); 
  98.         GarageCarLineWindowV4.instance.ClearCarLineDrawers(); 
  99.         if (GamerController.gamer.UserCars == null) 
  100.         { 
  101.             CustomLogger.LogError("GarageCarLineWindowV4.SetCarsInGarageLineWindow: GamerController.gamer.UserCars == null!", string.Empty); 
  102.             return; 
  103.         } 
  104.         List<ShopItem> list = new List<ShopItem>(); 
  105.         list.AddRange(ServerDictionariesManager.notPremiumCarsItems); 
  106.         list.AddRange(from x in ServerDictionariesManager.premiumCarsItems 
  107.         where GamerController.gamer.UserCars.IsCarExist(x.dictionaryItemId) 
  108.         select x); 
  109.         list.RemoveAll((ShopItem si) => GamerController.gamer.UserExperience.GetUserLevel() > si.MaxUserLevel && !GamerController.gamer.UserCars.IsCarExist(si.dictionaryItemId)); 
  110.         foreach (ShopItem shopItem in list) 
  111.         { 
  112.             List<IGarageCarLineDrawer> carLineDrawersByType = GarageCarLineWindowV4.instance.GetCarLineDrawersByType(shopItem.CarType); 
  113.             if (carLineDrawersByType != null) 
  114.             { 
  115.                 int count = carLineDrawersByType.Count; 
  116.                 if (GamerController.gamer.UserCars.IsCarExist(shopItem.dictionaryItemId)) 
  117.                 { 
  118.                     CarData carDataByModelId = GamerController.gamer.UserCars.GetCarDataByModelId(shopItem.dictionaryItemId); 
  119.                     carLineDrawersByType.Add(new GarageCarLineDrawer(GarageCarLineButtonType.car, count, carDataByModelId)); 
  120.                 } 
  121.                 else 
  122.                 { 
  123.                     carLineDrawersByType.Add(new GarageDummyCarLineDrawer(shopItem, count)); 
  124.                 } 
  125.             } 
  126.         } 
  127.         GarageCarLineWindowV4.instance.SortCarLineDrawers(); 
  128.     } 
  129.  
  130.     public static bool IsMouseOver 
  131.     { 
  132.         get 
  133.         { 
  134.             return GarageCarLineWindowV4.instance.isMouseOver; 
  135.         } 
  136.     } 
  137.  
  138.     public void OnShowFunc(TForm form) 
  139.     { 
  140.     } 
  141.  
  142.     public void OnCloseFunc(TForm form) 
  143.     { 
  144.     } 
  145.  
  146.     public static bool IsVisible 
  147.     { 
  148.         get 
  149.         { 
  150.             return GarageCarLineWindowV4.instance.visible; 
  151.         } 
  152.     } 
  153.  
  154.     public static Vector2 UpLeftRealCorner 
  155.     { 
  156.         get 
  157.         { 
  158.             if (GarageCarLineWindowV4.instance != null) 
  159.             { 
  160.                 return new Vector2(GarageCarLineWindowV4.instance.formRect.x, GarageCarLineWindowV4.instance.formRect.y + GarageCarLineWindowV4.instance.formRect.height - (GarageCarLineWindowV4.instance.mount.controlRect.height - 30f)); 
  161.             } 
  162.             return new Vector2(0f, 0f); 
  163.         } 
  164.     } 
  165.  
  166.     public static Vector2 UpLeftCorner 
  167.     { 
  168.         get 
  169.         { 
  170.             if (GarageCarLineWindowV4.instance != null) 
  171.             { 
  172.                 return new Vector2(GarageCarLineWindowV4.instance.formRect.x, GarageCarLineWindowV4.instance.formRect.y); 
  173.             } 
  174.             return new Vector2(0f, 0f); 
  175.         } 
  176.     } 
  177.  
  178.     public static bool IsMouseOverCarBarControl 
  179.     { 
  180.         get 
  181.         { 
  182.             return GarageCarLineWindowV4.instance.carLineControl.mouseIsOverControl; 
  183.         } 
  184.     } 
  185.  
  186.     public void OnXMLLoadedFunc(TForm form) 
  187.     { 
  188.         this.mount = base.ControlByName("mount"); 
  189.         this.leftScrollButton = base.ControlByName("leftScrollButton"); 
  190.         this.rightScrollButton = base.ControlByName("rightScrollButton"); 
  191.         this.carLineControl = base.ControlByName("carLineControl"); 
  192.         this.carLineExp = base.ControlByName("carLineExp"); 
  193.         this.carLineName = base.ControlByName("carLineName"); 
  194.         this.carEliteIcon = base.ControlByName("carEliteIcon"); 
  195.         this.carLineInfo = base.ControlByName("carLineInfo"); 
  196.         this.carRentTimer = base.ControlByName("carRentTimer"); 
  197.         this.carLineBuyButtonRect = base.ControlByName("carLineBuyButtonRect"); 
  198.         this.carLineWinX2Rect = base.ControlByName("carLineWinX2Rect"); 
  199.         this.carLineReturnButtonRect = base.ControlByName("carLineReturnButtonRect"); 
  200.         this.carLineBonusExpRect = base.ControlByName("carLineBonusExpRect"); 
  201.         this.chatsBoxControl = base.ControlByName("chatsBoxControl"); 
  202.         this.chatsBoxRewindButtonRect = base.ControlByName("chatsBoxRewindButtonRect"); 
  203.         this.chatsBoxWindowButtonRect = base.ControlByName("chatsBoxWindowButtonRect"); 
  204.         this.chatsBoxWindowsAreaRect = base.ControlByName("chatsBoxWindowsAreaRect"); 
  205.         this.tabChatButton = base.ControlByName("tabChatButton"); 
  206.         this.tabModeratorChatButton = base.ControlByName("tabModeratorChatButton"); 
  207.         this.tabQuestsButton = base.ControlByName("tabQuestsButton"); 
  208.         this.tabAchievementsButton = base.ControlByName("tabAchievementsButton"); 
  209.         this.tabActionsButton = base.ControlByName("tabActionsButton"); 
  210.         this.tabNewsButton = base.ControlByName("tabNewsButton"); 
  211.         this.tabFriendsButton = base.ControlByName("tabFriendsButton"); 
  212.         this.accordeonButton = base.ControlByName("accordeonButton"); 
  213.         this.accordeonLeftLabel = base.ControlByName("accordeonLeftLabel"); 
  214.         this.accordeonRightLabel = base.ControlByName("accordeonRightLabel"); 
  215.         this.accordeonSign = base.ControlByName("accordeonSign"); 
  216.         this.buyBackgroundRect = base.ControlByName("buyBackgroundRect"); 
  217.         this.buyLabelRect = base.ControlByName("buyLabelRect"); 
  218.         this.buyPriceRect = base.ControlByName("buyPriceRect"); 
  219.         this.silverIconRect = base.ControlByName("silverIconRect"); 
  220.         this.lockedLabelRect = base.ControlByName("lockedLabelRect"); 
  221.         this.lockedPriceRect = base.ControlByName("lockedPriceRect"); 
  222.         this.lockedIconRect = base.ControlByName("lockedIconRect"); 
  223.         this.viewRectWidth = (float)Screen.width - 4f * this.accordeonButton.controlRect.width - 2f * GarageCarLineWindowV4.scrollButtonSize.x; 
  224.         GarageCarLineWindowV4.SetWindowGeometry(false); 
  225.         this.SetCarTypeLines(); 
  226.     } 
  227.  
  228.     private void SetCarTypeLines() 
  229.     { 
  230.         this.carTypeLineDictionary.Clear(); 
  231.         foreach (object obj in Enum.GetValues(typeof(ServerDictionaries.ECarTypeIdEntity))) 
  232.         { 
  233.             ServerDictionaries.ECarTypeIdEntity key = (ServerDictionaries.ECarTypeIdEntity)((int)obj); 
  234.             this.carTypeLineDictionary.Add(key, new List<IGarageCarLineDrawer>()); 
  235.         } 
  236.     } 
  237.  
  238.     public static void ShowWindow(bool needScroll = false) 
  239.     { 
  240.         GUIMain.onScreenResolutionChanged += GarageCarLineWindowV4.OnScreenResolutionChanged; 
  241.         GamerController.gamer.UserCars.onCurrentCarChanged.onCustomEvent += GarageCarLineWindowV4.OnChangeCurrentCar; 
  242.         ShopController.OnBuyCar = (Action<NewCarProxy, DeltaMoney>)Delegate.Combine(ShopController.OnBuyCar, new Action<NewCarProxy, DeltaMoney>(GarageCarLineWindowV4.OnCarIsBought)); 
  243.         GarageCarLineWindowV4.SetWindowGeometry(false); 
  244.         GarageCarLineWindowV4.OpenLeftPanel(GarageCarLineWindowV4.instance.currentLeftMode, true); 
  245.         GarageCarLineWindowV4.OpenRightPanel(GarageCarLineWindowV4.instance.currentRightMode, true); 
  246.         GarageCarLineWindowV4.SetCarsInGarageLineWindow(); 
  247.         GarageCarLineWindowV4.instance.SetCurrent(); 
  248.         if (needScroll) 
  249.         { 
  250.             GarageCarLineWindowV4.instance.ScrollToCurrentCar(); 
  251.         } 
  252.         GarageCarLineWindowV4.instance.SetCarScrollButtons(); 
  253.         GarageCarLineWindowV4.instance.Show(); 
  254.     } 
  255.  
  256.     private void ScrollToCurrentCar() 
  257.     { 
  258.         IGarageCarLineDrawer current = this.GetCurrent(); 
  259.         if (current == null || current.carDataInfo == null || current.carDataInfo.carTypeEntityInstance == null) 
  260.         { 
  261.             return; 
  262.         } 
  263.         ServerDictionaries.ECarTypeIdEntity carTypeId = current.carDataInfo.carTypeEntityInstance.carTypeId; 
  264.         this.SetCarLineDrawersByType(carTypeId); 
  265.         CustomLogger.LogDebug("GarageCarLineWindowV4.ScrollToCurrentCar: " + carTypeId, string.Empty); 
  266.     } 
  267.  
  268.     private static void SetCarLineMode() 
  269.     { 
  270.         if (GamerController.gamer.UserCars.CurrentCar != null) 
  271.         { 
  272.             GarageCarLineWindowV4.instance.currentSelectedCarType = GamerController.gamer.UserCars.CurrentCar.carTypeEntityInstance.carTypeId; 
  273.         } 
  274.     } 
  275.  
  276.     private static void OnCarIsBought(NewCarProxy arg1, DeltaMoney arg2) 
  277.     { 
  278.         GarageCarLineWindowV4.instance.SetCurrent(); 
  279.     } 
  280.  
  281.     public static void HideWindow() 
  282.     { 
  283.         GUIMain.onScreenResolutionChanged -= GarageCarLineWindowV4.OnScreenResolutionChanged; 
  284.         GamerController.gamer.UserCars.onCurrentCarChanged.onCustomEvent -= GarageCarLineWindowV4.OnChangeCurrentCar; 
  285.         ShopController.OnBuyCar = (Action<NewCarProxy, DeltaMoney>)Delegate.Remove(ShopController.OnBuyCar, new Action<NewCarProxy, DeltaMoney>(GarageCarLineWindowV4.OnCarIsBought)); 
  286.         GarageCarLineWindowV4.instance.OpenLeftPanelInternal(GarageCarLineWindowV4.instance.currentLeftMode, false, true); 
  287.         GarageCarLineWindowV4.instance.OpenRightPanelInternal(GarageCarLineWindowV4.instance.currentRightMode, false, true); 
  288.         GarageCarLineWindowV4.instance.Hide(); 
  289.     } 
  290.  
  291.     private static void OnScreenResolutionChanged(Vector2 resolution) 
  292.     { 
  293.         GarageCarLineWindowV4.SetWindowGeometry(false); 
  294.         GarageCarLineWindowV4.SetCarsInGarageLineWindow(); 
  295.         GarageCarLineWindowV4.instance.SetCarScrollButtons(); 
  296.     } 
  297.  
  298.     private static void OnChangeCurrentCar() 
  299.     { 
  300.         GarageCarLineWindowV4.SetCarLineMode(); 
  301.         GarageCarLineWindowV4.instance.SetCurrent(); 
  302.     } 
  303.  
  304.     private void SetWindowRect() 
  305.     { 
  306.         Rect baseRect = new Rect(GarageCarLineWindowV4.instance.baseRect.x, GarageCarLineWindowV4.instance.baseRect.y, (float)Screen.width, GarageCarLineWindowV4.instance.height); 
  307.         base.SetBaseRect(baseRect); 
  308.         this.mount.SetBaseRect(new Rect(0f, 0f, (float)Screen.width, this.mount.controlRect.height)); 
  309.         this.carPanelRect.width = (float)Screen.width; 
  310.         this.carPanelRect.height = this.carLineControl.controlRect.height; 
  311.         this.countOfshowdButtons = Mathf.Max(0, Mathf.FloorToInt(this.viewRectWidth / (this.buttonSize.x + this.shiftBetweenCarButtons))); 
  312.         this.carLineControl.controlRect = this.carPanelRect; 
  313.         CustomLogger.LogInfo("carLineControl.controlRect " + this.carLineControl.controlRect.ToString(), string.Empty); 
  314.         CustomLogger.LogInfo("carPanelRect.width = " + this.carPanelRect.width.ToString(), string.Empty); 
  315.         CustomLogger.LogInfo("countOfshowdButtons = " + this.countOfshowdButtons.ToString(), string.Empty); 
  316.     } 
  317.  
  318.     public static void SetWindowGeometry(bool changeMode = false) 
  319.     { 
  320.         GarageCarLineWindowV4.instance.SetWindowRect(); 
  321.     } 
  322.  
  323.     public void OnPaintGarageCarLineWindowV4(TForm form) 
  324.     { 
  325.         bool flag = !GarageSkinsWindowV3.IsVisible; 
  326.         this.DrawTabButtons(flag); 
  327.         this.DrawButtonFlash(NoticesController.HoverFloat, this.tabNewsButton.controlRect, flag); 
  328.         this.DrawButtonFlash(PromotionController.HoverFloat, this.tabActionsButton.controlRect, flag); 
  329.         this.DrawButtonFlash(UserMissions.HoverFloat, this.tabQuestsButton.controlRect, flag); 
  330.     } 
  331.  
  332.     private void DrawButtonFlash(float value, Rect rect, bool visible) 
  333.     { 
  334.         if (!visible) 
  335.         { 
  336.             return; 
  337.         } 
  338.         if (value > 0f) 
  339.         { 
  340.             Color color = GUI.color; 
  341.             Color color2 = GUI.color; 
  342.             color2.a = value; 
  343.             GUI.color = color2; 
  344.             GUI.DrawTexture(rect, GarageCarLineWindowV4.flashIcon.icon); 
  345.             GUI.color = color; 
  346.         } 
  347.     } 
  348.  
  349.     private Vector2 GetCurrentScrollPos() 
  350.     { 
  351.         return this.GetScrollPos(this.currentSelectedCarType); 
  352.     } 
  353.  
  354.     private Vector2 GetScrollPos(ServerDictionaries.ECarTypeIdEntity carType) 
  355.     { 
  356.         if (GarageCarLineWindowV4.scrollsPos.ContainsKey(carType)) 
  357.         { 
  358.             return GarageCarLineWindowV4.scrollsPos[carType]; 
  359.         } 
  360.         GarageCarLineWindowV4.scrollsPos.Add(carType, this.DEFAULT_SCROLL_POS); 
  361.         return this.DEFAULT_SCROLL_POS; 
  362.     } 
  363.  
  364.     private void SetScrollPos(ServerDictionaries.ECarTypeIdEntity carType, float x) 
  365.     { 
  366.         Vector2 scrollPos = this.GetScrollPos(carType); 
  367.         scrollPos.x = x; 
  368.         this.SetScrollPos(carType, scrollPos); 
  369.     } 
  370.  
  371.     private void SetScrollPos(ServerDictionaries.ECarTypeIdEntity carType, Vector2 scrollPos) 
  372.     { 
  373.         if (GarageCarLineWindowV4.scrollsPos.ContainsKey(carType)) 
  374.         { 
  375.             GarageCarLineWindowV4.scrollsPos[carType] = scrollPos; 
  376.         } 
  377.         else 
  378.         { 
  379.             GarageCarLineWindowV4.scrollsPos.Add(carType, scrollPos); 
  380.         } 
  381.     } 
  382.  
  383.     public void OnPaintCarLineControl(object control) 
  384.     { 
  385.         if (!GlobalSequenceController.IsActive(GlobalStateIds.GARAGE)) 
  386.         { 
  387.             return; 
  388.         } 
  389.         this.carLineControl.width = this.carPanelRect.width; 
  390.         this.UpdateChatsBoxStyles(); 
  391.         Rect rect = new Rect(0f, 5f, this.buttonSize.x, this.buttonSize.y); 
  392.         if (GarageCarLineWindowV4.carScrollMoving) 
  393.         { 
  394.             this.SetScrollPos(this.currentSelectedCarType, GarageCarLineWindowV4.carScrollValue.value); 
  395.             TForm.HideTooltipsWindows(false); 
  396.         } 
  397.         int num = 0; 
  398.         foreach (ServerDictionaries.ECarTypeIdEntity carType in this.carTypeLineDictionary.Keys) 
  399.         { 
  400.             num++; 
  401.             bool carTypeChanged = false; 
  402.             this.DrawAccordeonButton(carType, ref rect, ref carTypeChanged); 
  403.             this.DrawCarsOfType(carType, num, ref rect, carTypeChanged); 
  404.         } 
  405.     } 
  406.  
  407.     private void DrawAccordeonButton(ServerDictionaries.ECarTypeIdEntity carType, ref Rect _itemRect, ref bool carTypeChanged) 
  408.     { 
  409.         string buttonName = string.Empty; 
  410.         IconHolder emptyIcon = IconHolder.EmptyIcon; 
  411.         switch (carType) 
  412.         { 
  413.         case ServerDictionaries.ECarTypeIdEntity.SCOUT: 
  414.             buttonName = LocaleResources.GetStringByName("garage_shop_accordeon_scout_string"); 
  415.             emptyIcon = GarageCarLineWindowV4.scoutSign24x24; 
  416.             break; 
  417.         case ServerDictionaries.ECarTypeIdEntity.STORMTANK: 
  418.             emptyIcon = GarageCarLineWindowV4.heavySign24x24; 
  419.             buttonName = LocaleResources.GetStringByName("garage_shop_accordeon_heavy_string"); 
  420.             break; 
  421.         case ServerDictionaries.ECarTypeIdEntity.ENGINEER: 
  422.             emptyIcon = GarageCarLineWindowV4.engineerSign24x24; 
  423.             buttonName = LocaleResources.GetStringByName("garage_shop_accordeon_engineer_string"); 
  424.             break; 
  425.         case ServerDictionaries.ECarTypeIdEntity.ARTILLERY: 
  426.             emptyIcon = GarageCarLineWindowV4.artillerySign24x24; 
  427.             buttonName = LocaleResources.GetStringByName("garage_shop_accordeon_artillery_string"); 
  428.             break; 
  429.         } 
  430.         Rect a = new Rect(0f, -5f, 0f, 0f); 
  431.         if (TGUI.Button(this, Utils.SumRect(a, Utils.SumRect(_itemRect, this.accordeonButton.controlRect)), string.Empty, this.garageShopAccordeonButton)) 
  432.         { 
  433.             carTypeChanged = this.SetCarLineDrawersByType(carType); 
  434.         } 
  435.         bool flag = _itemRect.x < this.formRect.width / 2f; 
  436.         bool flag2 = this.currentSelectedCarType == carType; 
  437.         TControl tcontrol = (!flag) ? this.accordeonRightLabel : this.accordeonLeftLabel; 
  438.         GUIStyle labelStyle; 
  439.         if (flag2) 
  440.         { 
  441.             labelStyle = ((!flag) ? this.garageCarLineAccordeonRightLabelStyle : this.garageCarLineAccordeonLeftLabelStyle); 
  442.         } 
  443.         else 
  444.         { 
  445.             labelStyle = ((!flag) ? this.garageCarLineAccordeonRightDisabledLabelStyle : this.garageCarLineAccordeonLeftDisabledLabelStyle); 
  446.         } 
  447.         Rect labelRect = Utils.SumRect(_itemRect, tcontrol.controlRect); 
  448.         TGUI.RotateAroundPivot(tcontrol.rotatePivot, tcontrol.rotateAngle, labelRect, delegate 
  449.         { 
  450.             GUI.Label(labelRect, buttonName, labelStyle); 
  451.         }); 
  452.         GUI.DrawTexture(Utils.SumRect(_itemRect, this.accordeonSign.controlRect), emptyIcon.icon); 
  453.         _itemRect.x += this.accordeonButton.controlRect.width; 
  454.     } 
  455.  
  456.     private bool SetCarLineDrawersByType(ServerDictionaries.ECarTypeIdEntity carType) 
  457.     { 
  458.         if (!GarageCarLineWindowV4.carScrollMoving && this.currentSelectedCarType != carType) 
  459.         { 
  460.             this.currentSelectedCarType = carType; 
  461.             return true; 
  462.         } 
  463.         return false; 
  464.     } 
  465.  
  466.     private void DrawCarsOfType(ServerDictionaries.ECarTypeIdEntity carType, int num, ref Rect refRect, bool carTypeChanged) 
  467.     { 
  468.         if (this.currentSelectedCarType == carType) 
  469.         { 
  470.             GarageCarLineWindowV4.DrawCarsOfType.c__AnonStorey105 DrawCarsOfType.c__AnonStorey = new GarageCarLineWindowV4.DrawCarsOfType.c__AnonStorey105(); 
  471.             DrawCarsOfType.c__AnonStorey.f__this = this; 
  472.             this.leftScrollButton.left = refRect.x; 
  473.             refRect.x += this.leftScrollButton.width; 
  474.             this.currentGarageCarLines = this.GetCarLineDrawersByType(carType); 
  475.             if (this.currentGarageCarLines == null) 
  476.             { 
  477.                 return; 
  478.             } 
  479.             DrawCarsOfType.c__AnonStorey.viewRect = this.carLineControl.GetSizeRect(); 
  480.             float x = refRect.x; 
  481.             GarageCarLineWindowV4.DrawCarsOfType.c__AnonStorey105 DrawCarsOfType.c__AnonStorey2 = DrawCarsOfType.c__AnonStorey; 
  482.             DrawCarsOfType.c__AnonStorey2.viewRect.x = DrawCarsOfType.c__AnonStorey2.viewRect.x + (0f + this.accordeonButton.controlRect.width * (float)num + this.leftScrollButton.width); 
  483.             GarageCarLineWindowV4.DrawCarsOfType.c__AnonStorey105 DrawCarsOfType.c__AnonStorey3 = DrawCarsOfType.c__AnonStorey; 
  484.             DrawCarsOfType.c__AnonStorey3.viewRect.width = DrawCarsOfType.c__AnonStorey3.viewRect.width - (4f * this.accordeonButton.controlRect.width + this.leftScrollButton.width + this.rightScrollButton.width); 
  485.             Rect viewRect = DrawCarsOfType.c__AnonStorey.viewRect; 
  486.             viewRect.width = (this.buttonSize.x + this.shiftBetweenCarButtons) * (float)this.currentGarageCarLines.Count; 
  487.             this.carViewBoxSize = new Vector2(viewRect.width, viewRect.height); 
  488.             DrawCarsOfType.c__AnonStorey.rect = refRect; 
  489.             DrawCarsOfType.c__AnonStorey.scrollPos = this.GetCurrentScrollPos(); 
  490.             Action onDraw = delegate() 
  491.             { 
  492.                 bool enabled = GUI.enabled; 
  493.                 GUI.enabled = SpawnController.IsPreviousCarCreated; 
  494.                 for (int i = 0; i < DrawCarsOfType.c__AnonStorey.f__this.currentGarageCarLines.Count; i++) 
  495.                 { 
  496.                     IGarageCarLineDrawer garageCarLineDrawer = DrawCarsOfType.c__AnonStorey.f__this.currentGarageCarLines[i]; 
  497.                     if (garageCarLineDrawer != null) 
  498.                     { 
  499.                         Rect a = Utils.SumRect(DrawCarsOfType.c__AnonStorey.f__this.formRect, DrawCarsOfType.c__AnonStorey.f__this.carLineControl.controlRect); 
  500.                         Rect rect = Utils.SumRect(DrawCarsOfType.c__AnonStorey.f__this.formRect, DrawCarsOfType.c__AnonStorey.viewRect); 
  501.                         Rect rect2 = Utils.SumRect(a, DrawCarsOfType.c__AnonStorey.rect); 
  502.                         Rect rect3 = Utils.SumRect(rect2, DrawCarsOfType.c__AnonStorey.f__this.carLineWinX2Rect.controlRect); 
  503.                         Rect screenRect = Utils.GetScreenRect(DrawCarsOfType.c__AnonStorey.scrollPos, rect3); 
  504.                         Rect screenRect2 = Utils.GetScreenRect(DrawCarsOfType.c__AnonStorey.scrollPos, rect2); 
  505.                         Rect rect4 = Utils.SumRect(rect2, DrawCarsOfType.c__AnonStorey.f__this.carLineReturnButtonRect.controlRect); 
  506.                         Rect screenRect3 = Utils.GetScreenRect(DrawCarsOfType.c__AnonStorey.scrollPos, rect4); 
  507.                         bool carButtonOver = false; 
  508.                         if (a.Contains(GUIMain.mousePositionV2) && screenRect.Contains(GUIMain.mousePositionV2) && TForm.CanShowTooltip(DrawCarsOfType.c__AnonStorey.f__this) && garageCarLineDrawer is GarageCarLineDrawer) 
  509.                         { 
  510.                             GarageCarLineDrawer garageCarLineDrawer2 = garageCarLineDrawer as GarageCarLineDrawer; 
  511.                             if (garageCarLineDrawer2.carData != null && garageCarLineDrawer2.carData.isFirstWinBonusActive) 
  512.                             { 
  513.                                 GarageCarLineBonusX2TooltipWindow.ShowWindow(GUIMain.mousePositionV2 + 5f * Vector2.up); 
  514.                             } 
  515.                         } 
  516.                         if (rect.Contains(GUIMain.mousePositionV2) && screenRect2.Contains(GUIMain.mousePositionV2)) 
  517.                         { 
  518.                             carButtonOver = true; 
  519.                             long entityId = garageCarLineDrawer.carDataInfo.carTypeEntityInstance.entityId; 
  520.                             List<long> list = null; 
  521.                             if (garageCarLineDrawer is GarageCarLineDrawer) 
  522.                             { 
  523.                                 CarData carDataByModelId = GamerController.gamer.UserCars.GetCarDataByModelId(entityId); 
  524.                                 if (carDataByModelId != null) 
  525.                                 { 
  526.                                     list = (from x in carDataByModelId.serverCarData.serverCarItems 
  527.                                     select x.serverInstanceId).ToList<long>(); 
  528.                                 } 
  529.                             } 
  530.                             if (garageCarLineDrawer is GarageDummyCarLineDrawer) 
  531.                             { 
  532.                                 list = (from x in (garageCarLineDrawer as GarageDummyCarLineDrawer).showedModuleList 
  533.                                 select x.goTypeId).ToList<long>(); 
  534.                                 list.AddRange((from x in (garageCarLineDrawer as GarageDummyCarLineDrawer).showedBarrelsList 
  535.                                 select x.goTypeId).ToList<long>()); 
  536.                             } 
  537.                             if (list != null) 
  538.                             { 
  539.                                 GarageCarMiniProfileWindowV3.ShowWindow(garageCarLineDrawer, DrawCarsOfType.c__AnonStorey.f__this, GamerController.gamer.UserCars, entityId, list, GUIMain.mousePositionV2); 
  540.                             } 
  541.                         } 
  542.                         if (!screenRect2.Contains(GUIMain.mousePositionV2)) 
  543.                         { 
  544.                             GarageCarMiniProfileWindowV3.HideWindow(garageCarLineDrawer, DrawCarsOfType.c__AnonStorey.f__this); 
  545.                         } 
  546.                         if (!rect.Contains(GUIMain.mousePositionV2)) 
  547.                         { 
  548.                             GarageCarMiniProfileWindowV3.HideWindow(null, DrawCarsOfType.c__AnonStorey.f__this); 
  549.                         } 
  550.                         bool carReturnButtonOver = screenRect3.Contains(GUIMain.mousePositionV2); 
  551.                         bool flag = garageCarLineDrawer.Draw(DrawCarsOfType.c__AnonStorey.rect, DrawCarsOfType.c__AnonStorey.f__this, DrawCarsOfType.c__AnonStorey.f__this.carLineExp, DrawCarsOfType.c__AnonStorey.f__this.carLineName, DrawCarsOfType.c__AnonStorey.f__this.carEliteIcon, DrawCarsOfType.c__AnonStorey.f__this.carLineInfo, DrawCarsOfType.c__AnonStorey.f__this.carRentTimer, DrawCarsOfType.c__AnonStorey.f__this.carLineReturnButtonRect, DrawCarsOfType.c__AnonStorey.f__this.carLineWinX2Rect, DrawCarsOfType.c__AnonStorey.f__this.carLineBonusExpRect, DrawCarsOfType.c__AnonStorey.f__this.carLineBuyButtonRect.controlRect, carButtonOver, carReturnButtonOver, DrawCarsOfType.c__AnonStorey.f__this.buyBackgroundRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.buyLabelRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.buyPriceRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.silverIconRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.lockedLabelRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.lockedPriceRect.controlRect, DrawCarsOfType.c__AnonStorey.f__this.lockedIconRect.controlRect); 
  552.                         if (flag) 
  553.                         { 
  554.                             DrawCarsOfType.c__AnonStorey.f__this.SetCurrent(garageCarLineDrawer); 
  555.                         } 
  556.                         garageCarLineDrawer.scrollPos = DrawCarsOfType.c__AnonStorey.rect.x - DrawCarsOfType.c__AnonStorey.f__this.shiftBetweenCarButtons / 2f; 
  557.                         DrawCarsOfType.c__AnonStorey.rect.x = DrawCarsOfType.c__AnonStorey.rect.x + (DrawCarsOfType.c__AnonStorey.f__this.buttonSize.x + DrawCarsOfType.c__AnonStorey.f__this.shiftBetweenCarButtons); 
  558.                         Event current = Event.current; 
  559.                         if (current.type == EventType.ScrollWheel && !GarageEquipmentSetupWindowV3.IsMouseOver && !GarageConsumableSetupWindowV3.IsMouseOver && !GarageCarLineWindowV4.carScrollMoving && GarageCarLineWindowV4.IsMouseOverCarBarControl) 
  560.                         { 
  561.                             if (current.delta.y < 0f) 
  562.                             { 
  563.                                 DrawCarsOfType.c__AnonStorey.f__this.ScrollMovePrevoiusCar(); 
  564.                             } 
  565.                             else 
  566.                             { 
  567.                                 DrawCarsOfType.c__AnonStorey.f__this.ScrollMoveNextCar(); 
  568.                             } 
  569.                         } 
  570.                     } 
  571.                 } 
  572.                 GUI.enabled = enabled; 
  573.             }; 
  574.             Vector2 vector = TGUI.ScrollView(this, DrawCarsOfType.c__AnonStorey.viewRect, DrawCarsOfType.c__AnonStorey.scrollPos, viewRect, this.garageChatsBoxScrollStyle, this.garageChatsBoxScrollStyle, onDraw); 
  575.             this.rightScrollButton.left = x + DrawCarsOfType.c__AnonStorey.viewRect.width; 
  576.             this.SetScrollPos(this.currentSelectedCarType, (!GarageCarLineWindowV4.IsMouseOverCarBarControl) ? DrawCarsOfType.c__AnonStorey.scrollPos : vector); 
  577.             refRect.x = x + DrawCarsOfType.c__AnonStorey.viewRect.width + this.rightScrollButton.width; 
  578.             if (carTypeChanged) 
  579.             { 
  580.                 this.SetCarScrollButtons(); 
  581.             } 
  582.         } 
  583.     } 
  584.  
  585.     private void SetCurrent(IGarageCarLineDrawer carHolder) 
  586.     { 
  587.         foreach (List<IGarageCarLineDrawer> list in this.carTypeLineDictionary.Values) 
  588.         { 
  589.             list.ForEach(delegate(IGarageCarLineDrawer x) 
  590.             { 
  591.                 x.isCurrent = false; 
  592.             }); 
  593.         } 
  594.         carHolder.isCurrent = true; 
  595.         CustomLogger.LogInfo("GarageCarLineWindowV4.SetCurrent: id=" + carHolder.carDataInfo.carTypeEntityInstance.entityId, string.Empty); 
  596.     } 
  597.  
  598.     private void SetCurrent() 
  599.     { 
  600.         long currentId = GamerController.gamer.UserCars.CurrentCar.carTypeEntityInstance.entityId; 
  601.         CustomLogger.LogInfo("GarageCarLineWindowV4.SetCurrent: current=" + currentId, string.Empty); 
  602.         foreach (List<IGarageCarLineDrawer> list in this.carTypeLineDictionary.Values) 
  603.         { 
  604.             list.ForEach(delegate(IGarageCarLineDrawer x) 
  605.             { 
  606.                 x.isCurrent = (x.carDataInfo.carTypeEntityInstance.entityId == currentId); 
  607.             }); 
  608.         } 
  609.     } 
  610.  
  611.     private IGarageCarLineDrawer GetCurrent() 
  612.     { 
  613.         long currentId = GamerController.gamer.UserCars.CurrentCar.carTypeEntityInstance.entityId; 
  614.         foreach (List<IGarageCarLineDrawer> list in this.carTypeLineDictionary.Values) 
  615.         { 
  616.             IGarageCarLineDrawer garageCarLineDrawer = list.Find((IGarageCarLineDrawer x) => x.carDataInfo.carTypeEntityInstance.entityId == currentId); 
  617.             if (garageCarLineDrawer != null) 
  618.             { 
  619.                 return garageCarLineDrawer; 
  620.             } 
  621.         } 
  622.         return null; 
  623.     } 
  624.  
  625.     public void OnPressLeftScrollButton(object control) 
  626.     { 
  627.         this.ScrollMovePrevoiusCar(); 
  628.     } 
  629.  
  630.     private void OnScrollMoveEnd() 
  631.     { 
  632.         GarageCarLineWindowV4.carScrollMoving = false; 
  633.         this.SetScrollPos(this.currentSelectedCarType, this.carScrollEndPosition); 
  634.         this.SetCarScrollButtons(); 
  635.     } 
  636.  
  637.     private void ScrollMovePrevoiusCar() 
  638.     { 
  639.         if (this.leftScrollButton.style == "garageCarLineLeftScrollNotActiveButtonV3") 
  640.         { 
  641.             return; 
  642.         } 
  643.         if (GarageCarLineWindowV4.carScrollMoving) 
  644.         { 
  645.             return; 
  646.         } 
  647.         GarageCarLineWindowV4.carScrollMoving = true; 
  648.         Vector2 currentScrollPos = this.GetCurrentScrollPos(); 
  649.         float num = (this.buttonSize.x + this.shiftBetweenCarButtons) * 4f; 
  650.         this.carScrollEndPosition = currentScrollPos.x - num; 
  651.         TimeUpdateController.AddLinearTimer(currentScrollPos.x, this.carScrollEndPosition, 0.25f, ref GarageCarLineWindowV4.carScrollValue, new Action(this.OnScrollMoveEnd)); 
  652.     } 
  653.  
  654.     public void OnPressRightScrollButton(object control) 
  655.     { 
  656.         this.ScrollMoveNextCar(); 
  657.     } 
  658.  
  659.     private void ScrollMoveNextCar() 
  660.     { 
  661.         if (this.rightScrollButton.style == "garageCarLineRightScrollNotActiveButtonV3") 
  662.         { 
  663.             return; 
  664.         } 
  665.         if (GarageCarLineWindowV4.carScrollMoving) 
  666.         { 
  667.             return; 
  668.         } 
  669.         GarageCarLineWindowV4.carScrollMoving = true; 
  670.         Vector2 currentScrollPos = this.GetCurrentScrollPos(); 
  671.         float num = (this.buttonSize.x + this.shiftBetweenCarButtons) * 4f; 
  672.         this.carScrollEndPosition = currentScrollPos.x + num; 
  673.         TimeUpdateController.AddLinearTimer(currentScrollPos.x, this.carScrollEndPosition, 0.2f, ref GarageCarLineWindowV4.carScrollValue, new Action(this.OnScrollMoveEnd)); 
  674.     } 
  675.  
  676.     private void SetCarScrollButtons() 
  677.     { 
  678.         if (this.currentGarageCarLines == null || this.currentGarageCarLines.Count == 0) 
  679.         { 
  680.             this.currentGarageCarLines = this.GetCarLineDrawersByType(this.currentSelectedCarType); 
  681.         } 
  682.         float num = (this.buttonSize.x + this.shiftBetweenCarButtons) * (float)this.currentGarageCarLines.Count; 
  683.         this.leftScrollButton.style = "garageCarLineLeftScrollNotActiveButtonV3"; 
  684.         this.rightScrollButton.style = "garageCarLineRightScrollNotActiveButtonV3"; 
  685.         Vector2 currentScrollPos = this.GetCurrentScrollPos(); 
  686.         CustomLogger.LogInfo(string.Concat(new object[] 
  687.         { 
  688.             "SetCarScrollButtons scrollPos.x=", 
  689.             currentScrollPos.x, 
  690.             " carViewBoxSize.x=", 
  691.             this.carViewBoxSize.x 
  692.         }), string.Empty); 
  693.         CustomLogger.LogInfo(string.Concat(new object[] 
  694.         { 
  695.             "SetCarScrollButtons count=", 
  696.             this.currentGarageCarLines.Count, 
  697.             " countOfshowdButtons=", 
  698.             this.countOfshowdButtons 
  699.         }), string.Empty); 
  700.         if (currentScrollPos.x > 0f) 
  701.         { 
  702.             this.leftScrollButton.style = "garageCarLineLeftScrollButtonV3"; 
  703.         } 
  704.         if (currentScrollPos.x < num - this.viewRectWidth && this.currentGarageCarLines.Count > this.countOfshowdButtons) 
  705.         { 
  706.             this.rightScrollButton.style = "garageCarLineRightScrollButtonV3"; 
  707.         } 
  708.     } 
  709.  
  710.     public void OnPressMenuButton(object control) 
  711.     { 
  712.         ExitGarageMenuWindowV3.ShowWindow(); 
  713.     } 
  714.  
  715.     public void OnPressSquadButton(object control) 
  716.     { 
  717.     } 
  718.  
  719.     public void UpdateChatsBoxStyles() 
  720.     { 
  721.         if (this.garageChatsBoxLeftRewindActiveStyle == null) 
  722.         { 
  723.             this.garageChatsBoxLeftRewindActiveStyle = GUI.skin.FindStyle("garageChatsBoxLeftRewindActive"); 
  724.         } 
  725.         if (this.garageChatsBoxLeftRewindNotactiveStyle == null) 
  726.         { 
  727.             this.garageChatsBoxLeftRewindNotactiveStyle = GUI.skin.FindStyle("garageChatsBoxLeftRewindNotactive"); 
  728.         } 
  729.         if (this.garageChatsBoxRightRewindActiveStyle == null) 
  730.         { 
  731.             this.garageChatsBoxRightRewindActiveStyle = GUI.skin.FindStyle("garageChatsBoxRightRewindActive"); 
  732.         } 
  733.         if (this.garageChatsBoxRightRewindNotactiveStyle == null) 
  734.         { 
  735.             this.garageChatsBoxRightRewindNotactiveStyle = GUI.skin.FindStyle("garageChatsBoxRightRewindNotactive"); 
  736.         } 
  737.         if (this.garageChatsBoxMinimizedChatButtonStyle == null) 
  738.         { 
  739.             this.garageChatsBoxMinimizedChatButtonStyle = GUI.skin.FindStyle("garageChatsBoxMinimizedChatButton"); 
  740.         } 
  741.         if (this.garageChatsBoxMaximizedChatButtonStyle == null) 
  742.         { 
  743.             this.garageChatsBoxMaximizedChatButtonStyle = GUI.skin.FindStyle("garageChatsBoxMaximizedChatButton"); 
  744.         } 
  745.         if (this.garageChatsBoxClosedIncomeChatButtonStyle == null) 
  746.         { 
  747.             this.garageChatsBoxClosedIncomeChatButtonStyle = GUI.skin.FindStyle("garageChatsBoxClosedIncomeChatButton"); 
  748.         } 
  749.         if (this.garageChatsBoxScrollStyle == null) 
  750.         { 
  751.             this.garageChatsBoxScrollStyle = GUI.skin.FindStyle("garageChatsBoxVerticalScrollbar"); 
  752.         } 
  753.         if (this.garageShopAccordeonButton == null) 
  754.         { 
  755.             this.garageShopAccordeonButton = GUI.skin.FindStyle("garageHorizontalAccordeonButton"); 
  756.         } 
  757.         if (this.garageShopRepayDescStyleV3 == null) 
  758.         { 
  759.             this.garageShopRepayDescStyleV3 = GUI.skin.FindStyle("garageShopRepayDescStyleV3"); 
  760.         } 
  761.         if (this.garageCarLinePriceStyle == null) 
  762.         { 
  763.             this.garageCarLinePriceStyle = GUI.skin.FindStyle("garageCarLinePriceStyle"); 
  764.         } 
  765.         if (this.garageCarLineAccordeonLeftLabelStyle == null) 
  766.         { 
  767.             this.garageCarLineAccordeonLeftLabelStyle = GUI.skin.FindStyle("garageCarLineAccordeonLeftLabelstyle"); 
  768.         } 
  769.         if (this.garageCarLineAccordeonLeftDisabledLabelStyle == null) 
  770.         { 
  771.             this.garageCarLineAccordeonLeftDisabledLabelStyle = GUI.skin.FindStyle("garageCarLineAccordeonLeftDisabledLabelStyle"); 
  772.         } 
  773.         if (this.garageCarLineAccordeonRightDisabledLabelStyle == null) 
  774.         { 
  775.             this.garageCarLineAccordeonRightDisabledLabelStyle = GUI.skin.FindStyle("garageCarLineAccordeonRightDisabledLabelStyle"); 
  776.         } 
  777.         if (this.garageCarLineAccordeonRightLabelStyle == null) 
  778.         { 
  779.             this.garageCarLineAccordeonRightLabelStyle = GUI.skin.FindStyle("garageCarLineAccordeonRightLabelstyle"); 
  780.         } 
  781.     } 
  782.  
  783.     public static void AddPanelButton(GarageDownPanelButton button, GarageDownPanelButton.ButtonState state = GarageDownPanelButton.ButtonState.maximized) 
  784.     { 
  785.         if (GarageCarLineWindowV4.instance != null) 
  786.         { 
  787.             button.SetStatus(state); 
  788.             GarageCarLineWindowV4.instance.panelButtons.Add(button); 
  789.         } 
  790.     } 
  791.  
  792.     public static void RemovePanelButton(GaragePrivateChatWindow window) 
  793.     { 
  794.         if (GarageCarLineWindowV4.instance != null) 
  795.         { 
  796.             int num = -1; 
  797.             for (int i = 0; i < GarageCarLineWindowV4.instance.panelButtons.Count; i++) 
  798.             { 
  799.                 if (GarageCarLineWindowV4.instance.panelButtons[i] is ChatPanelButton && (GarageCarLineWindowV4.instance.panelButtons[i] as ChatPanelButton).chatWindow.Chater.UserId == window.Chater.UserId) 
  800.                 { 
  801.                     num = i; 
  802.                 } 
  803.             } 
  804.             if (num > -1) 
  805.             { 
  806.                 GarageCarLineWindowV4.instance.panelButtons.RemoveAt(num); 
  807.             } 
  808.         } 
  809.     } 
  810.  
  811.     public static void RemovePanelButton(GarageDownPanelButton buttonToRemove) 
  812.     { 
  813.         if (GarageCarLineWindowV4.instance != null) 
  814.         { 
  815.             GarageCarLineWindowV4.instance.panelButtons.Remove(buttonToRemove); 
  816.         } 
  817.     } 
  818.  
  819.     public static InvitePanelButton ContainInviteButton(long userId) 
  820.     { 
  821.         foreach (GarageDownPanelButton garageDownPanelButton in GarageCarLineWindowV4.instance.panelButtons) 
  822.         { 
  823.             InvitePanelButton invitePanelButton = garageDownPanelButton as InvitePanelButton; 
  824.             if (invitePanelButton != null && invitePanelButton.inviter.UserId == userId) 
  825.             { 
  826.                 return invitePanelButton; 
  827.             } 
  828.         } 
  829.         return null; 
  830.     } 
  831.  
  832.     public void OnPaintChatsBoxControl(object control) 
  833.     { 
  834.         if (this.panelButtons.Count == 0) 
  835.         { 
  836.             return; 
  837.         } 
  838.         this.UpdateChatsBoxStyles(); 
  839.         Rect rect = new Rect(0f, this.chatsBoxControl.height / 2f - this.chatsBoxRewindButtonRect.height / 2f, this.chatsBoxRewindButtonRect.width, this.chatsBoxRewindButtonRect.height); 
  840.         Rect rect2 = new Rect(this.chatsBoxControl.width - this.chatsBoxRewindButtonRect.width, this.chatsBoxControl.height / 2f - this.chatsBoxRewindButtonRect.height / 2f, this.chatsBoxRewindButtonRect.width, this.chatsBoxRewindButtonRect.height); 
  841.         Rect rect3 = new Rect(this.chatsBoxWindowsAreaRect.controlRect.x, 0f, this.chatsBoxWindowsAreaRect.controlRect.width, this.chatsBoxWindowsAreaRect.controlRect.height); 
  842.         Rect viewRect = rect3; 
  843.         viewRect.width = this.chatsBoxWindowButtonRect.controlRect.width * (float)this.panelButtons.Count; 
  844.         viewRect.height += 20f; 
  845.         GUIStyle style = (this.chatsBoxScrollPos.x != 0f) ? this.garageChatsBoxLeftRewindActiveStyle : this.garageChatsBoxLeftRewindNotactiveStyle; 
  846.         if (TGUI.RepeatButton(this, rect, string.Empty, style)) 
  847.         { 
  848.             this.chatsBoxScrollPos.x = this.chatsBoxScrollPos.x - 10f; 
  849.         } 
  850.         GUIStyle style2 = (this.chatsBoxScrollPos.x != viewRect.width) ? this.garageChatsBoxRightRewindActiveStyle : this.garageChatsBoxRightRewindNotactiveStyle; 
  851.         if (TGUI.RepeatButton(this, rect2, string.Empty, style2)) 
  852.         { 
  853.             this.chatsBoxScrollPos.x = this.chatsBoxScrollPos.x + 10f; 
  854.         } 
  855.         Rect controlRect = this.chatsBoxWindowButtonRect.controlRect; 
  856.         this.chatsBoxScrollPos = GUI.BeginScrollView(rect3, this.chatsBoxScrollPos, viewRect, this.garageChatsBoxScrollStyle, this.garageChatsBoxScrollStyle); 
  857.         for (int i = 0; i < this.panelButtons.Count; i++) 
  858.         { 
  859.             this.panelButtons[i].Draw(this, controlRect); 
  860.             controlRect.x += controlRect.width; 
  861.         } 
  862.         GUI.EndScrollView(); 
  863.     } 
  864.  
  865.     public static void HideLeftPanel() 
  866.     { 
  867.         GarageCarLineWindowV4.instance.HideLeftPanelWindows(); 
  868.     } 
  869.  
  870.     public static void HideRightPanel() 
  871.     { 
  872.         GarageCarLineWindowV4.instance.HideRightPanelWindows(); 
  873.     } 
  874.  
  875.     private void HideLeftPanelWindows() 
  876.     { 
  877.         GarageQuestsWindowV3.HideWindow(); 
  878.         GarageAchievementsWindowV3.HideWindow(); 
  879.         GarageChatWindowV3.HideWindow(); 
  880.         GarageModeratorChatWindowV3.HideWindow(); 
  881.     } 
  882.  
  883.     private void HideRightPanelWindows() 
  884.     { 
  885.         GarageFriendsWindowV3.HideWindow(); 
  886.         GarageNewsWindowV3.HideWindow(); 
  887.         GarageActionsWindowV3.HideWindow(); 
  888.     } 
  889.  
  890.     public void OnPressTabChatButton(object control) 
  891.     { 
  892.         GarageCarLineWindowV4.OpenLeftPanel(GarageCarLineWindowV4.ELeftTabMode.CHAT, false); 
  893.     } 
  894.  
  895.     public void OnPressTabModeratorChatButton(object control) 
  896.     { 
  897.         GarageCarLineWindowV4.OpenLeftPanel(GarageCarLineWindowV4.ELeftTabMode.MODERATORCHAT, false); 
  898.     } 
  899.  
  900.     public void OnPressTabQuestsButton(object control) 
  901.     { 
  902.         GarageCarLineWindowV4.OpenLeftPanel(GarageCarLineWindowV4.ELeftTabMode.QUESTS, false); 
  903.     } 
  904.  
  905.     public void OnPressTabAchievementsButton(object control) 
  906.     { 
  907.         GarageCarLineWindowV4.OpenLeftPanel(GarageCarLineWindowV4.ELeftTabMode.ACHIEVEMENTS, false); 
  908.     } 
  909.  
  910.     public void OnPressTabActionsButton(object control) 
  911.     { 
  912.         GarageCarLineWindowV4.OpenRightPanel(GarageCarLineWindowV4.ERightTabMode.ACTIONS, false); 
  913.     } 
  914.  
  915.     public void OnPressTabNewsButton(object control) 
  916.     { 
  917.         GarageCarLineWindowV4.OpenRightPanel(GarageCarLineWindowV4.ERightTabMode.NEWS, false); 
  918.     } 
  919.  
  920.     public void OnPressTabFriendsButton(object control) 
  921.     { 
  922.         GarageCarLineWindowV4.OpenRightPanel(GarageCarLineWindowV4.ERightTabMode.FRIENDS, false); 
  923.     } 
  924.  
  925.     public static GarageCarLineWindowV4.ELeftTabMode CurrentLeftMode 
  926.     { 
  927.         get 
  928.         { 
  929.             return GarageCarLineWindowV4.instance.currentLeftMode; 
  930.         } 
  931.     } 
  932.  
  933.     public static GarageCarLineWindowV4.ERightTabMode CurrentRightMode 
  934.     { 
  935.         get 
  936.         { 
  937.             return GarageCarLineWindowV4.instance.currentRightMode; 
  938.         } 
  939.     } 
  940.  
  941.     public static void OpenLeftPanel(GarageCarLineWindowV4.ELeftTabMode mode, bool immediately = false) 
  942.     { 
  943.         GarageCarLineWindowV4.instance.OpenLeftPanelInternal(mode, immediately, false); 
  944.     } 
  945.  
  946.     private void OpenLeftPanelInternal(GarageCarLineWindowV4.ELeftTabMode mode, bool immediately = false, bool hideButKeep = false) 
  947.     { 
  948.         this.HideLeftPanelWindows(); 
  949.         this.SetLeftTabButtonActive(null); 
  950.         if (!hideButKeep) 
  951.         { 
  952.             if (this.currentLeftMode == mode && !immediately) 
  953.             { 
  954.                 this.currentLeftMode = GarageCarLineWindowV4.ELeftTabMode.NONE; 
  955.             } 
  956.             else 
  957.             { 
  958.                 switch (mode) 
  959.                 { 
  960.                 case GarageCarLineWindowV4.ELeftTabMode.CHAT: 
  961.                     GarageChatWindowV3.ShowWindow(); 
  962.                     this.SetLeftTabButtonActive(this.tabChatButton); 
  963.                     break; 
  964.                 case GarageCarLineWindowV4.ELeftTabMode.QUESTS: 
  965.                     GarageQuestsWindowV3.ShowWindow(); 
  966.                     this.SetLeftTabButtonActive(this.tabQuestsButton); 
  967.                     break; 
  968.                 case GarageCarLineWindowV4.ELeftTabMode.ACHIEVEMENTS: 
  969.                     GarageAchievementsWindowV3.ShowWindow(); 
  970.                     this.SetLeftTabButtonActive(this.tabAchievementsButton); 
  971.                     break; 
  972.                 case GarageCarLineWindowV4.ELeftTabMode.MODERATORCHAT: 
  973.                     GarageModeratorChatWindowV3.ShowWindow(); 
  974.                     this.SetLeftTabButtonActive(this.tabModeratorChatButton); 
  975.                     break; 
  976.                 } 
  977.                 this.currentLeftMode = mode; 
  978.             } 
  979.         } 
  980.     } 

*код не весь т.к ограничение*
скрипт для скачивания (навсякий): https://disk.yandex.ru/d/3Iq38GqOjUO4SA
pol1son
UNец
 
Сообщения: 2
Зарегистрирован: 21 фев 2023, 19:01

Re: помогите пожалуйста со скриптом, не могу понять в чем ошибка

Сообщение pol1son 21 фев 2023, 21:43

уже решил проблему, извините
pol1son
UNец
 
Сообщения: 2
Зарегистрирован: 21 фев 2023, 19:01


Вернуться в Скрипты

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3