Esempio n. 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);
        }
        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 = UIHelper.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   = !ImprovedPublicTransportMod.Settings.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)ImprovedPublicTransportMod.Settings.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 = UIHelper.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 = UIHelper.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 = UIHelper.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);
        }