예제 #1
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                 = UIHelper.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      = UIHelper.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         = UIHelper.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          = UIHelper.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;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label1_1 = @uiLabel3;
            UILabel  uiLabel4;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label2_1 = @uiLabel4;
            UILabel  uiLabel5;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label3_1 = @uiLabel5;
            UILabel  uiLabel6;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label4_1 = @uiLabel6;
            int      num19    = 1;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_1, label2_1, label3_1, label4_1, 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)ImprovedPublicTransportMod.Settings.StatisticWeeks);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label1_2 = @uiLabel3;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label2_2 = @this.m_passengersInCurrent;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label3_2 = @this.m_passengersInLast;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label4_2 = @this.m_passengersInAverage;
            int      num20    = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_2, label2_2, label3_2, label4_2, num20 != 0);
            uiLabel3.text    = Localization.Get("STOP_PANEL_PASSENGERS_IN");
            uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_IN_TOOLTIP");
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label1_3 = @uiLabel3;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label2_3 = @this.m_passengersOutCurrent;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label3_3 = @this.m_passengersOutLast;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label4_3 = @this.m_passengersOutAverage;
            int      num21    = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_3, label2_3, label3_3, label4_3, num21 != 0);
            uiLabel3.text    = Localization.Get("STOP_PANEL_PASSENGERS_OUT");
            uiLabel3.tooltip = Localization.Get("STOP_PANEL_PASSENGERS_OUT_TOOLTIP");
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label1_4 = @uiLabel3;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label2_4 = @this.m_passengersTotalCurrent;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label3_4 = @this.m_passengersTotalLast;
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            UILabel& label4_4 = @this.m_passengersTotalAverage;
            int      num22    = 0;

            PublicTransportStopWorldInfoPanel.CreateStatisticRow((UIComponent)uiPanel5, label1_4, label2_4, label3_4, label4_4, 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              = UIHelper.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)ImprovedPublicTransportMod.Settings.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              = UIHelper.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 = UIHelper.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 = UIHelper.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 = UIHelper.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 = UIHelper.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);
        }
예제 #2
0
        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              = 244f;
            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          = UIHelper.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 = 211.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 = UIHelper.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              = UIHelper.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              = UIHelper.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              = UIHelper.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;
            UILabel uiLabel5 = uiPanel8.AddUIComponent <UILabel>();

            uiLabel5.name              = "TicketPriceLabel2";
            uiLabel5.text              = Localization.Get("VEHICLE_EDITOR_TICKET_PRICE");
            uiLabel5.font              = UIHelper.Font;
            uiLabel5.textColor         = (Color32)Color.white;
            uiLabel5.textScale         = 0.8f;
            uiLabel5.autoSize          = false;
            uiLabel5.height            = 30f;
            uiLabel5.width             = 115f;
            uiLabel5.wordWrap          = true;
            uiLabel5.verticalAlignment = UIVerticalAlignment.Middle;
            UITextField uiTextField3 = uiPanel8.AddUIComponent <UITextField>();
            string      str15        = "TicketPrice";

            uiTextField3.name = str15;
            string str16 = "0";

            uiTextField3.text = str16;
            Color32 black3 = (Color32)Color.black;

            uiTextField3.textColor = black3;
            string str17 = "EmptySprite";

            uiTextField3.selectionSprite = str17;
            string str18 = "TextFieldPanelHovered";

            uiTextField3.normalBgSprite = str18;
            string str19 = "TextFieldPanel";

            uiTextField3.focusedBgSprite = str19;
            int num47 = 1;

            uiTextField3.builtinKeyNavigation = num47 != 0;
            int num48 = 1;

            uiTextField3.submitOnFocusLost = num48 != 0;
            double num49 = 45.0;

            uiTextField3.width = (float)num49;
            double num50 = 22.0;

            uiTextField3.height = (float)num50;
            int num51 = 4;

            uiTextField3.maxLength = num51;
            int num52 = 1;

            uiTextField3.numericalOnly = num52 != 0;
            int num53 = 1;

            uiTextField3.verticalAlignment = (UIVerticalAlignment)num53;
            RectOffset rectOffset9 = new RectOffset(0, 0, 4, 0);

            uiTextField3.padding = rectOffset9;
            UILabel uiLabel6 = uiPanel8.AddUIComponent <UILabel>();

            uiLabel6.name              = "TicketPriceLabel";
            uiLabel6.text              = "0";
            uiLabel6.font              = UIHelper.Font;
            uiLabel6.textColor         = (Color32)Color.white;
            uiLabel6.textScale         = 0.8f;
            uiLabel6.textAlignment     = UIHorizontalAlignment.Right;
            uiLabel6.autoSize          = false;
            uiLabel6.height            = 30f;
            uiLabel6.width             = 60f;
            uiLabel6.verticalAlignment = UIVerticalAlignment.Middle;
            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              = UIHelper.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              = UIHelper.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 = UIHelper.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 = UIHelper.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 = UIHelper.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;
        }