private void CreateVehicleOptionsPanel()
        {
            UIPanel uiPanel1 = this.AddUIComponent <UIPanel>();

            uiPanel1.name   = "RightSidePanel";
            uiPanel1.anchor = UIAnchorStyle.Top | UIAnchorStyle.Left | UIAnchorStyle.Right;
            uiPanel1.transform.localPosition = Vector3.zero;
            uiPanel1.width               = 246f;
            uiPanel1.height              = 335f;
            uiPanel1.autoLayout          = true;
            uiPanel1.autoLayoutDirection = LayoutDirection.Vertical;
            uiPanel1.autoLayoutPadding   = new RectOffset(3, 3, 0, 0);
            uiPanel1.autoLayoutStart     = LayoutStart.TopLeft;
            uiPanel1.backgroundSprite    = "InfoviewPanel";
            uiPanel1.relativePosition    = new Vector3(60f, 50f);
            this._rightSidePanel         = uiPanel1;
            UIPanel uiPanel2 = uiPanel1.AddUIComponent <UIPanel>();

            uiPanel2.name             = "CaptionPanel";
            uiPanel2.width            = uiPanel2.parent.width - 6f;
            uiPanel2.height           = 30f;
            uiPanel2.backgroundSprite = "InfoviewPanel";
            UILabel uiLabel1 = uiPanel2.AddUIComponent <UILabel>();

            uiLabel1.name          = "CaptionLabel";
            uiLabel1.font          = UIUtils.Font;
            uiLabel1.textColor     = (Color32)Color.white;
            uiLabel1.textScale     = 0.95f;
            uiLabel1.textAlignment = UIHorizontalAlignment.Center;
            uiLabel1.useOutline    = true;
            uiLabel1.autoSize      = false;
            uiLabel1.height        = 18f;
            uiLabel1.width         = uiPanel2.width;
            uiLabel1.position      = new Vector3((float)((double)uiPanel2.width / 2.0 - (double)uiPanel2.width / 2.0), (float)((double)uiPanel2.height / 2.0 - 20.0));
            UIPanel uiPanel3 = uiPanel1.AddUIComponent <UIPanel>();
            string  str1     = "RowContainer";

            uiPanel3.name = str1;
            double num1 = (double)uiPanel3.parent.width - 6.0;

            uiPanel3.width = (float)num1;
            double num2 = 271.0;

            uiPanel3.height = (float)num2;
            int num3 = 1;

            uiPanel3.autoLayoutDirection = (LayoutDirection)num3;
            int num4 = 0;

            uiPanel3.autoLayoutStart = (LayoutStart)num4;
            RectOffset rectOffset1 = new RectOffset(8, 0, 0, 0);

            uiPanel3.autoLayoutPadding = rectOffset1;
            int num5 = 1;

            uiPanel3.autoLayout = num5 != 0;
            string str2 = "GenericPanelWhite";

            uiPanel3.backgroundSprite = str2;
            Color32 color32 = new Color32((byte)91, (byte)97, (byte)106, byte.MaxValue);

            uiPanel3.color = color32;
            UIPanel uiPanel4 = uiPanel3.AddUIComponent <UIPanel>();
            double  num6     = (double)uiPanel4.parent.width - 8.0;

            uiPanel4.width = (float)num6;
            double num7 = 4.0;

            uiPanel4.height = (float)num7;
            int num8 = 0;

            uiPanel4.autoLayoutDirection = (LayoutDirection)num8;
            int num9 = 0;

            uiPanel4.autoLayoutStart = (LayoutStart)num9;
            RectOffset rectOffset2 = new RectOffset(0, 6, 0, 0);

            uiPanel4.autoLayoutPadding = rectOffset2;
            int num10 = 1;

            uiPanel4.autoLayout = num10 != 0;
            UIPanel uiPanel5 = uiPanel3.AddUIComponent <UIPanel>();
            double  num11    = (double)uiPanel5.parent.width - 8.0;

            uiPanel5.width = (float)num11;
            double num12 = 30.0;

            uiPanel5.height = (float)num12;
            int num13 = 0;

            uiPanel5.autoLayoutDirection = (LayoutDirection)num13;
            int num14 = 0;

            uiPanel5.autoLayoutStart = (LayoutStart)num14;
            RectOffset rectOffset3 = new RectOffset(0, 6, 0, 0);

            uiPanel5.autoLayoutPadding = rectOffset3;
            int num15 = 1;

            uiPanel5.autoLayout = num15 != 0;
            DropDown dropDown = DropDown.Create((UIComponent)uiPanel5);
            string   str3     = "AssetDropDown";

            dropDown.name = str3;
            double num16 = 27.0;

            dropDown.height = (float)num16;
            double num17 = (double)dropDown.parent.width - 6.0;

            dropDown.width = (float)num17;
            dropDown.DropDownPanelAlignParent = (UIComponent)this;
            UIFont font = UIUtils.Font;

            dropDown.Font = font;
            PropertyChangedEventHandler <ushort> changedEventHandler1 = new PropertyChangedEventHandler <ushort>(this.OnSelectedItemChanged);

            dropDown.eventSelectedItemChanged += changedEventHandler1;
            UIPanel uiPanel6 = uiPanel3.AddUIComponent <UIPanel>();
            double  num18    = (double)uiPanel6.parent.width - 8.0;

            uiPanel6.width = (float)num18;
            double num19 = 30.0;

            uiPanel6.height = (float)num19;
            int num20 = 0;

            uiPanel6.autoLayoutDirection = (LayoutDirection)num20;
            int num21 = 0;

            uiPanel6.autoLayoutStart = (LayoutStart)num21;
            RectOffset rectOffset4 = new RectOffset(0, 3, 0, 0);

            uiPanel6.autoLayoutPadding = rectOffset4;
            int num22 = 1;

            uiPanel6.autoLayout = num22 != 0;
            UILabel uiLabel2 = uiPanel6.AddUIComponent <UILabel>();

            uiLabel2.name              = "CapacityLabel";
            uiLabel2.text              = Localization.Get("VEHICLE_EDITOR_CAPACITY");
            uiLabel2.font              = UIUtils.Font;
            uiLabel2.textColor         = (Color32)Color.white;
            uiLabel2.textScale         = 0.8f;
            uiLabel2.autoSize          = false;
            uiLabel2.height            = 30f;
            uiLabel2.width             = 115f;
            uiLabel2.wordWrap          = true;
            uiLabel2.verticalAlignment = UIVerticalAlignment.Middle;
            UITextField uiTextField1 = uiPanel6.AddUIComponent <UITextField>();
            string      str4         = "Capacity";

            uiTextField1.name = str4;
            string str5 = "0";

            uiTextField1.text = str5;
            uiLabel2.tooltip  = "";
            Color32 black1 = (Color32)Color.black;

            uiTextField1.textColor = black1;
            string str6 = "EmptySprite";

            uiTextField1.selectionSprite = str6;
            string str7 = "TextFieldPanelHovered";

            uiTextField1.normalBgSprite = str7;
            string str8 = "TextFieldPanel";

            uiTextField1.focusedBgSprite = str8;
            int num23 = 1;

            uiTextField1.builtinKeyNavigation = num23 != 0;
            int num24 = 1;

            uiTextField1.submitOnFocusLost = num24 != 0;
            PropertyChangedEventHandler <string> changedEventHandler2 = new PropertyChangedEventHandler <string>(this.OnCapacitySubmitted);

            uiTextField1.eventTextSubmitted += changedEventHandler2;
            double num25 = 45.0;

            uiTextField1.width = (float)num25;
            double num26 = 22.0;

            uiTextField1.height = (float)num26;
            int num27 = 4;

            uiTextField1.maxLength = num27;
            int num28 = 1;

            uiTextField1.numericalOnly = num28 != 0;
            int num29 = 1;

            uiTextField1.verticalAlignment = (UIVerticalAlignment)num29;
            RectOffset rectOffset5 = new RectOffset(0, 0, 4, 0);

            uiTextField1.padding = rectOffset5;
            UIPanel uiPanel7 = uiPanel3.AddUIComponent <UIPanel>();
            string  str9     = "MaintenanceRow";

            uiPanel7.name = str9;
            double num30 = (double)uiPanel7.parent.width - 8.0;

            uiPanel7.width = (float)num30;
            double num31 = 30.0;

            uiPanel7.height = (float)num31;
            int num32 = 0;

            uiPanel7.autoLayoutDirection = (LayoutDirection)num32;
            int num33 = 0;

            uiPanel7.autoLayoutStart = (LayoutStart)num33;
            RectOffset rectOffset6 = new RectOffset(0, 3, 0, 0);

            uiPanel7.autoLayoutPadding = rectOffset6;
            int num34 = 1;

            uiPanel7.autoLayout = num34 != 0;
            UILabel uiLabel3 = uiPanel7.AddUIComponent <UILabel>();

            uiLabel3.text              = Localization.Get("VEHICLE_EDITOR_MAINTENANCE");
            uiLabel3.font              = UIUtils.Font;
            uiLabel3.textColor         = (Color32)Color.white;
            uiLabel3.textScale         = 0.8f;
            uiLabel3.autoSize          = false;
            uiLabel3.height            = 30f;
            uiLabel3.width             = 115f;
            uiLabel3.wordWrap          = true;
            uiLabel3.verticalAlignment = UIVerticalAlignment.Middle;
            UITextField uiTextField2 = uiPanel7.AddUIComponent <UITextField>();
            string      str10        = "MaintenanceCost";

            uiTextField2.name = str10;
            string str11 = "0";

            uiTextField2.text = str11;
            Color32 black2 = (Color32)Color.black;

            uiTextField2.textColor = black2;
            string str12 = "EmptySprite";

            uiTextField2.selectionSprite = str12;
            string str13 = "TextFieldPanelHovered";

            uiTextField2.normalBgSprite = str13;
            string str14 = "TextFieldPanel";

            uiTextField2.focusedBgSprite = str14;
            int num35 = 1;

            uiTextField2.builtinKeyNavigation = num35 != 0;
            int num36 = 1;

            uiTextField2.submitOnFocusLost = num36 != 0;
            double num37 = 45.0;

            uiTextField2.width = (float)num37;
            double num38 = 22.0;

            uiTextField2.height = (float)num38;
            int num39 = 6;

            uiTextField2.maxLength = num39;
            int num40 = 1;

            uiTextField2.numericalOnly = num40 != 0;
            int num41 = 1;

            uiTextField2.verticalAlignment = (UIVerticalAlignment)num41;
            RectOffset rectOffset7 = new RectOffset(0, 0, 4, 0);

            uiTextField2.padding = rectOffset7;
            UILabel uiLabel4 = uiPanel7.AddUIComponent <UILabel>();

            uiLabel4.name              = "MaintenanceCostLabel";
            uiLabel4.text              = "0";
            uiLabel4.font              = UIUtils.Font;
            uiLabel4.textColor         = (Color32)Color.white;
            uiLabel4.textScale         = 0.8f;
            uiLabel4.textAlignment     = UIHorizontalAlignment.Right;
            uiLabel4.autoSize          = false;
            uiLabel4.height            = 30f;
            uiLabel4.width             = 60f;
            uiLabel4.verticalAlignment = UIVerticalAlignment.Middle;
            UIPanel uiPanel8 = uiPanel3.AddUIComponent <UIPanel>();
            double  num42    = (double)uiPanel8.parent.width - 8.0;

            uiPanel8.width = (float)num42;
            double num43 = 30.0;

            uiPanel8.height = (float)num43;
            int num44 = 0;

            uiPanel8.autoLayoutDirection = (LayoutDirection)num44;
            int num45 = 0;

            uiPanel8.autoLayoutStart = (LayoutStart)num45;
            RectOffset rectOffset8 = new RectOffset(0, 3, 0, 0);

            uiPanel8.autoLayoutPadding = rectOffset8;
            int num46 = 1;

            uiPanel8.autoLayout = num46 != 0;

            UIPanel uiPanel9 = uiPanel3.AddUIComponent <UIPanel>();
            double  num54    = (double)uiPanel9.parent.width - 8.0;

            uiPanel9.width = (float)num54;
            double num55 = 30.0;

            uiPanel9.height = (float)num55;
            int num56 = 0;

            uiPanel9.autoLayoutDirection = (LayoutDirection)num56;
            int num57 = 0;

            uiPanel9.autoLayoutStart = (LayoutStart)num57;
            RectOffset rectOffset10 = new RectOffset(0, 3, 0, 0);

            uiPanel9.autoLayoutPadding = rectOffset10;
            int num58 = 1;

            uiPanel9.autoLayout = num58 != 0;
            UILabel uiLabel7 = uiPanel9.AddUIComponent <UILabel>();

            uiLabel7.text              = Localization.Get("VEHICLE_EDITOR_MAX_SPEED");
            uiLabel7.font              = UIUtils.Font;
            uiLabel7.textColor         = (Color32)Color.white;
            uiLabel7.textScale         = 0.8f;
            uiLabel7.autoSize          = false;
            uiLabel7.height            = 30f;
            uiLabel7.width             = 115f;
            uiLabel7.wordWrap          = true;
            uiLabel7.verticalAlignment = UIVerticalAlignment.Middle;
            UITextField uiTextField4 = uiPanel9.AddUIComponent <UITextField>();
            string      str20        = "MaxSpeed";

            uiTextField4.name = str20;
            string str21 = "0";

            uiTextField4.text = str21;
            Color32 black4 = (Color32)Color.black;

            uiTextField4.textColor = black4;
            string str22 = "EmptySprite";

            uiTextField4.selectionSprite = str22;
            string str23 = "TextFieldPanelHovered";

            uiTextField4.normalBgSprite = str23;
            string str24 = "TextFieldPanel";

            uiTextField4.focusedBgSprite = str24;
            int num59 = 1;

            uiTextField4.builtinKeyNavigation = num59 != 0;
            int num60 = 1;

            uiTextField4.submitOnFocusLost = num60 != 0;
            double num61 = 45.0;

            uiTextField4.width = (float)num61;
            double num62 = 22.0;

            uiTextField4.height = (float)num62;
            int num63 = 3;

            uiTextField4.maxLength = num63;
            int num64 = 1;

            uiTextField4.numericalOnly = num64 != 0;
            int num65 = 1;

            uiTextField4.verticalAlignment = (UIVerticalAlignment)num65;
            RectOffset rectOffset11 = new RectOffset(0, 0, 4, 0);

            uiTextField4.padding = rectOffset11;
            UILabel uiLabel8 = uiPanel9.AddUIComponent <UILabel>();

            uiLabel8.name              = "MaxSpeedLabel";
            uiLabel8.text              = "0";
            uiLabel8.font              = UIUtils.Font;
            uiLabel8.textColor         = (Color32)Color.white;
            uiLabel8.textScale         = 0.8f;
            uiLabel8.textAlignment     = UIHorizontalAlignment.Right;
            uiLabel8.autoSize          = false;
            uiLabel8.height            = 30f;
            uiLabel8.width             = 60f;
            uiLabel8.verticalAlignment = UIVerticalAlignment.Middle;
            UIPanel uiPanel10 = uiPanel3.AddUIComponent <UIPanel>();
            string  str25     = "EngineRow";

            uiPanel10.name = str25;
            double num66 = (double)uiPanel10.parent.width - 8.0;

            uiPanel10.width = (float)num66;
            double num67 = 30.0;

            uiPanel10.height = (float)num67;
            int num68 = 0;

            uiPanel10.autoLayoutDirection = (LayoutDirection)num68;
            int num69 = 0;

            uiPanel10.autoLayoutStart = (LayoutStart)num69;
            RectOffset rectOffset12 = new RectOffset(0, 3, 0, 0);

            uiPanel10.autoLayoutPadding = rectOffset12;
            int num70 = 1;

            uiPanel10.autoLayout = num70 != 0;
            UICheckBox checkBox = UIUtils.CreateCheckBox((UIComponent)uiPanel10);
            string     str26    = "EngineOnBothEnds";

            checkBox.name = str26;
            string str27 = Localization.Get("VEHICLE_EDITOR_ENGINE_ON_BOTH_ENDS_TOOLTIP");

            checkBox.tooltip    = str27;
            checkBox.label.text = Localization.Get("VEHICLE_EDITOR_ENGINE_ON_BOTH_ENDS");
            UIPanel uiPanel11 = uiPanel3.AddUIComponent <UIPanel>();
            string  str28     = "ButtonRow";

            uiPanel11.name = str28;
            double num71 = (double)uiPanel11.parent.width - 8.0;

            uiPanel11.width = (float)num71;
            double num72 = 30.0;

            uiPanel11.height = (float)num72;
            int num73 = 0;

            uiPanel11.autoLayoutDirection = (LayoutDirection)num73;
            int num74 = 0;

            uiPanel11.autoLayoutStart = (LayoutStart)num74;
            RectOffset rectOffset13 = new RectOffset(0, 6, 4, 0);

            uiPanel11.autoLayoutPadding = rectOffset13;
            int num75 = 1;

            uiPanel11.autoLayout = num75 != 0;
            UIButton button1 = UIUtils.CreateButton((UIComponent)uiPanel11);
            string   str29   = "Apply";

            button1.name = str29;
            string str30 = Localization.Get("VEHICLE_EDITOR_APPLY");

            button1.text = str30;
            double num76 = 0.800000011920929;

            button1.textScale = (float)num76;
            double num77 = 110.0;

            button1.width = (float)num77;
            double num78 = 22.0;

            button1.height = (float)num78;
            MouseEventHandler mouseEventHandler1 = new MouseEventHandler(this.OnApplyButtonClick);

            button1.eventClick += mouseEventHandler1;
            UIButton button2 = UIUtils.CreateButton((UIComponent)uiPanel11);
            string   str31   = "Default";

            button2.name = str31;
            string str32 = Localization.Get("VEHICLE_EDITOR_DEFAULT");

            button2.text = str32;
            double num79 = 0.800000011920929;

            button2.textScale = (float)num79;
            double num80 = 110.0;

            button2.width = (float)num80;
            double num81 = 22.0;

            button2.height = (float)num81;
            MouseEventHandler mouseEventHandler2 = new MouseEventHandler(this.OnDefaultButtonClick);

            button2.eventClick += mouseEventHandler2;
        }
        private void SetTransportType(TransportInfo.TransportType transportType, VehicleInfo selectedPrefab = null)
        {
            Color            transportColor = Singleton <TransportManager> .instance.m_properties.m_transportColors[(int)transportType];
            ItemClassTriplet classTriplet   = VehicleEditor.GetItemClasses(transportType)[0];

            this._selectedService      = classTriplet.Service;
            this._selectedSubService   = classTriplet.SubService;
            this._rightSidePanel.color = (Color32)transportColor;
            UIComponent uiComponent = this._rightSidePanel.Find("CaptionPanel");
            UIPanel     uiPanel1    = this._rightSidePanel.Find <UIPanel>("MaintenanceRow");
            UILabel     uiLabel1    = this._rightSidePanel.Find <UILabel>("CapacityLabel");
            UITextField uiTextField = this._rightSidePanel.Find <UITextField>("Capacity");
            UIPanel     uiPanel2    = this._rightSidePanel.Find <UIPanel>("EngineRow");

            this._rightSidePanel.Find <UIPanel>("ButtonRow");
            Color32 color32 = (Color32)transportColor;

            uiComponent.color = color32;
            if (this._selectedSubService == ItemClass.SubService.PublicTransportTaxi)
            {
                uiPanel1.enabled    = false;
                uiPanel2.enabled    = false;
                uiLabel1.text       = Localization.Get("VEHICLE_EDITOR_CAPACITY_TAXI");
                uiTextField.tooltip = Localization.Get("VEHICLE_EDITOR_CAPACITY_TAXI_TOOLTIP");
            }
            else
            {
                uiPanel1.enabled = true;
                if (this._selectedSubService == ItemClass.SubService.PublicTransportTrain)
                {
                    uiPanel2.enabled = true;
                }
                else
                {
                    uiPanel2.enabled = false;
                }
                uiLabel1.text       = Localization.Get("VEHICLE_EDITOR_CAPACITY");
                uiTextField.tooltip = "";
            }
            (this._rightSidePanel.Find("CaptionLabel") as UILabel).text = string.Format(Localization.Get("VEHICLE_EDITOR_SUB_TITLE"), (object)ColossalFramework.Globalization.Locale.Get(VehicleEditor.GetLocaleID(transportType)));
            this.PopulateAssetDropDown(selectedPrefab);
        }
        private void CreatePanel()
        {
            this.name             = "VehicleEditor";
            this.width            = 314f;
            this.height           = 394f;
            this.backgroundSprite = "MenuPanel2";
            this.canFocus         = true;
            this.isInteractive    = true;
            this.isVisible        = false;
            UILabel uiLabel = this.AddUIComponent <UILabel>();

            uiLabel.name          = "Title";
            uiLabel.text          = Localization.Get("VEHICLE_EDITOR_TITLE");
            uiLabel.textAlignment = UIHorizontalAlignment.Center;
            uiLabel.font          = UIUtils.Font;
            uiLabel.position      = new Vector3((float)((double)this.width / 2.0 - (double)uiLabel.width / 2.0), (float)((double)uiLabel.height / 2.0 - 20.0));

            this._containerPanel        = this.AddUIComponent <UIPanel>();
            this._containerPanel.name   = "ContainerPanel";
            this._containerPanel.anchor = UIAnchorStyle.Top | UIAnchorStyle.Left | UIAnchorStyle.Right;
            this._containerPanel.transform.localPosition = Vector3.zero;
            this._containerPanel.width               = 300f;
            this._containerPanel.height              = this.height - 60f;
            this._containerPanel.autoLayout          = true;
            this._containerPanel.autoLayoutDirection = LayoutDirection.Vertical;
            this._containerPanel.autoLayoutPadding   = new RectOffset(0, 0, 0, 1);
            this._containerPanel.autoLayoutStart     = LayoutStart.TopLeft;
            this._containerPanel.relativePosition    = new Vector3(6f, 50f);
            UIPanel uiPanel = this._containerPanel.AddUIComponent <UIPanel>();
            double  num3    = 70.0;

            uiPanel.width = (float)num3;
            double num4 = 13.0;

            uiPanel.height = (float)num4;
            TransportManager instance = Singleton <TransportManager> .instance;

            this.CreateTabButton(TransportInfo.TransportType.Bus);
            if (instance.TransportTypeLoaded(TransportInfo.TransportType.Trolleybus))
            {
                this.CreateTabButton(TransportInfo.TransportType.Trolleybus);
            }
            if (instance.TransportTypeLoaded(TransportInfo.TransportType.Tram))
            {
                this.CreateTabButton(TransportInfo.TransportType.Tram);
            }
            this.CreateTabButton(TransportInfo.TransportType.Metro);
            this.CreateTabButton(TransportInfo.TransportType.Train);
            this.CreateTabButton(TransportInfo.TransportType.Ship);
            this.CreateTabButton(TransportInfo.TransportType.Airplane);
            if (instance.TransportTypeLoaded(TransportInfo.TransportType.Monorail))
            {
                this.CreateTabButton(TransportInfo.TransportType.Monorail);
            }
            if (instance.TransportTypeLoaded(TransportInfo.TransportType.CableCar))
            {
                this.CreateTabButton(TransportInfo.TransportType.CableCar);
            }
            if (instance.TransportTypeLoaded(TransportInfo.TransportType.Taxi))
            {
                this.CreateTabButton(TransportInfo.TransportType.Taxi);
            }
            this.CreateVehicleOptionsPanel();
        }
示例#4
0
        private void Update()
        {
            if (!this._initialized)
            {
                this._cityServiceWorldInfoPanel = GameObject.Find("(Library) CityServiceWorldInfoPanel").GetComponent <CityServiceWorldInfoPanel>();
                if (!((UnityEngine.Object) this._cityServiceWorldInfoPanel != (UnityEngine.Object)null))
                {
                    return;
                }
                this.CreateStopsPanel();
                this._initialized = true;
            }
            else
            {
                if (!this._initialized || !this._cityServiceWorldInfoPanel.component.isVisible)
                {
                    return;
                }
                BuildingManager      instance1  = Singleton <BuildingManager> .instance;
                ushort               building   = Utils.GetPrivate <InstanceID>((object)this._cityServiceWorldInfoPanel, "m_InstanceID").Building;
                ItemClass.SubService subService = instance1.m_buildings.m_buffer[(int)building].Info.GetSubService();
                ItemClass.Service    service    = instance1.m_buildings.m_buffer[(int)building].Info.GetService();
                ItemClass.Level      level      = instance1.m_buildings.m_buffer[(int)building].Info.GetClassLevel();

                switch (subService) //TODO(earalov): properly handle evacuation buses
                {
                case ItemClass.SubService.PublicTransportBus:
                case ItemClass.SubService.PublicTransportMetro:
                case ItemClass.SubService.PublicTransportTrain:
                case ItemClass.SubService.PublicTransportShip:
                case ItemClass.SubService.PublicTransportPlane:
                case ItemClass.SubService.PublicTransportMonorail:
                    this._vehicleListBox.Hide(); //TODO(earalov): display depot's vehicles? Also, maybe it makes sense to display list of lines served by depot?
                    this._stopsListBox.Show();
                    ushort[] numArray = PanelExtenderCityService.GetStationStops(building);
                    BuildingInfo.SubInfo[] subBuildings = instance1.m_buildings.m_buffer[(int)building].Info.m_subBuildings;
                    if (subBuildings != null && subBuildings.Length != 0)
                    {
                        Vector3 position = instance1.m_buildings.m_buffer[(int)building].m_position;
                        building = instance1.FindBuilding(position, 100f, ItemClass.Service.PublicTransport, ItemClass.SubService.None, Building.Flags.Untouchable, Building.Flags.None);
                        if ((int)building != 0)
                        {
                            ushort[] stationStops = PanelExtenderCityService.GetStationStops(building);
                            if (stationStops.Length != 0)
                            {
                                numArray = ((IEnumerable <ushort>)numArray).Concat <ushort>((IEnumerable <ushort>)stationStops).ToArray <ushort>();
                            }
                        }
                    }
                    int length = numArray.Length;
                    if (length > 0)
                    {
                        this._titleLabel.text = Localization.Get("CITY_SERVICE_PANEL_TITLE_STATION_STOPS");
                        this._listBoxPanel.relativePosition = new Vector3(this._listBoxPanel.parent.width + 1f, 0.0f);
                        this._listBoxPanel.Show();
                        if ((int)this._cachedBuildingID != (int)building || this._cachedStopCount != length)
                        {
                            this._stopsListBox.ClearItems();
                            for (int index = 0; index < length; ++index)
                            {
                                this._stopsListBox.AddItem(numArray[index], -1);
                            }
                        }
                    }
                    else
                    {
                        this._listBoxPanel.Hide();
                    }
                    this._cachedStopCount = length;
                    break;

                case ItemClass.SubService.PublicTransportTaxi:
                case ItemClass.SubService.PublicTransportCableCar:
                    this._vehicleListBox.Show();
                    this._stopsListBox.Hide();
                    UIPanel uiPanel = this._cityServiceWorldInfoPanel.Find <UIPanel>("SvsVehicleTypes");
                    if ((UnityEngine.Object)uiPanel != (UnityEngine.Object)null)
                    {
                        this._listBoxPanel.relativePosition = new Vector3((float)((double)this._listBoxPanel.parent.width + (double)uiPanel.width + 2.0), 0.0f);
                    }
                    List <ushort> depotVehicles = PanelExtenderCityService.GetDepotVehicles(building);
                    int           count         = depotVehicles.Count;
                    if (count > 0)
                    {
                        this._titleLabel.text = Localization.Get("CITY_SERVICE_PANEL_TITLE_DEPOT_VEHICLES");
                        this._listBoxPanel.Show();
                        if ((int)this._cachedBuildingID != (int)building || this._cachedVehicleCount != count)
                        {
                            this._vehicleListBox.ClearItems();
                            PrefabData[]   prefabs   = VehiclePrefabs.instance.GetPrefabs(service, subService, level);
                            VehicleManager instance2 = Singleton <VehicleManager> .instance;
                            foreach (ushort vehicleID in depotVehicles)
                            {
                                VehicleInfo info = instance2.m_vehicles.m_buffer[(int)vehicleID].Info;
                                for (int index = 0; index < prefabs.Length; ++index)
                                {
                                    PrefabData data = prefabs[index];
                                    if (info.name == data.ObjectName)
                                    {
                                        this._vehicleListBox.AddItem(data, vehicleID);
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        this._listBoxPanel.Hide();
                    }
                    this._cachedVehicleCount = count;
                    break;

                default:
                    this._listBoxPanel.Hide();
                    break;
                }
                this._cachedBuildingID = building;
            }
        }
示例#5
0
        private void UpdateBindings()
        {
            ushort vehicleID = 0;
            ushort lineId    = this.GetLineID(out vehicleID);

            if ((int)lineId == 0)
            {
                this._passengerPanel.Hide();
                this._statsPanel.Hide();
                this._buttonPanel.Hide();
                this._publicTransportVehicleWorldInfoPanel.component.height = 229f;
            }
            else
            {
                this._publicTransportVehicleWorldInfoPanel.component.height = 332f;
                this._editType.isVisible = !OptionsWrapper <Settings> .Options.HideVehicleEditor;
                ItemClass            itemClass  = Singleton <TransportManager> .instance.m_lines.m_buffer[(int)lineId].Info.m_class;
                ItemClass.SubService subService = itemClass.m_subService;
                ItemClass.Service    service    = itemClass.m_service;
                ItemClass.Level      level      = itemClass.m_level;

                switch (subService)
                {
                case ItemClass.SubService.PublicTransportBus:
                case ItemClass.SubService.PublicTransportTours:
                case ItemClass.SubService.PublicTransportMetro:
                case ItemClass.SubService.PublicTransportTrain:
                case ItemClass.SubService.PublicTransportTram:
                case ItemClass.SubService.PublicTransportShip:
                case ItemClass.SubService.PublicTransportPlane:
                case ItemClass.SubService.PublicTransportMonorail:
                case ItemClass.SubService.PublicTransportCableCar:
                    this._passengerPanel.Show();
                    if ((int)vehicleID != 0)
                    {
                        this._lastStopExchange.text = string.Format(Localization.Get("VEHICLE_PANEL_LAST_STOP_EXCHANGE"),
                                                                    (object)VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].LastStopGonePassengers,
                                                                    (object)VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].LastStopNewPassengers);
                    }
                    break;

                case ItemClass.SubService.None:
                    if (service == ItemClass.Service.Disaster && level == ItemClass.Level.Level4)
                    {
                        this._passengerPanel.Show();
                        if ((int)vehicleID != 0)
                        {
                            this._lastStopExchange.text = string.Format(Localization.Get("VEHICLE_PANEL_LAST_STOP_EXCHANGE"),
                                                                        (object)VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].LastStopGonePassengers,
                                                                        (object)VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].LastStopNewPassengers);
                        }
                    }
                    else
                    {
                        this._passengerPanel.Hide();
                    }
                    break;

                default:
                    this._passengerPanel.Hide();
                    break;
                }
                this._distanceTraveled.parent.Show();
                this._distanceProgress.parent.Show();
                VehicleManager vm = Singleton <VehicleManager> .instance;
                if ((vm.m_vehicles.m_buffer[(int)vehicleID].m_flags & Vehicle.Flags.Stopped) != ~(Vehicle.Flags.Created | Vehicle.Flags.Deleted | Vehicle.Flags.Spawned | Vehicle.Flags.Inverted | Vehicle.Flags.TransferToTarget | Vehicle.Flags.TransferToSource | Vehicle.Flags.Emergency1 | Vehicle.Flags.Emergency2 | Vehicle.Flags.WaitingPath | Vehicle.Flags.Stopped | Vehicle.Flags.Leaving | Vehicle.Flags.Arriving | Vehicle.Flags.Reversed | Vehicle.Flags.TakingOff | Vehicle.Flags.Flying | Vehicle.Flags.Landing | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo | Vehicle.Flags.GoingBack | Vehicle.Flags.WaitingTarget | Vehicle.Flags.Importing | Vehicle.Flags.Exporting | Vehicle.Flags.Parking | Vehicle.Flags.CustomName | Vehicle.Flags.OnGravel | Vehicle.Flags.WaitingLoading | Vehicle.Flags.Congestion | Vehicle.Flags.DummyTraffic | Vehicle.Flags.Underground | Vehicle.Flags.Transition | Vehicle.Flags.InsideBuilding | Vehicle.Flags.LeftHandDrive))
                {
                    if (VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].IsUnbunchingInProgress)
                    {
                        this._status.text = Localization.Get("VEHICLE_PANEL_STATUS_UNBUNCHING");
                    }
                    this._distance.text = this._status.text;
                    float num = (float)vm.m_vehicles.m_buffer[(int)vehicleID].m_waitCounter / 12f;
                    int   p   = Mathf.RoundToInt(num * 100f);
                    this._distanceTraveled.value         = num;
                    this._distanceTraveled.progressColor = (Color32)Color.green;
                    this._distanceProgress.text          = LocaleFormatter.FormatPercentage(p);
                }
                else
                {
                    bool   flag = true;
                    string text = Localization.Get("VEHICLE_PANEL_STATUS_NEXT_STOP");
                    if (subService == ItemClass.SubService.PublicTransportShip)
                    {
                        this.UpdateProgress();
                    }
                    else if (subService == ItemClass.SubService.PublicTransportPlane)
                    {
                        if ((vm.m_vehicles.m_buffer[(int)vehicleID].m_flags & Vehicle.Flags.Landing) != ~(Vehicle.Flags.Created | Vehicle.Flags.Deleted | Vehicle.Flags.Spawned | Vehicle.Flags.Inverted | Vehicle.Flags.TransferToTarget | Vehicle.Flags.TransferToSource | Vehicle.Flags.Emergency1 | Vehicle.Flags.Emergency2 | Vehicle.Flags.WaitingPath | Vehicle.Flags.Stopped | Vehicle.Flags.Leaving | Vehicle.Flags.Arriving | Vehicle.Flags.Reversed | Vehicle.Flags.TakingOff | Vehicle.Flags.Flying | Vehicle.Flags.Landing | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo | Vehicle.Flags.GoingBack | Vehicle.Flags.WaitingTarget | Vehicle.Flags.Importing | Vehicle.Flags.Exporting | Vehicle.Flags.Parking | Vehicle.Flags.CustomName | Vehicle.Flags.OnGravel | Vehicle.Flags.WaitingLoading | Vehicle.Flags.Congestion | Vehicle.Flags.DummyTraffic | Vehicle.Flags.Underground | Vehicle.Flags.Transition | Vehicle.Flags.InsideBuilding | Vehicle.Flags.LeftHandDrive) || (vm.m_vehicles.m_buffer[(int)vehicleID].m_flags & Vehicle.Flags.TakingOff) != ~(Vehicle.Flags.Created | Vehicle.Flags.Deleted | Vehicle.Flags.Spawned | Vehicle.Flags.Inverted | Vehicle.Flags.TransferToTarget | Vehicle.Flags.TransferToSource | Vehicle.Flags.Emergency1 | Vehicle.Flags.Emergency2 | Vehicle.Flags.WaitingPath | Vehicle.Flags.Stopped | Vehicle.Flags.Leaving | Vehicle.Flags.Arriving | Vehicle.Flags.Reversed | Vehicle.Flags.TakingOff | Vehicle.Flags.Flying | Vehicle.Flags.Landing | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo | Vehicle.Flags.GoingBack | Vehicle.Flags.WaitingTarget | Vehicle.Flags.Importing | Vehicle.Flags.Exporting | Vehicle.Flags.Parking | Vehicle.Flags.CustomName | Vehicle.Flags.OnGravel | Vehicle.Flags.WaitingLoading | Vehicle.Flags.Congestion | Vehicle.Flags.DummyTraffic | Vehicle.Flags.Underground | Vehicle.Flags.Transition | Vehicle.Flags.InsideBuilding | Vehicle.Flags.LeftHandDrive) || (vm.m_vehicles.m_buffer[(int)vehicleID].m_flags & Vehicle.Flags.Flying) == ~(Vehicle.Flags.Created | Vehicle.Flags.Deleted | Vehicle.Flags.Spawned | Vehicle.Flags.Inverted | Vehicle.Flags.TransferToTarget | Vehicle.Flags.TransferToSource | Vehicle.Flags.Emergency1 | Vehicle.Flags.Emergency2 | Vehicle.Flags.WaitingPath | Vehicle.Flags.Stopped | Vehicle.Flags.Leaving | Vehicle.Flags.Arriving | Vehicle.Flags.Reversed | Vehicle.Flags.TakingOff | Vehicle.Flags.Flying | Vehicle.Flags.Landing | Vehicle.Flags.WaitingSpace | Vehicle.Flags.WaitingCargo | Vehicle.Flags.GoingBack | Vehicle.Flags.WaitingTarget | Vehicle.Flags.Importing | Vehicle.Flags.Exporting | Vehicle.Flags.Parking | Vehicle.Flags.CustomName | Vehicle.Flags.OnGravel | Vehicle.Flags.WaitingLoading | Vehicle.Flags.Congestion | Vehicle.Flags.DummyTraffic | Vehicle.Flags.Underground | Vehicle.Flags.Transition | Vehicle.Flags.InsideBuilding | Vehicle.Flags.LeftHandDrive))
                        {
                            text = this._status.text;
                            flag = false;
                        }
                        this.UpdateProgress();
                    }
                    this._status.text = text;
                    if (flag)
                    {
                        ushort     targetBuilding = vm.m_vehicles.m_buffer[(int)vehicleID].m_targetBuilding;
                        InstanceID id             = new InstanceID();
                        id.NetNode = targetBuilding;
                        string name = Singleton <InstanceManager> .instance.GetName(id);

                        this._target.objectUserData = (object)id;
                        this._target.text           = name == null?string.Format(Localization.Get("STOP_LIST_BOX_ROW_STOP"), (object)(TransportLineMod.GetStopIndex(lineId, targetBuilding) + 1)) : name;

                        this._target.Enable();
                        this._target.Show();
                    }
                    this._distance.text = ColossalFramework.Globalization.Locale.Get(this._distance.localeID);
                    this._distanceTraveled.progressColor = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
                }
                this._statsPanel.Show();
                this._passengersCurrentWeek.text = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].PassengersThisWeek.ToString();
                this._passengersLastWeek.text    = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].PassengersLastWeek.ToString();
                this._passengersAverage.text     = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].PassengersAverage.ToString();
                PrefabData prefabData          = Array.Find(VehiclePrefabs.instance.GetPrefabs(service, subService, level), item => item.PrefabDataIndex == vm.m_vehicles.m_buffer[(int)vehicleID].Info.m_prefabDataIndex);
                int        num1                = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].IncomeThisWeek - prefabData.MaintenanceCost;
                UILabel    earningsCurrentWeek = this._earningsCurrentWeek;
                float      num2                = (float)num1 * 0.01f;
                string     str1                = num2.ToString(ColossalFramework.Globalization.Locale.Get("MONEY_FORMAT"), (IFormatProvider)LocaleManager.cultureInfo);
                earningsCurrentWeek.text            = str1;
                this._earningsCurrentWeek.textColor = (Color32)this.GetColor((float)num1);
                int     incomeLastWeek   = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].IncomeLastWeek;
                UILabel earningsLastWeek = this._earningsLastWeek;
                num2 = (float)incomeLastWeek * 0.01f;
                string str2 = num2.ToString(ColossalFramework.Globalization.Locale.Get("MONEY_FORMAT"), (IFormatProvider)LocaleManager.cultureInfo);
                earningsLastWeek.text            = str2;
                this._earningsLastWeek.textColor = (Color32)this.GetColor((float)incomeLastWeek);
                int     incomeAverage   = VehicleManagerMod.m_cachedVehicleData[(int)vehicleID].IncomeAverage;
                UILabel earningsAverage = this._earningsAverage;
                num2 = (float)incomeAverage * 0.01f;
                string str3 = num2.ToString(ColossalFramework.Globalization.Locale.Get("MONEY_FORMAT"), (IFormatProvider)LocaleManager.cultureInfo);
                earningsAverage.text            = str3;
                this._earningsAverage.textColor = (Color32)this.GetColor((float)incomeAverage);
                this._buttonPanel.Show();
            }
        }
示例#6
0
        private void AddPanelControls()
        {
            UILabel uiLabel1 = Utils.GetPrivate <UILabel>((object)this._publicTransportVehicleWorldInfoPanel, "m_Type");
            int     num1     = 132;

            uiLabel1.anchor = (UIAnchorStyle)num1;
            UIPanel    parent     = (UIPanel)uiLabel1.parent;
            RectOffset rectOffset = new RectOffset(0, 10, 0, 0);

            parent.autoLayoutPadding = rectOffset;
            double num2 = 25.0;

            parent.height = (float)num2;
            int num3 = 1;

            parent.useCenter = num3 != 0;
            UIButton button1 = UIUtils.CreateButton((UIComponent)parent);

            button1.name        = "EditType";
            button1.autoSize    = true;
            button1.anchor      = UIAnchorStyle.Left | UIAnchorStyle.Right | UIAnchorStyle.CenterVertical;
            button1.textPadding = new RectOffset(10, 10, 4, 2);
            button1.text        = Localization.Get("VEHICLE_PANEL_EDIT_TYPE");
            button1.tooltip     = string.Format(Localization.Get("VEHICLE_PANEL_EDIT_TYPE_TOOLTIP"));
            button1.textScale   = 0.75f;
            button1.eventClick += new MouseEventHandler(this.OnEditTypeClick);
            button1.isVisible   = !OptionsWrapper <Settings> .Options.HideVehicleEditor;
            this._editType      = button1;
            UILabel uiLabel2 = Utils.GetPrivate <UILabel>((object)this._publicTransportVehicleWorldInfoPanel, "m_Passengers");
            UIPanel uiPanel1 = this._publicTransportVehicleWorldInfoPanel.component.Find <UIPanel>("Panel");
            UIPanel uiPanel2 = uiPanel1.AddUIComponent <UIPanel>();

            uiPanel2.autoLayout          = true;
            uiPanel2.autoLayoutDirection = LayoutDirection.Horizontal;
            uiPanel2.autoLayoutPadding   = new RectOffset(0, 0, 0, 0);
            uiPanel2.height      = uiLabel2.parent.height;
            uiPanel2.width       = uiLabel2.parent.width;
            uiPanel2.zOrder      = 4;
            this._passengerPanel = uiPanel2;
            UILabel uiLabel3 = uiPanel2.AddUIComponent <UILabel>();

            uiLabel3.name          = "LastStopExchange";
            uiLabel3.font          = uiLabel2.font;
            uiLabel3.textColor     = uiLabel2.textColor;
            uiLabel3.textScale     = uiLabel2.textScale;
            uiLabel3.processMarkup = true;
            this._lastStopExchange = uiLabel3;
            UIPanel uiPanel3 = uiPanel1.AddUIComponent <UIPanel>();

            uiPanel3.name                = "PassengerStats";
            uiPanel3.anchor              = UIAnchorStyle.Top | UIAnchorStyle.Left | UIAnchorStyle.Right;
            uiPanel3.autoLayout          = true;
            uiPanel3.autoLayoutDirection = LayoutDirection.Vertical;
            uiPanel3.autoLayoutPadding   = new RectOffset(0, 0, 0, 0);
            uiPanel3.autoLayoutStart     = LayoutStart.TopLeft;
            uiPanel3.size                = new Vector2(349f, 60f);
            uiPanel3.zOrder              = 5;
            this._statsPanel             = uiPanel3;
            UILabel label1;
            UILabel label2;
            UILabel label3;
            UILabel label4;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel3, out label1, out label2, out label3, out label4, true);
            label2.text    = Localization.Get("CURRENT_WEEK");
            label3.text    = Localization.Get("LAST_WEEK");
            label4.text    = Localization.Get("AVERAGE");
            label4.tooltip = string.Format(Localization.Get("AVERAGE_TOOLTIP"), (object)OptionsWrapper <Settings> .Options.StatisticWeeks);
            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel3, out label1, out this._passengersCurrentWeek, out this._passengersLastWeek, out this._passengersAverage, false);
            label1.text = Localization.Get("VEHICLE_PANEL_PASSENGERS");
            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel3, out label1, out this._earningsCurrentWeek, out this._earningsLastWeek, out this._earningsAverage, false);
            label1.text    = Localization.Get("VEHICLE_PANEL_EARNINGS");
            label1.tooltip = Localization.Get("VEHICLE_PANEL_EARNINGS_TOOLTIP");
            UIPanel uiPanel4 = uiPanel1.AddUIComponent <UIPanel>();

            uiPanel4.name                = "Buttons";
            uiPanel4.anchor              = UIAnchorStyle.Top | UIAnchorStyle.Left | UIAnchorStyle.Right;
            uiPanel4.autoLayout          = true;
            uiPanel4.autoLayoutDirection = LayoutDirection.Horizontal;
            uiPanel4.autoLayoutPadding   = new RectOffset(0, 5, 0, 0);
            uiPanel4.autoLayoutStart     = LayoutStart.TopLeft;
            uiPanel4.size                = new Vector2(345f, 32f);
            this._buttonPanel            = uiPanel4;
            UIButton button2 = UIUtils.CreateButton((UIComponent)uiPanel4);

            button2.name        = "PreviousVehicle";
            button2.textPadding = new RectOffset(10, 10, 4, 0);
            button2.text        = Localization.Get("VEHICLE_PANEL_PREVIOUS");
            button2.tooltip     = Localization.Get("VEHICLE_PANEL_PREVIOUS_TOOLTIP");
            button2.textScale   = 0.75f;
            button2.size        = new Vector2(110f, 32f);
            button2.wordWrap    = true;
            button2.eventClick += new MouseEventHandler(this.OnChangeVehicleClick);
            UIButton button3 = UIUtils.CreateButton((UIComponent)uiPanel4);

            button3.name             = "RemoveVehicle";
            button3.textPadding      = new RectOffset(10, 10, 4, 0);
            button3.text             = Localization.Get("VEHICLE_PANEL_REMOVE_VEHICLE");
            button3.textScale        = 0.75f;
            button3.size             = new Vector2(100f, 32f);
            button3.wordWrap         = true;
            button3.hoveredTextColor = (Color32)Color.red;
            button3.focusedTextColor = (Color32)Color.red;
            button3.pressedTextColor = (Color32)Color.red;
            button3.eventClick      += new MouseEventHandler(this.OnRemoveVehicleClick);
            UIButton button4 = UIUtils.CreateButton((UIComponent)uiPanel4);

            button4.name        = "NextVehicle";
            button4.textPadding = new RectOffset(10, 10, 4, 0);
            button4.text        = Localization.Get("VEHICLE_PANEL_NEXT");
            button4.tooltip     = Localization.Get("VEHICLE_PANEL_NEXT_TOOLTIP");
            button4.textScale   = 0.75f;
            button4.size        = new Vector2(110f, 32f);
            button4.wordWrap    = true;
            button4.eventClick += new MouseEventHandler(this.OnChangeVehicleClick);
        }
示例#7
0
        private void SetupPanel()
        {
            this.name             = "PublicTransportStopWorldInfoPanel";
            this.isVisible        = false;
            this.canFocus         = true;
            this.isInteractive    = true;
            this.anchor           = UIAnchorStyle.None;
            this.pivot            = UIPivotPoint.BottomLeft;
            this.width            = 380f;
            this.height           = 280f;
            this.backgroundSprite = "InfoBubbleVehicle";
            UIPanel uiPanel1 = this.AddUIComponent <UIPanel>();
            string  str1     = "Caption";

            uiPanel1.name = str1;
            double width = (double)this.width;

            uiPanel1.width = (float)width;
            double num1 = 40.0;

            uiPanel1.height = (float)num1;
            Vector3 vector3_1 = new Vector3(0.0f, 0.0f);

            uiPanel1.relativePosition = vector3_1;
            UISprite uiSprite1 = uiPanel1.AddUIComponent <UISprite>();

            uiSprite1.name             = "VehicleType";
            uiSprite1.size             = new Vector2(32f, 22f);
            uiSprite1.relativePosition = new Vector3(8f, 9f, 0.0f);
            this.m_VehicleType         = uiSprite1;
            UITextField uiTextField = uiPanel1.AddUIComponent <UITextField>();

            uiTextField.name                 = "StopName";
            uiTextField.font                 = UIUtils.Font;
            uiTextField.height               = 25f;
            uiTextField.width                = 200f;
            uiTextField.maxLength            = 32;
            uiTextField.builtinKeyNavigation = true;
            uiTextField.submitOnFocusLost    = true;
            uiTextField.focusedBgSprite      = "TextFieldPanel";
            uiTextField.hoveredBgSprite      = "TextFieldPanelHovered";
            uiTextField.padding              = new RectOffset(0, 0, 4, 0);
            uiTextField.selectionSprite      = "EmptySprite";
            uiTextField.verticalAlignment    = UIVerticalAlignment.Middle;
            uiTextField.position             = new Vector3((float)((double)this.width / 2.0 - (double)uiTextField.width / 2.0),
                                                           (float)((double)uiTextField.height / 2.0 - 20.0));
            uiTextField.eventTextSubmitted += new PropertyChangedEventHandler <string>(this.OnRename);
            this.m_StopName = uiTextField;
            DropDown dropDown = DropDown.Create((UIComponent)uiPanel1);

            dropDown.name      = "SuggestedNames";
            dropDown.size      = new Vector2(30f, 25f);
            dropDown.ListWidth = 200f;
            dropDown.DropDownPanelAlignParent = (UIComponent)this;
            dropDown.Font     = UIUtils.Font;
            dropDown.position = new Vector3((float)((double)this.width / 2.0 + (double)uiTextField.width / 2.0),
                                            (float)((double)dropDown.height / 2.0 - 20.0));
            dropDown.tooltip   = Localization.Get("STOP_PANEL_SUGGESTED_NAMES_TOOLTIP");
            dropDown.ShowPanel = false;
            dropDown.eventSelectedItemChanged += new PropertyChangedEventHandler <ushort>(this.OnSelectedItemChanged);
            this.m_SuggestedNames              = dropDown;
            UIButton uiButton1 = uiPanel1.AddUIComponent <UIButton>();

            uiButton1.name             = "ReuseName";
            uiButton1.tooltip          = Localization.Get("STOP_PANEL_REUSE_NAME_TOOLTIP");
            uiButton1.size             = new Vector2(30f, 30f);
            uiButton1.normalBgSprite   = "IconPolicyRecycling";
            uiButton1.hoveredBgSprite  = "IconPolicyRecyclingHovered";
            uiButton1.pressedBgSprite  = "IconPolicyRecyclingPressed";
            uiButton1.relativePosition =
                new Vector3((float)((double)this.width - 32.0 - (double)uiButton1.width - 2.0), 6f);
            uiButton1.eventClick += new MouseEventHandler(this.OnReuseNameButtonClick);
            UIButton uiButton2 = uiPanel1.AddUIComponent <UIButton>();

            uiButton2.name             = "Close";
            uiButton2.size             = new Vector2(32f, 32f);
            uiButton2.normalBgSprite   = "buttonclose";
            uiButton2.hoveredBgSprite  = "buttonclosehover";
            uiButton2.pressedBgSprite  = "buttonclosepressed";
            uiButton2.relativePosition = new Vector3((float)((double)this.width - (double)uiButton2.width - 2.0),
                                                     2f);
            uiButton2.eventClick += new MouseEventHandler(this.OnCloseButtonClick);
            UIPanel uiPanel2 = this.AddUIComponent <UIPanel>();
            string  str2     = "Container";

            uiPanel2.name = str2;
            double num2 = 365.0;

            uiPanel2.width = (float)num2;
            double num3 = 197.0;

            uiPanel2.height = (float)num3;
            int num4 = 1;

            uiPanel2.autoLayout = num4 != 0;
            int num5 = 1;

            uiPanel2.autoLayoutDirection = (LayoutDirection)num5;
            RectOffset rectOffset1 = new RectOffset(10, 10, 5, 0);

            uiPanel2.autoLayoutPadding = rectOffset1;
            int num6 = 0;

            uiPanel2.autoLayoutStart = (LayoutStart)num6;
            Vector3 vector3_2 = new Vector3(6f, 46f);

            uiPanel2.relativePosition = vector3_2;
            UIPanel uiPanel3 = uiPanel2.AddUIComponent <UIPanel>();
            string  str3     = "PassengerCountPanel";

            uiPanel3.name = str3;
            int num7 = 13;

            uiPanel3.anchor = (UIAnchorStyle)num7;
            int num8 = 1;

            uiPanel3.autoLayout = num8 != 0;
            int num9 = 0;

            uiPanel3.autoLayoutDirection = (LayoutDirection)num9;
            RectOffset rectOffset2 = new RectOffset(0, 5, 0, 0);

            uiPanel3.autoLayoutPadding = rectOffset2;
            int num10 = 0;

            uiPanel3.autoLayoutStart = (LayoutStart)num10;
            Vector2 vector2_1 = new Vector2(345f, 14f);

            uiPanel3.size = vector2_1;
            UILabel uiLabel1 = uiPanel3.AddUIComponent <UILabel>();

            uiLabel1.name         = "PassengerCount";
            uiLabel1.font         = UIUtils.Font;
            uiLabel1.autoSize     = true;
            uiLabel1.height       = 15f;
            uiLabel1.textScale    = 13f / 16f;
            uiLabel1.textColor    = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue);
            this.m_PassengerCount = uiLabel1;
            UIPanel uiPanel4 = uiPanel2.AddUIComponent <UIPanel>();
            string  str4     = "BoredCountdownPanel";

            uiPanel4.name = str4;
            int num11 = 13;

            uiPanel4.anchor = (UIAnchorStyle)num11;
            int num12 = 1;

            uiPanel4.autoLayout = num12 != 0;
            int num13 = 0;

            uiPanel4.autoLayoutDirection = (LayoutDirection)num13;
            RectOffset rectOffset3 = new RectOffset(0, 5, 0, 0);

            uiPanel4.autoLayoutPadding = rectOffset3;
            int num14 = 0;

            uiPanel4.autoLayoutStart = (LayoutStart)num14;
            Vector2 vector2_2 = new Vector2(345f, 14f);

            uiPanel4.size = vector2_2;
            UILabel uiLabel2 = uiPanel4.AddUIComponent <UILabel>();

            uiLabel2.name          = "BoredCountdown";
            uiLabel2.tooltip       = Localization.Get("STOP_PANEL_BORED_TIMER_TOOLTIP");
            uiLabel2.font          = UIUtils.Font;
            uiLabel2.autoSize      = true;
            uiLabel2.height        = 15f;
            uiLabel2.textScale     = 13f / 16f;
            uiLabel2.textColor     = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue);
            uiLabel2.processMarkup = true;
            this.m_BoredCountdown  = uiLabel2;
            UIPanel uiPanel5 = uiPanel2.AddUIComponent <UIPanel>();
            string  str5     = "PassengerStats";

            uiPanel5.name = str5;
            int num15 = 13;

            uiPanel5.anchor = (UIAnchorStyle)num15;
            int num16 = 1;

            uiPanel5.autoLayout = num16 != 0;
            int num17 = 1;

            uiPanel5.autoLayoutDirection = (LayoutDirection)num17;
            RectOffset rectOffset4 = new RectOffset(0, 0, 0, 0);

            uiPanel5.autoLayoutPadding = rectOffset4;
            int num18 = 0;

            uiPanel5.autoLayoutStart = (LayoutStart)num18;
            Vector2 vector2_3 = new Vector2(349f, 75f);

            uiPanel5.size = vector2_3;
            UILabel uiLabel3;
            UILabel uiLabel4;
            UILabel uiLabel5;
            UILabel uiLabel6;
            int     num19 = 1;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, out uiLabel3, out uiLabel4,
                                                                 out uiLabel5, out uiLabel6, num19 != 0);
            uiLabel4.text    = Localization.Get("CURRENT_WEEK");
            uiLabel5.text    = Localization.Get("LAST_WEEK");
            uiLabel6.text    = Localization.Get("AVERAGE");
            uiLabel6.tooltip = string.Format(Localization.Get("AVERAGE_TOOLTIP"),
                                             (object)OptionsWrapper <Settings> .Options.StatisticWeeks);

            int num20 = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, out uiLabel3,
                                                                 out this.m_passengersInCurrent, out this.m_passengersInLast, out this.m_passengersInAverage,
                                                                 num20 != 0);
            uiLabel3.text    = Localization.Get("STOP_PANEL_PASSENGERS_IN");
            uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_IN_TOOLTIP");
            int num21 = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, out uiLabel3,
                                                                 out this.m_passengersOutCurrent, out this.m_passengersOutLast, out this.m_passengersOutAverage,
                                                                 num21 != 0);
            uiLabel3.text    = Localization.Get("STOP_PANEL_PASSENGERS_OUT");
            uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_OUT_TOOLTIP");
            int num22 = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, out uiLabel3,
                                                                 out this.m_passengersTotalCurrent, out this.m_passengersTotalLast, out this.m_passengersTotalAverage,
                                                                 num22 != 0);
            uiLabel3.text    = Localization.Get("STOP_PANEL_PASSENGERS_TOTAL");
            uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_TOTAL_TOOLTIP");
            UIPanel uiPanel6 = uiPanel2.AddUIComponent <UIPanel>();
            string  str6     = "Unbunching";

            uiPanel6.name = str6;
            int num23 = 13;

            uiPanel6.anchor = (UIAnchorStyle)num23;
            int num24 = 1;

            uiPanel6.autoLayout = num24 != 0;
            int num25 = 0;

            uiPanel6.autoLayoutDirection = (LayoutDirection)num25;
            RectOffset rectOffset5 = new RectOffset(0, 5, 0, 0);

            uiPanel6.autoLayoutPadding = rectOffset5;
            int num26 = 0;

            uiPanel6.autoLayoutStart = (LayoutStart)num26;
            Vector2 vector2_4 = new Vector2(345f, 25f);

            uiPanel6.size = vector2_4;
            int num27 = 1;

            uiPanel6.useCenter = num27 != 0;
            UICheckBox uiCheckBox = uiPanel6.AddUIComponent <UICheckBox>();

            uiCheckBox.anchor       = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical;
            uiCheckBox.clipChildren = true;
            uiCheckBox.tooltip      = Localization.Get("STOP_PANEL_UNBUNCHING_TOOLTIP") + System.Environment.NewLine +
                                      Localization.Get("EXPLANATION_UNBUNCHING");
            uiCheckBox.eventClicked += new MouseEventHandler(this.OnUnbunchingClick);
            UISprite uiSprite2 = uiCheckBox.AddUIComponent <UISprite>();

            uiSprite2.spriteName        = "check-unchecked";
            uiSprite2.size              = new Vector2(16f, 16f);
            uiSprite2.relativePosition  = Vector3.zero;
            uiCheckBox.checkedBoxObject = (UIComponent)uiSprite2.AddUIComponent <UISprite>();
            ((UISprite)uiCheckBox.checkedBoxObject).spriteName = "check-checked";
            uiCheckBox.checkedBoxObject.size             = new Vector2(16f, 16f);
            uiCheckBox.checkedBoxObject.relativePosition = Vector3.zero;
            uiCheckBox.label                   = uiCheckBox.AddUIComponent <UILabel>();
            uiCheckBox.label.font              = UIUtils.Font;
            uiCheckBox.label.textColor         = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue);
            uiCheckBox.label.disabledTextColor = (Color32)Color.black;
            uiCheckBox.label.textScale         = 13f / 16f;
            uiCheckBox.label.text              = (int)OptionsWrapper <Settings> .Options.IntervalAggressionFactor == 0
                ? Localization.Get("UNBUNCHING_DISABLED")
                : Localization.Get("UNBUNCHING_ENABLED");
            uiCheckBox.label.relativePosition = new Vector3(22f, 2f);
            uiCheckBox.size   = new Vector2(uiCheckBox.label.width + 22f, 16f);
            this.m_unbunching = uiCheckBox;
            UIPanel uiPanel7 = uiPanel2.AddUIComponent <UIPanel>();
            string  str7     = "Line";

            uiPanel7.name = str7;
            int num28 = 13;

            uiPanel7.anchor = (UIAnchorStyle)num28;
            Vector2 vector2_5 = new Vector2(345f, 25f);

            uiPanel7.size = vector2_5;
            int num29 = 1;

            uiPanel7.autoLayout = num29 != 0;
            int num30 = 0;

            uiPanel7.autoLayoutDirection = (LayoutDirection)num30;
            RectOffset rectOffset6 = new RectOffset(0, 10, 0, 0);

            uiPanel7.autoLayoutPadding = rectOffset6;
            int num31 = 0;

            uiPanel7.autoLayoutStart = (LayoutStart)num31;
            int num32 = 1;

            uiPanel7.useCenter = num32 != 0;
            UILabel uiLabel7 = uiPanel7.AddUIComponent <UILabel>();

            uiLabel7.name              = "Line";
            uiLabel7.anchor            = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical;
            uiLabel7.font              = UIUtils.Font;
            uiLabel7.autoSize          = true;
            uiLabel7.height            = 25f;
            uiLabel7.textScale         = 13f / 16f;
            uiLabel7.textColor         = new Color32((byte)185, (byte)221, (byte)254, byte.MaxValue);
            uiLabel7.verticalAlignment = UIVerticalAlignment.Middle;
            uiLabel7.relativePosition  = new Vector3(0.0f, 5f);
            this.m_Line = uiLabel7;
            UIButton button1 = UIUtils.CreateButton((UIComponent)uiPanel7);

            button1.name        = "ModifyLine";
            button1.autoSize    = true;
            button1.textPadding = new RectOffset(10, 10, 4, 2);
            button1.anchor      = UIAnchorStyle.Left | UIAnchorStyle.CenterVertical;
            button1.localeID    = "VEHICLE_MODIFYLINE";
            button1.textScale   = 0.75f;
            button1.eventClick += new MouseEventHandler(this.OnModifyLineClick);
            UIPanel uiPanel8 = uiPanel2.AddUIComponent <UIPanel>();
            string  str8     = "Buttons";

            uiPanel8.name = str8;
            int num33 = 13;

            uiPanel8.anchor = (UIAnchorStyle)num33;
            int num34 = 1;

            uiPanel8.autoLayout = num34 != 0;
            int num35 = 0;

            uiPanel8.autoLayoutDirection = (LayoutDirection)num35;
            RectOffset rectOffset7 = new RectOffset(0, 5, 0, 0);

            uiPanel8.autoLayoutPadding = rectOffset7;
            int num36 = 0;

            uiPanel8.autoLayoutStart = (LayoutStart)num36;
            Vector2 vector2_6 = new Vector2(345f, 32f);

            uiPanel8.size = vector2_6;
            UIButton button2 = UIUtils.CreateButton((UIComponent)uiPanel8);

            button2.name        = "PreviousStop";
            button2.textPadding = new RectOffset(10, 10, 4, 0);
            button2.text        = Localization.Get("STOP_PANEL_PREVIOUS");
            button2.tooltip     = Localization.Get("STOP_PANEL_PREVIOUS_TOOLTIP");
            button2.textScale   = 0.75f;
            button2.size        = new Vector2(110f, 32f);
            button2.wordWrap    = true;
            button2.eventClick += new MouseEventHandler(this.OnPreviousStopClick);
            UIButton button3 = UIUtils.CreateButton((UIComponent)uiPanel8);

            button3.name             = "DeleteStop";
            button3.textPadding      = new RectOffset(10, 10, 4, 0);
            button3.text             = Localization.Get("STOP_PANEL_DELETE_STOP");
            button3.tooltip          = Localization.Get("STOP_PANEL_DELETE_STOP_TOOLTIP");
            button3.isEnabled        = false;
            button3.textScale        = 0.75f;
            button3.size             = new Vector2(110f, 32f);
            button3.wordWrap         = true;
            button3.hoveredTextColor = (Color32)Color.red;
            button3.focusedTextColor = (Color32)Color.red;
            button3.pressedTextColor = (Color32)Color.red;
            button3.eventClick      += new MouseEventHandler(this.OnDeleteStopClick);
            this.m_DeleteStop        = button3;
            UIButton button4 = UIUtils.CreateButton((UIComponent)uiPanel8);

            button4.name        = "NextStop";
            button4.textPadding = new RectOffset(10, 10, 4, 0);
            button4.text        = Localization.Get("STOP_PANEL_NEXT");
            button4.tooltip     = Localization.Get("STOP_PANEL_NEXT_TOOLTIP");
            button4.textScale   = 0.75f;
            button4.size        = new Vector2(110f, 32f);
            button4.wordWrap    = true;
            button4.eventClick += new MouseEventHandler(this.OnNextStopClick);
        }