protected virtual void BuildControls()
        {
            Vector2 buttonSize = MyGuiConstants.BACK_BUTTON_SIZE;
            Vector2 buttonsOrigin = m_size.Value / 2 - new Vector2(0.23f, 0.03f);

            if (m_isNewGame)
                AddCaption(MyCommonTexts.ScreenCaptionCustomWorld);
            else
                AddCaption(MyCommonTexts.ScreenCaptionEditSettings);

            int numControls = 0;

            var nameLabel = MakeLabel(MyCommonTexts.Name);
            var descriptionLabel = MakeLabel(MyCommonTexts.Description);
            var gameModeLabel = MakeLabel(MyCommonTexts.WorldSettings_GameMode);
            var onlineModeLabel = MakeLabel(MyCommonTexts.WorldSettings_OnlineMode);
            m_maxPlayersLabel = MakeLabel(MyCommonTexts.MaxPlayers);
            var environmentLabel = MakeLabel(MySpaceTexts.WorldSettings_EnvironmentHostility);
            var scenarioLabel = MakeLabel(MySpaceTexts.WorldSettings_Scenario);
            var soundModeLabel = MakeLabel(MySpaceTexts.WorldSettings_SoundMode);

            float width = 0.284375f + 0.025f;

            m_nameTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_NAME_LENGTH);
            m_descriptionTextbox = new MyGuiControlTextbox(maxLength: MySession.MAX_DESCRIPTION_LENGTH);
            m_onlineMode = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_environment = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_maxPlayersSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: m_onlineMode.Size.X,
                minValue: 2,
                maxValue: 16,
                labelText: new StringBuilder("{0}").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.05f,
                intValue: true
                );



            m_asteroidAmountLabel = MakeLabel(MySpaceTexts.Asteroid_Amount);
            m_asteroidAmountCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));

            m_asteroidAmountCombo.ItemSelected += m_asteroidAmountCombo_ItemSelected;
            m_soundModeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));

            m_scenarioTypesList = new MyGuiControlList();

            // Ok/Cancel
            m_okButton = new MyGuiControlButton(position: buttonsOrigin - new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MyCommonTexts.Ok), onButtonClick: OnOkButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MyCommonTexts.Cancel), onButtonClick: OnCancelButtonClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);

            m_creativeModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MyCommonTexts.WorldSettings_GameModeCreative), onButtonClick: OnCreativeClick);
            m_creativeModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeCreative);
            m_survivalModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MyCommonTexts.WorldSettings_GameModeSurvival), onButtonClick: OnSurvivalClick);
            m_survivalModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeSurvival);

            m_onlineMode.ItemSelected += OnOnlineModeSelect;
            m_onlineMode.AddItem((int)MyOnlineModeEnum.OFFLINE, MyCommonTexts.WorldSettings_OnlineModeOffline);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PRIVATE, MyCommonTexts.WorldSettings_OnlineModePrivate);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.FRIENDS, MyCommonTexts.WorldSettings_OnlineModeFriends);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PUBLIC, MyCommonTexts.WorldSettings_OnlineModePublic);

            m_environment.AddItem((int)MyEnvironmentHostilityEnum.SAFE, MySpaceTexts.WorldSettings_EnvironmentHostilitySafe);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.NORMAL, MySpaceTexts.WorldSettings_EnvironmentHostilityNormal);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysm);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM_UNREAL, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysmUnreal);
            m_environment.ItemSelected += HostilityChanged;

            m_soundModeCombo.AddItem((int)MySoundModeEnum.Arcade, MySpaceTexts.WorldSettings_ArcadeSound);
            m_soundModeCombo.AddItem((int)MySoundModeEnum.Realistic, MySpaceTexts.WorldSettings_RealisticSound);

            if (m_isNewGame)
            {
                m_scenarioTypesGroup = new MyGuiControlRadioButtonGroup();
                m_scenarioTypesGroup.SelectedChanged += scenario_SelectedChanged;
                foreach (var scenario in MyDefinitionManager.Static.GetScenarioDefinitions())
                {
                    if (!scenario.Public && !MyFakes.ENABLE_NON_PUBLIC_SCENARIOS)
                        continue;

                    var button = new MyGuiControlScenarioButton(scenario);
                    m_scenarioTypesGroup.Add(button);
                    m_scenarioTypesList.Controls.Add(button);
                }
            }

            m_nameTextbox.SetToolTip(string.Format(MyTexts.GetString(MyCommonTexts.ToolTipWorldSettingsName), MySession.MIN_NAME_LENGTH, MySession.MAX_NAME_LENGTH));
            m_descriptionTextbox.SetToolTip(MyTexts.GetString(MyCommonTexts.ToolTipWorldSettingsDescription));
            m_environment.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnvironment));
            m_onlineMode.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsOnlineMode));
            m_maxPlayersSlider.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsMaxPlayer));
            m_asteroidAmountCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsAsteroidAmount));
            m_soundModeCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsSoundMode));

            m_nameTextbox.TextChanged += m_nameTextbox_TextChanged;
            m_soundModeCombo.ItemSelected += m_soundModeCombo_ItemSelected;

            var advanced = new MyGuiControlButton(highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Advanced), onButtonClick: OnAdvancedClick);

#if !XB1 // XB1_NOWORKSHOP
            var mods = new MyGuiControlButton(highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MyCommonTexts.WorldSettings_Mods), onButtonClick: OnModsClick);
#endif // !XB1

            m_worldGeneratorButton = new MyGuiControlButton(highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_WorldGenerator), onButtonClick: OnWorldGeneratorClick);

            // Add controls in pairs; label first, control second. They will be laid out automatically this way.
            Controls.Add(nameLabel);
            Controls.Add(m_nameTextbox);
            Controls.Add(descriptionLabel);
            Controls.Add(m_descriptionTextbox);

            Controls.Add(gameModeLabel);
            Controls.Add(m_creativeModeButton);

            if (MyFakes.ENABLE_NEW_SOUNDS)
            {
                Controls.Add(soundModeLabel);
                Controls.Add(m_soundModeCombo);
            }

            Controls.Add(onlineModeLabel);
            Controls.Add(m_onlineMode);
            Controls.Add(m_maxPlayersLabel);
            Controls.Add(m_maxPlayersSlider);

            if (MyFakes.ENABLE_METEOR_SHOWERS)
            {
                Controls.Add(environmentLabel);
                Controls.Add(m_environment);
            }

            if (m_isNewGame && MyFakes.ENABLE_PLANETS == false)
            {
                Controls.Add(m_asteroidAmountLabel);
                Controls.Add(m_asteroidAmountCombo);
            }

            var autoSaveLabel = MakeLabel(MyCommonTexts.WorldSettings_AutoSave);
            m_autoSave = new MyGuiControlCheckbox();
            m_autoSave.SetToolTip(new StringBuilder().AppendFormat(MyCommonTexts.ToolTipWorldSettingsAutoSave, MyObjectBuilder_SessionSettings.DEFAULT_AUTOSAVE_IN_MINUTES).ToString());
            Controls.Add(autoSaveLabel);
            Controls.Add(m_autoSave);

            var scenarioEditModeLabel = MakeLabel(MySpaceTexts.WorldSettings_ScenarioEditMode);
            m_scenarioEditMode = new MyGuiControlCheckbox();
            m_scenarioEditMode.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_ScenarioEditMode));

            Controls.Add(scenarioEditModeLabel);
            Controls.Add(m_scenarioEditMode);

#if !XB1 // XB1_NOWORKSHOP
            if (!MyFakes.XB1_PREVIEW)
                if (MyFakes.ENABLE_WORKSHOP_MODS)
                    Controls.Add(mods);
#endif // !XB1

            Controls.Add(advanced);

            if (m_isNewGame && MyFakes.ENABLE_PLANETS == true)
            {
                Controls.Add(m_worldGeneratorButton);
            }

            float labelSize = 0.20f;

            float MARGIN_TOP = 0.12f;
            float MARGIN_BOTTOM = 0.12f;
            float MARGIN_LEFT = m_isNewGame ? 0.315f : 0.08f;
            float MARGIN_RIGHT = m_isNewGame ? 0.075f : 0.045f;

            // Automatic layout.
            Vector2 originL, originC;
            Vector2 controlsDelta = new Vector2(0f, 0.052f);
            float rightColumnOffset;
            originL = -m_size.Value / 2 + new Vector2(MARGIN_LEFT, MARGIN_TOP);
            originC = originL + new Vector2(labelSize, 0f);
            rightColumnOffset = originC.X + m_onlineMode.Size.X - labelSize - 0.017f;

            foreach (var control in Controls)
            {
                control.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
                if (control is MyGuiControlLabel)
                    control.Position = originL + controlsDelta * numControls;
                else
                    control.Position = originC + controlsDelta * numControls++;
            }

            Controls.Add(m_survivalModeButton);
            m_survivalModeButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER;
            m_survivalModeButton.Position = m_creativeModeButton.Position + new Vector2(m_onlineMode.Size.X, 0);

            if (m_isNewGame)
            {
                Vector2 scenarioPosition = new Vector2(-0.375f, nameLabel.Position.Y);

                m_nameTextbox.Size = m_onlineMode.Size;
                m_descriptionTextbox.Size = m_nameTextbox.Size;

                scenarioLabel.Position = scenarioPosition;

                m_scenarioTypesList.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP;
                m_scenarioTypesList.Position = scenarioLabel.Position + new Vector2(0, 0.02f);
                m_scenarioTypesList.Size = new Vector2(0.19f, m_size.Value.Y - MARGIN_BOTTOM - MARGIN_TOP);
                Controls.Add(scenarioLabel);
                Controls.Add(m_scenarioTypesList);

                MyGuiControlSeparatorList m_verticalLine = new MyGuiControlSeparatorList();
                Vector2 position = nameLabel.Position + new Vector2(-0.025f, -0.02f);
                m_verticalLine.AddVertical(position, m_size.Value.Y - MARGIN_BOTTOM - MARGIN_TOP + 0.04f);
                Controls.Add(m_verticalLine);
            }

            var pos2 = advanced.Position;
            //pos2.X = m_isNewGame ? 0.160f : 0.0f;
            pos2.X = Size.HasValue ? Size.Value.X / 2.0f - advanced.Size.X - MARGIN_RIGHT : 0.0f;
            advanced.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
            advanced.Position = pos2;

#if !XB1 // XB1_NOWORKSHOP
            mods.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
            mods.Position = advanced.Position - new Vector2(advanced.Size.X + 0.017f, 0);
#endif // !XB1

            m_worldGeneratorButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
            m_worldGeneratorButton.Position = advanced.Position - new Vector2(advanced.Size.X + 0.017f, -0.06f);

            if (MyFakes.XB1_PREVIEW)
            {
                var pos2p = m_worldGeneratorButton.Position;
                pos2p.X = Size.HasValue ? Size.Value.X / 2.0f - m_worldGeneratorButton.Size.X - MARGIN_RIGHT : 0.0f;
                m_worldGeneratorButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
                m_worldGeneratorButton.Position = pos2p;

                advanced.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM;
                if (m_isNewGame)
                {
                    advanced.Position = m_worldGeneratorButton.Position - new Vector2(m_worldGeneratorButton.Size.X + 0.017f, 0);
                }
                else
                {
                    advanced.Position = m_worldGeneratorButton.Position - new Vector2(m_worldGeneratorButton.Size.X + 0.017f, 0.008f);
                }
            }

            Controls.Add(m_okButton);
            Controls.Add(m_cancelButton);

            CloseButtonEnabled = true;
        }
        public void Init(IMyGuiControlsParent controlsParent)
        {
            m_controlsParent = controlsParent;
            RefreshUserInfo();

            m_tableFactions = (MyGuiControlTable)controlsParent.Controls.GetControlByName("FactionsTable");
            m_tableFactions.SetColumnComparison(0, (a, b) => ((StringBuilder)a.UserData).CompareToIgnoreCase((StringBuilder)b.UserData));
            m_tableFactions.SetColumnComparison(1, (a, b) => ((StringBuilder)a.UserData).CompareToIgnoreCase((StringBuilder)b.UserData));
            m_tableFactions.ItemSelected += OnFactionsTableItemSelected;
            RefreshTableFactions();
            m_tableFactions.SortByColumn(1);

            m_buttonCreate      = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCreate");
            m_buttonJoin        = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonJoin");
            m_buttonCancelJoin  = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCancelJoin");
            m_buttonLeave       = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonLeave");
            m_buttonSendPeace   = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonSendPeace");
            m_buttonCancelPeace = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonCancelPeace");
            m_buttonAcceptPeace = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAcceptPeace");
            m_buttonMakeEnemy   = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonEnemy");

            m_buttonCreate.ShowTooltipWhenDisabled = true;

            m_buttonCreate.TextEnum      = MySpaceTexts.TerminalTab_Factions_Create;
            m_buttonJoin.TextEnum        = MySpaceTexts.TerminalTab_Factions_Join;
            m_buttonCancelJoin.TextEnum  = MySpaceTexts.TerminalTab_Factions_CancelJoin;
            m_buttonLeave.TextEnum       = MySpaceTexts.TerminalTab_Factions_Leave;
            m_buttonSendPeace.TextEnum   = MySpaceTexts.TerminalTab_Factions_Friend;
            m_buttonCancelPeace.TextEnum = MySpaceTexts.TerminalTab_Factions_CancelPeaceRequest;
            m_buttonAcceptPeace.TextEnum = MySpaceTexts.TerminalTab_Factions_AcceptPeaceRequest;
            m_buttonMakeEnemy.TextEnum   = MySpaceTexts.TerminalTab_Factions_Enemy;


            m_buttonJoin.SetToolTip(MySpaceTexts.TerminalTab_Factions_JoinToolTip);
            m_buttonSendPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_FriendToolTip);

            m_buttonCreate.ButtonClicked      += OnCreateClicked;
            m_buttonJoin.ButtonClicked        += OnJoinClicked;
            m_buttonCancelJoin.ButtonClicked  += OnCancelJoinClicked;
            m_buttonLeave.ButtonClicked       += OnLeaveClicked;
            m_buttonSendPeace.ButtonClicked   += OnFriendClicked;
            m_buttonCancelPeace.ButtonClicked += OnCancelPeaceRequestClicked;
            m_buttonAcceptPeace.ButtonClicked += OnAcceptFriendClicked;
            m_buttonMakeEnemy.ButtonClicked   += OnEnemyClicked;

            // RIGHT SIDE
            m_labelFactionName      = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionName");
            m_labelFactionDesc      = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionDesc");
            m_labelFactionPriv      = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionPrivate");
            m_labelMembers          = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembers");
            m_labelAutoAcceptMember = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembersAcceptEveryone");
            m_labelAutoAcceptPeace  = (MyGuiControlLabel)controlsParent.Controls.GetControlByName("labelFactionMembersAcceptPeace");

            m_labelFactionDesc.Text      = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_CreateFactionDescription).ToString();
            m_labelFactionPriv.Text      = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_Private).ToString();
            m_labelMembers.Text          = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_Members).ToString();
            m_labelAutoAcceptMember.Text = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_AutoAccept).ToString();
            m_labelAutoAcceptPeace.Text  = MyTexts.Get(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequest).ToString();

            m_labelAutoAcceptMember.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptToolTip);
            m_labelAutoAcceptPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequestToolTip);

            m_textFactionDesc = (MyGuiControlMultilineText)controlsParent.Controls.GetControlByName("textFactionDesc");
            m_textFactionPriv = (MyGuiControlMultilineText)controlsParent.Controls.GetControlByName("textFactionPrivate");

            m_textFactionDesc.BackgroundTexture = MyGuiConstants.TEXTURE_HIGHLIGHT_DARK;
            m_textFactionPriv.BackgroundTexture = MyGuiConstants.TEXTURE_HIGHLIGHT_DARK;

            m_tableMembers = (MyGuiControlTable)controlsParent.Controls.GetControlByName("tableMembers");
            m_tableMembers.SetColumnComparison(1, (a, b) => ((int)((MyMemberComparerEnum)a.UserData)).CompareTo((int)((MyMemberComparerEnum)b.UserData)));
            m_tableMembers.ItemSelected += OnTableItemSelected;

            m_checkAutoAcceptMember = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("checkFactionMembersAcceptEveryone");
            m_checkAutoAcceptPeace  = (MyGuiControlCheckbox)controlsParent.Controls.GetControlByName("checkFactionMembersAcceptPeace");

            m_checkAutoAcceptMember.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptToolTip);
            m_checkAutoAcceptPeace.SetToolTip(MySpaceTexts.TerminalTab_Factions_AutoAcceptRequestToolTip);

            m_checkAutoAcceptMember.IsCheckedChanged += OnAutoAcceptChanged;
            m_checkAutoAcceptPeace.IsCheckedChanged  += OnAutoAcceptChanged;

            m_buttonEdit       = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonEdit");
            m_buttonPromote    = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonPromote");
            m_buttonKick       = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonKick");
            m_buttonAcceptJoin = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAcceptJoin");
            m_buttonDemote     = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonDemote");
            m_buttonAddNpc = (MyGuiControlButton)controlsParent.Controls.GetControlByName("buttonAddNpc");

            m_buttonEdit.TextEnum       = MyCommonTexts.Edit;
            m_buttonPromote.TextEnum    = MyCommonTexts.Promote;
            m_buttonKick.TextEnum       = MyCommonTexts.Kick;
            m_buttonAcceptJoin.TextEnum = MyCommonTexts.Accept;
            m_buttonDemote.TextEnum     = MyCommonTexts.Demote;
            m_buttonAddNpc.TextEnum = MySpaceTexts.AddNpcToFaction;
            m_buttonAddNpc.SetToolTip(MySpaceTexts.AddNpcToFactionHelp);

            m_buttonEdit.ButtonClicked       += OnCreateClicked;
            m_buttonPromote.ButtonClicked    += OnPromotePlayerClicked;
            m_buttonKick.ButtonClicked       += OnKickPlayerClicked;
            m_buttonAcceptJoin.ButtonClicked += OnAcceptJoinClicked;
            m_buttonDemote.ButtonClicked     += OnDemoteClicked;
            m_buttonAddNpc.ButtonClicked += OnNewNpcClicked;

            MySession.Static.Factions.FactionCreated           += OnFactionCreated;
            MySession.Static.Factions.FactionEdited            += OnFactionEdited;
            MySession.Static.Factions.FactionStateChanged      += OnFactionsStateChanged;
            MySession.Static.Factions.FactionAutoAcceptChanged += OnAutoAcceptChanged;

            Refresh();
        }
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            Vector2 cbOffset = new Vector2(-0.05f, 0.0f);
            Vector2 controlPadding = new Vector2(0.02f, 0.02f); // X: Left & Right, Y: Bottom & Top

            float textScale = 0.8f;
            float separatorSize = 0.01f;
            float usableWidth = SCREEN_SIZE.X - HIDDEN_PART_RIGHT - controlPadding.X * 2;
            float hiddenPartTop = (SCREEN_SIZE.Y - 1.0f) / 2.0f - 0.02f;

            m_currentPosition = -m_size.Value / 2.0f;
            m_currentPosition += controlPadding;
            m_currentPosition.Y += hiddenPartTop;
            m_scale = textScale;

            float y;
            MyGuiControlButton btn;

            ///////////////////// SPACE MASTER /////////////////////
            var caption = AddCaption(MySpaceTexts.ScreenDebugAdminMenu_Caption, m_labelColor, controlPadding + new Vector2(-HIDDEN_PART_RIGHT, hiddenPartTop));
            m_currentPosition.Y += MyGuiConstants.SCREEN_CAPTION_DELTA_Y + separatorSize + controlPadding.Y;

            m_creativeCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode, false, OnEnableAdminModeChanged, true, null, m_labelColor, cbOffset);
            m_creativeCheckbox.SetToolTip(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode_Tooltip);
            m_creativeCheckbox.IsChecked = MySession.Static.IsAdminModeEnabled(Sync.MyId);
            m_creativeCheckbox.Enabled = MySession.Static.IsAdmin;

         
            ///////////////////// CYCLING /////////////////////
            AddSubcaption(MyCommonTexts.ScreenDebugAdminMenu_CycleObjects, m_labelColor, new Vector2(-HIDDEN_PART_RIGHT, -0.03f));
            m_currentPosition.Y -= 0.065f;

            CreateSelectionCombo();
            m_labelCurrentIndex = AddLabel(String.Empty, m_labelColor, 1);
            m_labelCurrentIndex.TextToDraw = new StringBuilder().AppendFormat(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_CurrentValue), m_entityId == 0 ? "-" : m_metricValue.ToString());

            y = m_currentPosition.Y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_First, c => OnCycleClicked(true, true));
            btn.PositionX = -usableWidth / 3 - controlPadding.X;

            m_currentPosition.Y = y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Next, c => OnCycleClicked(false, false));
            btn.PositionX = -controlPadding.X + separatorSize / 2;

            m_currentPosition.Y = y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Previous, c => OnCycleClicked(false, true));
            btn.PositionX = usableWidth / 3 - controlPadding.X + separatorSize;


            y = m_currentPosition.Y;
            m_removeItemButton = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Remove, c => OnEntityRemoveClicked(MyTrashRemovalOperation.Remove));
            m_removeItemButton.PositionX = -usableWidth / 3 - controlPadding.X;

            m_currentPosition.Y = y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_Stop, c => OnEntityRemoveClicked(MyTrashRemovalOperation.Stop));
            btn.PositionX = -controlPadding.X + separatorSize / 2;

            m_currentPosition.Y = y;
            CreateDepowerButton(usableWidth, controlPadding.X, separatorSize);

            CreateDebugButton(usableWidth, MyCommonTexts.SpectatorControls_None, OnPlayerControl, true, MySpaceTexts.SpectatorControls_None_Desc);

            m_onlySmallGridsCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_SmallGrids, false, OnSmallGridChanged, true, null, m_labelColor, cbOffset);
            m_onlySmallGridsCheckbox.SetToolTip(MyCommonTexts.ScreenDebugAdminMenu_EnableAdminMode_Tooltip);


            m_onlyLargeGridsCheckbox = AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_LargeGrids, false, OnLargeGridChanged, true, null, m_labelColor, cbOffset);
            m_onlyLargeGridsCheckbox.IsChecked = m_cyclingOtions.OnlyLargeGrids;
            m_onlySmallGridsCheckbox.IsChecked = m_cyclingOtions.OnlySmallGrids;

            ///////////////////// TRASH /////////////////////
            AddSubcaption(MyCommonTexts.ScreenDebugAdminMenu_TrashRemoval, m_labelColor, new Vector2(-HIDDEN_PART_RIGHT, -0.03f));
            m_currentPosition.Y -= 0.065f;

            //AddLabel("Select which objects WON'T be removed", white, 1);
            CreateTrashCheckBoxes(ref cbOffset, ref m_labelColor);

            var blockCountLabelText = string.Format(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_WithBlockCount), String.Empty);
            AddLabel(blockCountLabelText, m_labelColor, 1);
            var blockCount = AddTextbox(MyTrashRemoval.PreviewSettings.BlockCountThreshold.ToString(), OnBlockCountChanged, m_labelColor, 0.9f, MyGuiControlTextboxType.DigitsOnly);

            var distancePlayerText = string.Format(MyTexts.GetString(MyCommonTexts.ScreenDebugAdminMenu_DistanceFromPlayer), String.Empty);
            AddLabel(distancePlayerText, m_labelColor, 1);
            AddTextbox(MyTrashRemoval.PreviewSettings.PlayerDistanceThreshold.ToString(), OnDistanceChanged, m_labelColor, 0.9f, MyGuiControlTextboxType.DigitsOnly);

            m_labelNumVisible = AddLabel(MyCommonTexts.ScreenDebugAdminMenu_DistanceFromPlayer.ToString(), m_labelColor, 1);
            m_labelNumVisible.TextToDraw = new StringBuilder();

            AddCheckBox(MyCommonTexts.ScreenDebugAdminMenu_ShowTrashAdminView, () => MyTrashRemoval.PreviewEnabled, v => MyTrashRemoval.PreviewEnabled = v, true, null, m_labelColor, cbOffset);

            y = m_currentPosition.Y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_RemoveTrash, c => OnTrashRemoveClicked(MyTrashRemovalOperation.Remove));
            btn.PositionX = -usableWidth / 3 - controlPadding.X;

            m_currentPosition.Y = y;
            btn = CreateDebugButton(usableWidth / 3, MyCommonTexts.ScreenDebugAdminMenu_StopTrash, c => OnTrashRemoveClicked(MyTrashRemovalOperation.Stop));
            btn.PositionX = -controlPadding.X + separatorSize / 2;

            m_currentPosition.Y = y;
            CreateDepowerButtonTrash(usableWidth,controlPadding.X,separatorSize);

            ///////////////////// REMOVE FLOATING OBJECTS /////////////////////
            CreateDebugButton(usableWidth, MySpaceTexts.ScreenDebugAdminMenu_RemoveFloating, OnRemoveFloating, true);
            
            CreateCustomButtons(usableWidth, controlPadding.X, separatorSize);

            UpdateSmallLargeGridSelection();
            UpdateCyclingAndDepower();
            RecalcTrash();

            bool isClient = Sync.IsServer == false;
            CreateDebugButton(usableWidth / 2, MyCommonTexts.ScreenDebugAdminMenu_ReplicateEverything, OnReplicateEverything, isClient, isClient ? MyCommonTexts.ScreenDebugAdminMenu_ReplicateEverything_Tooltip : MySpaceTexts.ScreenDebugAdminMenu_ReplicateEverythingServer_Tooltip);
        }
        private void CreateGpsPageControls(MyGuiControlTabPage gpsPage)
        {
            gpsPage.Name      = "PageIns";
            gpsPage.TextEnum = MySpaceTexts.TerminalTab_GPS;
            gpsPage.TextScale = 0.9f;
            var spacingH = 0.01f;
            var spacingV = 0.01f;
            var buttonSize = new Vector2(0.29f, 0.052f);
            var smallerBtn = new Vector2(0.13f, 0.04f);
            var left = -0.4625f;
            var top = -0.325f;

            var gpsBlockSearch = new MyGuiControlTextbox()
            {
                Position = new Vector2(left,top),
                Size = new Vector2(0.29f, 0.052f),
                Name = "SearchIns",
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP
            };

            var gpsBlockSearchClear = new MyGuiControlButton()
            {
                Position = new Vector2(left+gpsBlockSearch.Size.X, top+0.01f),
                Size = new Vector2(0.045f, 0.05666667f),
                Name = "SearchInsClear",
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP,
                VisualStyle = MyGuiControlButtonStyleEnum.Close,
                ActivateOnMouseRelease = true
            };
            top += gpsBlockSearch.Size.Y + spacingV;

            var gpsBlockTable = new MyGuiControlTable()
            {
                Position = new Vector2(left,top),
                Size = new Vector2(0.29f, 0.5f),
                Name = "TableINS",
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                ColumnsCount = 1,
                VisibleRowsCount = 14,
                HeaderVisible=false
            };
            gpsBlockTable.SetCustomColumnWidths(new float[1]{1});
            top += gpsBlockTable.Size.Y + spacingV;

            //LEFT SIDE BUTTONS:
            var gpsButtonAdd = new MyGuiControlButton(
                position: new Vector2(left,top),
                visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
                size: new Vector2(140f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Add),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
            {
                Name = "buttonAdd"
            };
            var gpsButtonDelete = new MyGuiControlButton(
                position: new Vector2(left,top +gpsButtonAdd.Size.Y+spacingV),
                visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
                size: new Vector2(140f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Delete),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
            {
                Name = "buttonDelete"
            };
            var gpsButtonFromCurrent = new MyGuiControlButton(
                position: new Vector2(left+gpsButtonAdd.Size.X+spacingH,top),
                visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
                size: new Vector2(310f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_NewFromCurrent),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
            {
                Name = "buttonFromCurrent"
            };
            var gpsButtonFromClipboard = new MyGuiControlButton(
                position: new Vector2(left + gpsButtonAdd.Size.X + spacingH, top + gpsButtonAdd.Size.Y + spacingV),
                visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
                size: new Vector2(310f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_NewFromClipboard),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP)
            {
                Name = "buttonFromClipboard"
            };


            gpsPage.Controls.Add(gpsBlockSearch);
            gpsPage.Controls.Add(gpsBlockSearchClear);
            gpsPage.Controls.Add(gpsBlockTable);
            gpsPage.Controls.Add(gpsButtonAdd);
            gpsPage.Controls.Add(gpsButtonDelete);
            gpsPage.Controls.Add(gpsButtonFromCurrent);
            gpsPage.Controls.Add(gpsButtonFromClipboard);


            //RIGHT SIDE:
            left = -0.15f;
            top = -0.325f;
            var gpsComposite = new MyGuiControlCompositePanel()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                Position = new Vector2(left, top),
                Size = new Vector2(0.6f, 0.39f),
                Name = "compositeIns"
            };
            left += spacingH;
            top += spacingV+0.05f;

            var gpsNameLabel = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top),
                size: new Vector2(0.4f, 0.035f)
            ) { Name = "labelInsName",
                Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Name).ToString()
            };
            var gpsNamePanel = new MyGuiControlTextbox(maxLength:32)
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                Position = new Vector2(left + spacingH + gpsNameLabel.Size.X, top),
                Size = new Vector2(gpsComposite.Size.X - spacingH - gpsNameLabel.Size.X - spacingH -0.01f, 0.035f),
                Name = "panelInsName"
            };

            top += gpsNamePanel.Size.Y + (2f * spacingV);

            var size = gpsNamePanel.Size - new Vector2(0.14f, 0.01f);

            var gpsDescLabel = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top),
                //size: insNamePanel.Size - new Vector2(0.01f, 0.01f)
                size : new Vector2(gpsComposite.Size.X - 0.012f, 0.035f)
            ){
                Name = "labelInsDesc",
                Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Description).ToString()
            };
            top += gpsDescLabel.Size.Y + spacingV;

            var gpsDescText = new MyGuiControlTextbox(
                position: new Vector2(left, top),
                maxLength:255
            )
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                Name = "textInsDesc",
                Size= new Vector2(gpsComposite.Size.X - 2*spacingH, 0.035f)
            };
            top += gpsDescText.Size.Y + 2f * spacingV;

            //X,Y,Z:
            var gpsLabelX = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top),
                size : new Vector2(0.01f, 0.035f),
                text : MyTexts.Get(MySpaceTexts.TerminalTab_GPS_X).ToString()
            )
            {
                Name = "labelInsX",
            };
            left += gpsLabelX.Size.X+spacingH;
            var gpsXCoord = new MyGuiControlTextbox()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                Position = new Vector2(left, top),
                Size = new Vector2((gpsComposite.Size.X - spacingH )/ 3 - 2 * spacingH - gpsLabelX.Size.X, 0.035f),
                Name = "textInsX"
            };
            left += gpsXCoord.Size.X + spacingH;

            var gpsLabelY = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top),
                //size: new Vector2(0.01f, 0.035f),
                size : new Vector2(gpsComposite.Size.X - 0.012f, 0.035f),
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Y).ToString()
                //size: new Vector2(0.4f, 0.035f)
            )
            {
                Name = "labelInsY"
            };
            left += gpsLabelX.Size.X + spacingH;
            var gpsYCoord = new MyGuiControlTextbox()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                Position = new Vector2(left, top),
                Size = new Vector2((gpsComposite.Size.X - spacingH) / 3 - 2 * spacingH - gpsLabelX.Size.X, 0.035f),
                Name = "textInsY"
            };
            left += gpsYCoord.Size.X + spacingH;

            var gpsLabelZ = new MyGuiControlLabel(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top),
                size: new Vector2(0.01f, 0.035f),
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_Z).ToString()
                //size: new Vector2(0.4f, 0.035f)
            )
            {
                Name = "labelInsZ",
            };
            left += gpsLabelX.Size.X + spacingH;
            var gpsZCoord = new MyGuiControlTextbox()
            {
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                Position = new Vector2(left, top),
                Size = new Vector2((gpsComposite.Size.X - spacingH) / 3 - 2 * spacingH - gpsLabelX.Size.X, 0.035f),
                Name = "textInsZ"
            };
            top += gpsNamePanel.Size.Y + (2f * spacingV);

            //BUTTONS:
            left = spacingH-0.15f;

            //SHOW ON HUD & COPY TO CLIPBOARD:
            var checkGpsShowOnHud = new MyGuiControlCheckbox(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top)
            ) { Name = "checkInsShowOnHud" };

            var labelGpsShowOnHud = new MyGuiControlLabel(
             originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
             position: new Vector2(left+ checkGpsShowOnHud.Size.X + spacingH, top),
             size: checkGpsShowOnHud.Size - new Vector2(0.01f, 0.01f)
            )
            {
                Name = "labelInsShowOnHud",
                Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_ShowOnHud).ToString()
            };

            var toClipboardButton = new MyGuiControlButton(
                position: new Vector2(gpsComposite.Position.X+gpsComposite.Size.X-spacingH, top),
                visualStyle: MyGuiControlButtonStyleEnum.Rectangular,
                size: new Vector2(300f, 48f) / MyGuiConstants.GUI_OPTIMAL_SIZE,
                text: MyTexts.Get(MySpaceTexts.TerminalTab_GPS_CopyToClipboard),
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER)
            {
                Name = "buttonToClipboard"
            };

            top += toClipboardButton.Size.Y * 1.1f;
            var checkGpsAlwaysVisible = new MyGuiControlCheckbox(
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
                position: new Vector2(left, top)
            )
            {
                Name = "checkInsAlwaysVisible",
            };
            checkGpsAlwaysVisible.SetToolTip(MySpaceTexts.TerminalTab_GPS_AlwaysVisible_Tooltip);

            var labelGpsAlwaysVisible = new MyGuiControlLabel(
             originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
             position: new Vector2(left + checkGpsShowOnHud.Size.X + spacingH, top),
             size: checkGpsShowOnHud.Size - new Vector2(0.01f, 0.01f)
            )
            {
                Name = "labelInsAlwaysVisible",
                Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_AlwaysVisible).ToString()
            };
            labelGpsAlwaysVisible.SetToolTip(MySpaceTexts.TerminalTab_GPS_AlwaysVisible_Tooltip);

            top += checkGpsShowOnHud.Size.Y;
            var labelIllegalDataWarning = new MyGuiControlLabel(
             originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER,
             position: new Vector2(left + spacingH, top),
             size: new Vector2(gpsComposite.Size.X - 0.012f, 0.035f)
            )
            {
                Name = "TerminalTab_GPS_SaveWarning",
                Text = MyTexts.Get(MySpaceTexts.TerminalTab_GPS_SaveWarning).ToString(),
                ColorMask = Color.Red.ToVector4()
            };

            gpsPage.Controls.Add(gpsComposite);
            gpsPage.Controls.Add(gpsNamePanel);
            gpsPage.Controls.Add(gpsNameLabel);
            gpsPage.Controls.Add(gpsDescLabel);
            gpsPage.Controls.Add(gpsDescText);

            gpsPage.Controls.Add(gpsLabelX);
            gpsPage.Controls.Add(gpsXCoord);
            gpsPage.Controls.Add(gpsLabelY);
            gpsPage.Controls.Add(gpsYCoord);
            gpsPage.Controls.Add(gpsLabelZ);
            gpsPage.Controls.Add(gpsZCoord);

            gpsPage.Controls.Add(toClipboardButton);

            gpsPage.Controls.Add(checkGpsShowOnHud);
            gpsPage.Controls.Add(labelGpsShowOnHud);

            gpsPage.Controls.Add(labelIllegalDataWarning);

            gpsPage.Controls.Add(checkGpsAlwaysVisible);
            gpsPage.Controls.Add(labelGpsAlwaysVisible);
        }
        public void BuildControls()
        {
            MyGuiControlParent parent = new MyGuiControlParent(size: new Vector2(Size.Value.X - 0.05f, Size.Value.Y+0.18f));
            MyGuiControlScrollablePanel scrollPanel = new MyGuiControlScrollablePanel(parent);
            scrollPanel.ScrollbarVEnabled = true;
            scrollPanel.Size = new Vector2(Size.Value.X - 0.05f, 0.8f);

            Vector2 buttonSize = MyGuiConstants.BACK_BUTTON_SIZE;
            Vector2 buttonsOrigin = m_size.Value / 2 - new Vector2(0.23f, 0.03f);

            AddCaption(MySpaceTexts.ScreenCaptionAdvancedSettings);

            int numControls = 0;

            var passwordLabel = MakeLabel(MySpaceTexts.WorldSettings_Password);
            var onlineModeLabel = MakeLabel(MySpaceTexts.WorldSettings_OnlineMode);
            m_maxPlayersLabel = MakeLabel(MySpaceTexts.MaxPlayers);
            m_maxFloatingObjectsLabel = MakeLabel(MySpaceTexts.MaxFloatingObjects);
            m_sunRotationPeriod = MakeLabel(MySpaceTexts.SunRotationPeriod);
            m_sunRotationPeriodValue = MakeLabel(MySpaceTexts.SunRotationPeriod); 
            var gameTypeLabel = MakeLabel(MySpaceTexts.WorldSettings_GameMode);
            var environmentLabel = MakeLabel(MySpaceTexts.WorldSettings_EnvironmentHostility);
            var gameStyleLabel = MakeLabel(MySpaceTexts.WorldSettings_GameStyle);
            var scenarioLabel = MakeLabel(MySpaceTexts.WorldSettings_Scenario);
            var autoHealingLabel = MakeLabel(MySpaceTexts.WorldSettings_AutoHealing);
            var thrusterDamageLabel = MakeLabel(MySpaceTexts.WorldSettings_ThrusterDamage);
            var enableSpectatorLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableSpectator);
            var resetOwnershipLabel = MakeLabel(MySpaceTexts.WorldSettings_ResetOwnership);
            var permanentDeathLabel = MakeLabel(MySpaceTexts.WorldSettings_PermanentDeath);
            var destructibleBlocksLabel = MakeLabel(MySpaceTexts.WorldSettings_DestructibleBlocks);
            var enableIngameScriptsLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableIngameScripts);
            var enable3rdPersonCameraLabel = MakeLabel(MySpaceTexts.WorldSettings_Enable3rdPersonCamera);
            var enableEncountersLabel = MakeLabel(MySpaceTexts.WorldSettings_Encounters);
            var enableToolShakeLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableToolShake);
            var shipsEnabledLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableCargoShips);
            var soundInSpaceLabel = MakeLabel(MySpaceTexts.WorldSettings_SoundInSpace);
            var friendlyFireLabel = MakeLabel(MySpaceTexts.WorldSettings_FriendlyFire);
            var clientCanSaveLabel = MakeLabel(MySpaceTexts.WorldSettings_ClientCanSave);
            m_enableCopyPasteLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableCopyPaste);
            var enableWeaponsLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableWeapons);
            var showPlayerNamesOnHudLabel = MakeLabel(MySpaceTexts.WorldSettings_ShowPlayerNamesOnHud);
            var inventorySizeLabel = MakeLabel(MySpaceTexts.WorldSettings_InventorySize);
            var refineryEfficiencyLabel = MakeLabel(MySpaceTexts.WorldSettings_RefinerySpeed);
            var assemblerEfficiencyLabel = MakeLabel(MySpaceTexts.WorldSettings_AssemblerEfficiency);
            var trashRemovalLabel = MakeLabel(MySpaceTexts.WorldSettings_RemoveTrash);
            var oxygenLabel = MakeLabel(MySpaceTexts.World_Settings_EnableOxygen);
            var disableRespawnShipsLabel = MakeLabel(MySpaceTexts.WorldSettings_DisableRespawnShips);
            var respawnShipDeleteLabel = MakeLabel(MySpaceTexts.WorldSettings_RespawnShipDelete);
            var worldSizeLabel = MakeLabel(MySpaceTexts.WorldSettings_LimitWorldSize);
            var weldingSpeedLabel = MakeLabel(MySpaceTexts.WorldSettings_WelderSpeed);
            var grindingSpeedLabel = MakeLabel(MySpaceTexts.WorldSettings_GrinderSpeed);
            var soundModeLabel = MakeLabel(MySpaceTexts.WorldSettings_SoundMode);
            var spawnShipTimeLabel = MakeLabel(MySpaceTexts.WorldSettings_RespawnShipCooldown);
            var viewDistanceLabel = MakeLabel(MySpaceTexts.WorldSettings_ViewDistance);
            var physicsOptionLabel = MakeLabel(MySpaceTexts.WorldSettings_Physics);
			
			var enableStationVoxelLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableStationVoxel);
            var enableSunRotationLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableSunRotation);

            var enableJetpackLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableJetpack);
            var spawnWithToolsLabel = MakeLabel(MySpaceTexts.WorldSettings_SpawnWithTools);
            var startInRespawnScreenLabel = MakeLabel(MySpaceTexts.WorldSettings_StartInRespawnScreen);

            var enableVoxelDestructionLabel = MakeLabel(MySpaceTexts.WorldSettings_EnableVoxelDestruction);

            float width = 0.284375f + 0.025f;

            m_passwordTextbox = new MyGuiControlTextbox(maxLength: 256);
            m_onlineMode = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_environment = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_autoHealing = new MyGuiControlCheckbox();
            m_thrusterDamage = new MyGuiControlCheckbox();
            m_cargoShipsEnabled = new MyGuiControlCheckbox();
            m_enableSpectator = new MyGuiControlCheckbox();
            m_resetOwnership = new MyGuiControlCheckbox();
            m_permanentDeath = new MyGuiControlCheckbox();
            m_destructibleBlocks = new MyGuiControlCheckbox();
            m_enableIngameScripts = new MyGuiControlCheckbox();
            m_enable3rdPersonCamera = new MyGuiControlCheckbox();
            m_enableEncounters = new MyGuiControlCheckbox();
            m_disableRespawnShips = new MyGuiControlCheckbox();
            m_enableToolShake = new MyGuiControlCheckbox();
            m_enableOxygen = new MyGuiControlCheckbox();
            m_enableOxygen.IsCheckedChanged = (x) =>
                {
                    if (m_showWarningForOxygen && x.IsChecked)
                    {
                        MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(
                                    buttonType: MyMessageBoxButtonsType.YES_NO,
                                    messageText: MyTexts.Get(MySpaceTexts.MessageBoxTextAreYouSureEnableOxygen),
                                    messageCaption: MyTexts.Get(MySpaceTexts.MessageBoxCaptionPleaseConfirm),
                                    callback: (v) =>
                                    {
                                        if (v == MyGuiScreenMessageBox.ResultEnum.NO)
                                        {
                                            x.IsChecked = false;
                                        }
                                    }));
                    }
                };
            m_clientCanSave = new MyGuiControlCheckbox();
            m_enableCopyPaste = new MyGuiControlCheckbox();
            m_weaponsEnabled = new MyGuiControlCheckbox();
            m_showPlayerNamesOnHud = new MyGuiControlCheckbox();			
            m_enableSunRotation = new MyGuiControlCheckbox();

            m_enableSunRotation.IsCheckedChanged = (control) =>
            {
                m_sunRotationIntervalSlider.Enabled = control.IsChecked;
                m_sunRotationPeriodValue.Visible = control.IsChecked;
            };

            m_enableJetpack = new MyGuiControlCheckbox();
            m_spawnWithTools = new MyGuiControlCheckbox();

			m_stationVoxelSupport = new MyGuiControlCheckbox();
            m_maxPlayersSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: m_onlineMode.Size.X,
                minValue: 2,
                maxValue: 16,
                labelText: new StringBuilder("{0}").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.05f,
                intValue: true
                );
            m_maxFloatingObjectsSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: m_onlineMode.Size.X,
                minValue: 16,
                maxValue: 1024,
                labelText: new StringBuilder("{0}").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.05f,
                intValue: true
                );

            m_startInRespawnScreen = new MyGuiControlCheckbox();
            m_enableVoxelDestruction = new MyGuiControlCheckbox();

            m_trashRemoval = new MyGuiControlCheckbox();
            m_respawnShipDelete = new MyGuiControlCheckbox();
            m_worldSizeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_soundModeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_spawnShipTimeCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_viewDistanceCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
            m_physicsOptionsCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));
			

            // Ok/Cancel
            m_okButton = new MyGuiControlButton(position: buttonsOrigin - new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Ok), onButtonClick: OkButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f, 0f), size: buttonSize, text: MyTexts.Get(MySpaceTexts.Cancel), onButtonClick: CancelButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);

            m_creativeModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_GameModeCreative), onButtonClick: CreativeClicked);
            m_creativeModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeCreative);
            m_survivalModeButton = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_GameModeSurvival), onButtonClick: SurvivalClicked);
            m_survivalModeButton.SetToolTip(MySpaceTexts.ToolTipWorldSettingsModeSurvival);

            m_inventory_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_inventory_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_inventory_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnInventoryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_inventory_x1.UserData = 1.0f;
            m_inventory_x3.UserData = 3.0f;
            m_inventory_x10.UserData = 10.0f;
            m_inventory_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x1);
            m_inventory_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x3);
            m_inventory_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Inventory_x10);

            m_assembler_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_assembler_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_assembler_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnAssemblerClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_assembler_x1.UserData = 1.0f;
            m_assembler_x3.UserData = 3.0f;
            m_assembler_x10.UserData = 10.0f;
            m_assembler_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x1);
            m_assembler_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x3);
            m_assembler_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Assembler_x10);

            m_refinery_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_refinery_x3 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x3), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_refinery_x10 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x10), onButtonClick: OnRefineryClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_refinery_x1.UserData = 1.0f;
            m_refinery_x3.UserData = 3.0f;
            m_refinery_x10.UserData = 10.0f;
            m_refinery_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x1);
            m_refinery_x3.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x3);
            m_refinery_x10.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Refinery_x10);

            m_welder_half = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_half), onButtonClick: OnWelderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, textScale: MyGuiConstants.HUD_TEXT_SCALE);
            m_welder_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnWelderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_welder_x2 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x2), onButtonClick: OnWelderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_welder_x5 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x5), onButtonClick: OnWelderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_welder_half.UserData = 0.5f;
            m_welder_x1.UserData = 1.0f;
            m_welder_x2.UserData = 2.0f;
            m_welder_x5.UserData = 5.0f;
            m_welder_half.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Welder_half);
            m_welder_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Welder_x1);
            m_welder_x2.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Welder_x2);
            m_welder_x5.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Welder_x5);

            m_grinder_half = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_half), onButtonClick: OnGrinderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER, textScale: MyGuiConstants.HUD_TEXT_SCALE);
            m_grinder_x1 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Small, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic), onButtonClick: OnGrinderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_grinder_x2 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x2), onButtonClick: OnGrinderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_grinder_x5 = new MyGuiControlButton(visualStyle: MyGuiControlButtonStyleEnum.Tiny, highlightType: MyGuiControlHighlightType.WHEN_ACTIVE, text: MyTexts.Get(MySpaceTexts.WorldSettings_Realistic_x5), onButtonClick: OnGrinderClick, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            m_grinder_half.UserData = 0.5f;
            m_grinder_x1.UserData = 1.0f;
            m_grinder_x2.UserData = 2.0f;
            m_grinder_x5.UserData = 5.0f;
            m_grinder_half.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Grinder_half);
            m_grinder_x1.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Grinder_x1);
            m_grinder_x2.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Grinder_x2);
            m_grinder_x5.SetToolTip(MySpaceTexts.ToolTipWorldSettings_Grinder_x5);

            m_onlineMode.AddItem((int)MyOnlineModeEnum.OFFLINE, MySpaceTexts.WorldSettings_OnlineModeOffline);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PRIVATE, MySpaceTexts.WorldSettings_OnlineModePrivate);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.FRIENDS, MySpaceTexts.WorldSettings_OnlineModeFriends);
            m_onlineMode.AddItem((int)MyOnlineModeEnum.PUBLIC, MySpaceTexts.WorldSettings_OnlineModePublic);

            m_environment.AddItem((int)MyEnvironmentHostilityEnum.SAFE, MySpaceTexts.WorldSettings_EnvironmentHostilitySafe);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.NORMAL, MySpaceTexts.WorldSettings_EnvironmentHostilityNormal);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysm);
            m_environment.AddItem((int)MyEnvironmentHostilityEnum.CATACLYSM_UNREAL, MySpaceTexts.WorldSettings_EnvironmentHostilityCataclysmUnreal);

            m_worldSizeCombo.AddItem((int)MyWorldSizeEnum.TEN_KM, MySpaceTexts.WorldSettings_WorldSize10Km);
            m_worldSizeCombo.AddItem((int)MyWorldSizeEnum.TWENTY_KM, MySpaceTexts.WorldSettings_WorldSize20Km);
            m_worldSizeCombo.AddItem((int)MyWorldSizeEnum.FIFTY_KM, MySpaceTexts.WorldSettings_WorldSize50Km);
            m_worldSizeCombo.AddItem((int)MyWorldSizeEnum.HUNDRED_KM, MySpaceTexts.WorldSettings_WorldSize100Km);
            m_worldSizeCombo.AddItem((int)MyWorldSizeEnum.UNLIMITED, MySpaceTexts.WorldSettings_WorldSizeUnlimited);

            m_soundModeCombo.AddItem((int)MySoundModeEnum.Arcade, MySpaceTexts.WorldSettings_ArcadeSound);
            m_soundModeCombo.AddItem((int)MySoundModeEnum.Realistic, MySpaceTexts.WorldSettings_RealisticSound);

            // Keys will be 10x the represented value (to be able to set them as integers)
            m_spawnShipTimeCombo.AddItem((int)0, MySpaceTexts.WorldSettings_RespawnShip_CooldownsDisabled);
            m_spawnShipTimeCombo.AddItem((int)1, MySpaceTexts.WorldSettings_RespawnShip_x01);
            m_spawnShipTimeCombo.AddItem((int)2, MySpaceTexts.WorldSettings_RespawnShip_x02);
            m_spawnShipTimeCombo.AddItem((int)5, MySpaceTexts.WorldSettings_RespawnShip_x05);
            m_spawnShipTimeCombo.AddItem((int)10, MySpaceTexts.WorldSettings_RespawnShip_Default);
            m_spawnShipTimeCombo.AddItem((int)20, MySpaceTexts.WorldSettings_RespawnShip_x2);
            m_spawnShipTimeCombo.AddItem((int)50, MySpaceTexts.WorldSettings_RespawnShip_x5);
            m_spawnShipTimeCombo.AddItem((int)100, MySpaceTexts.WorldSettings_RespawnShip_x10);
            m_spawnShipTimeCombo.AddItem((int)200, MySpaceTexts.WorldSettings_RespawnShip_x20);
            m_spawnShipTimeCombo.AddItem((int)500, MySpaceTexts.WorldSettings_RespawnShip_x50);
            m_spawnShipTimeCombo.AddItem((int)1000, MySpaceTexts.WorldSettings_RespawnShip_x100);

            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.FIVE_KM, MySpaceTexts.WorldSettings_ViewDistance_5_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.SEVEN_KM, MySpaceTexts.WorldSettings_ViewDistance_7_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.TEN_KM, MySpaceTexts.WorldSettings_ViewDistance_10_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.FIFTEEN_KM, MySpaceTexts.WorldSettings_ViewDistance_15_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.TWENTY_KM, MySpaceTexts.WorldSettings_ViewDistance_20_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.THIRTY_KM, MySpaceTexts.WorldSettings_ViewDistance_30_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.FORTY_KM, MySpaceTexts.WorldSettings_ViewDistance_40_Km);
            m_viewDistanceCombo.AddItem((int)MyViewDistanceEnum.FIFTY_KM, MySpaceTexts.WorldSettings_ViewDistance_50_Km);

            m_physicsOptionsCombo.SetToolTip(MySpaceTexts.WorldSettings_Physics_Tooltip);
            m_physicsOptionsCombo.AddItem((int)MyPhysicsPerformanceEnum.Fast, MySpaceTexts.WorldSettings_Physics_Fast);
            m_physicsOptionsCombo.AddItem((int)MyPhysicsPerformanceEnum.Normal, MySpaceTexts.WorldSettings_Physics_Normal);
            m_physicsOptionsCombo.AddItem((int)MyPhysicsPerformanceEnum.Precise, MySpaceTexts.WorldSettings_Physics_Precise);

			
            m_autoHealing.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsAutoHealing));
            m_thrusterDamage.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsThrusterDamage));
            m_cargoShipsEnabled.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnableCargoShips));
            m_enableSpectator.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnableSpectator));
            m_resetOwnership.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsResetOwnership));
            m_permanentDeath.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsPermanentDeath));
            m_destructibleBlocks.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsDestructibleBlocks));
            m_environment.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnvironment));
            m_onlineMode.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsOnlineMode));
            m_enableCopyPaste.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsEnableCopyPaste));
            m_showPlayerNamesOnHud.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsShowPlayerNamesOnHud));
            m_maxFloatingObjectsSlider.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsMaxFloatingObjects));
            m_maxPlayersSlider.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsMaxPlayer));
            m_weaponsEnabled.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsWeapons));
            m_trashRemoval.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsRemoveTrash));
            m_worldSizeCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsLimitWorldSize));
            m_viewDistanceCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsViewDistance));
            m_soundModeCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsSoundMode));
            m_respawnShipDelete.SetToolTip(MyTexts.GetString(MySpaceTexts.TooltipWorldSettingsRespawnShipDelete));
            m_enableToolShake.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_ToolShake));
            m_enableOxygen.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_EnableOxygen));
            m_enableJetpack.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_EnableJetpack));
            m_spawnWithTools.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_SpawnWithTools));
            m_startInRespawnScreen.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_StartInRespawnScreen));
			
			m_stationVoxelSupport.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_EnableStationVoxel));
            m_disableRespawnShips.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_DisableRespawnShips));
            m_enableVoxelDestruction.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_EnableVoxelDestruction));

            // Add controls in pairs; label first, control second. They will be laid out automatically this way.
            parent.Controls.Add(gameTypeLabel);
            parent.Controls.Add(m_creativeModeButton);

            parent.Controls.Add(inventorySizeLabel);
            parent.Controls.Add(m_inventory_x1);

            parent.Controls.Add(assemblerEfficiencyLabel);
            parent.Controls.Add(m_assembler_x1);

            parent.Controls.Add(refineryEfficiencyLabel);
            parent.Controls.Add(m_refinery_x1);

            parent.Controls.Add(weldingSpeedLabel);
            parent.Controls.Add(m_welder_x1);

            parent.Controls.Add(grindingSpeedLabel);
            parent.Controls.Add(m_grinder_x1);

            parent.Controls.Add(m_maxFloatingObjectsLabel);
            parent.Controls.Add(m_maxFloatingObjectsSlider);

            if (!MyFakes.OCTOBER_RELEASE_HIDE_WORLD_PARAMS)
            {
                parent.Controls.Add(passwordLabel);
                parent.Controls.Add(m_passwordTextbox);
                parent.Controls.Add(gameStyleLabel);
            }

            parent.Controls.Add(worldSizeLabel);
            parent.Controls.Add(m_worldSizeCombo);

            parent.Controls.Add(spawnShipTimeLabel);
            parent.Controls.Add(m_spawnShipTimeCombo);

            parent.Controls.Add(viewDistanceLabel);
            parent.Controls.Add(m_viewDistanceCombo);

            if (MyFakes.ENABLE_NEW_SOUNDS)
            {
                parent.Controls.Add(soundModeLabel);
                parent.Controls.Add(m_soundModeCombo);
            }

            if (MyFakes.ENABLE_PHYSICS_SETTINGS)
            {
                parent.Controls.Add(physicsOptionLabel);
                parent.Controls.Add(m_physicsOptionsCombo);
            }

            parent.Controls.Add(autoHealingLabel);
            parent.Controls.Add(m_autoHealing);

            parent.Controls.Add(m_enableCopyPasteLabel);
            parent.Controls.Add(m_enableCopyPaste);

            if (!MyFakes.OCTOBER_RELEASE_HIDE_WORLD_PARAMS)
            {
                parent.Controls.Add(soundInSpaceLabel);
                parent.Controls.Add(friendlyFireLabel);
            }
            parent.Controls.Add(clientCanSaveLabel);
            parent.Controls.Add(m_clientCanSave);

            parent.Controls.Add(enableWeaponsLabel);
            parent.Controls.Add(m_weaponsEnabled);

            if (MyFakes.ENABLE_TRASH_REMOVAL)
            {
                parent.Controls.Add(trashRemovalLabel);
                parent.Controls.Add(m_trashRemoval);
            }

            parent.Controls.Add(oxygenLabel);
            parent.Controls.Add(m_enableOxygen);
            
            parent.Controls.Add(disableRespawnShipsLabel);
            parent.Controls.Add(m_disableRespawnShips);

            parent.Controls.Add(enableJetpackLabel);
            parent.Controls.Add(m_enableJetpack);

            parent.Controls.Add(enableVoxelDestructionLabel);
            parent.Controls.Add(m_enableVoxelDestruction);

            parent.Controls.Add(respawnShipDeleteLabel);
            parent.Controls.Add(m_respawnShipDelete);

            float labelSize = 0.21f;

            float MARGIN_TOP = 0.03f;

            // Automatic layout.
            Vector2 originL, originC;
            Vector2 controlsDelta = new Vector2(0f, 0.052f);

            originL = -m_size.Value / 2 + new Vector2(0.16f, MARGIN_TOP);
            originC = originL + new Vector2(labelSize, 0f);
            float rightColumnOffset = originC.X + m_onlineMode.Size.X - labelSize - 0.017f;

            foreach (var control in parent.Controls)
            {
                control.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
                if (control is MyGuiControlLabel)
                    control.Position = originL + controlsDelta * numControls;
                else
                    control.Position = originC + controlsDelta * numControls++;
            }


            m_sunRotationIntervalSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: m_onlineMode.Size.X,
                labelSpaceWidth: 0.05f);

            m_sunRotationIntervalSlider.MinValue = 0;
            m_sunRotationIntervalSlider.MaxValue = 1;
            m_sunRotationIntervalSlider.DefaultValue = 0;

            m_sunRotationIntervalSlider.ValueChanged += (MyGuiControlSlider s) =>
            {
                m_tempBuilder.Clear();
                MyValueFormatter.AppendTimeInBestUnit(MathHelper.Clamp(MathHelper.InterpLog(s.Value, MIN_DAY_TIME_MINUTES, MAX_DAY_TIME_MINUTES), MIN_DAY_TIME_MINUTES, MAX_DAY_TIME_MINUTES) * 60, m_tempBuilder);
                m_sunRotationPeriodValue.Text = m_tempBuilder.ToString();
            };

            m_sunRotationIntervalSlider.Position = new Vector2(m_sunRotationIntervalSlider.Position.X + 0.075f, autoHealingLabel.Position.Y);
            m_sunRotationPeriodValue.Position = new Vector2(m_sunRotationIntervalSlider.Position.X +0.12f,m_sunRotationIntervalSlider.Position.Y);
            m_sunRotationPeriod.Position = new Vector2(m_sunRotationIntervalSlider.Position.X - 0.365f, m_sunRotationIntervalSlider.Position.Y);

            parent.Controls.Add(m_sunRotationPeriod);
            parent.Controls.Add(m_sunRotationIntervalSlider);
            parent.Controls.Add(m_sunRotationPeriodValue);

            float buttonsOffset = 0.055f;
            //Left column checkboxes
            autoHealingLabel.Position = new Vector2(autoHealingLabel.Position.X - labelSize / 2, autoHealingLabel.Position.Y + buttonsOffset);
            m_autoHealing.Position = new Vector2(m_autoHealing.Position.X - labelSize / 2, m_autoHealing.Position.Y + buttonsOffset);

            m_enableCopyPasteLabel.Position = new Vector2(m_enableCopyPasteLabel.Position.X - labelSize / 2, m_enableCopyPasteLabel.Position.Y + buttonsOffset);
            m_enableCopyPaste.Position = new Vector2(m_enableCopyPaste.Position.X - labelSize / 2, m_enableCopyPaste.Position.Y + buttonsOffset);

            clientCanSaveLabel.Position = new Vector2(clientCanSaveLabel.Position.X - labelSize / 2, clientCanSaveLabel.Position.Y + buttonsOffset);
            m_clientCanSave.Position = new Vector2(m_clientCanSave.Position.X - labelSize / 2, m_clientCanSave.Position.Y + buttonsOffset);

            enableWeaponsLabel.Position = new Vector2(enableWeaponsLabel.Position.X - labelSize / 2, enableWeaponsLabel.Position.Y + buttonsOffset);
            m_weaponsEnabled.Position = new Vector2(m_weaponsEnabled.Position.X - labelSize / 2, m_weaponsEnabled.Position.Y + buttonsOffset);

            trashRemovalLabel.Position = new Vector2(trashRemovalLabel.Position.X - labelSize / 2, trashRemovalLabel.Position.Y + buttonsOffset);
            m_trashRemoval.Position = new Vector2(m_trashRemoval.Position.X - labelSize / 2, m_trashRemoval.Position.Y + buttonsOffset);

            oxygenLabel.Position = new Vector2(oxygenLabel.Position.X - labelSize / 2, oxygenLabel.Position.Y + buttonsOffset);
            m_enableOxygen.Position = new Vector2(m_enableOxygen.Position.X - labelSize / 2, m_enableOxygen.Position.Y + buttonsOffset);


            respawnShipDeleteLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, m_autoHealing.Position.Y);
            m_respawnShipDelete.Position = new Vector2(rightColumnOffset + labelSize / 2, m_autoHealing.Position.Y);
            m_respawnShipDelete.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER;

            disableRespawnShipsLabel.Position = new Vector2(disableRespawnShipsLabel.Position.X - labelSize / 2, disableRespawnShipsLabel.Position.Y + buttonsOffset);
            m_disableRespawnShips.Position = new Vector2(m_disableRespawnShips.Position.X - labelSize / 2, m_disableRespawnShips.Position.Y + buttonsOffset);

            enableJetpackLabel.Position = new Vector2(enableJetpackLabel.Position.X - labelSize / 2, enableJetpackLabel.Position.Y + buttonsOffset);
            m_enableJetpack.Position = new Vector2(m_enableJetpack.Position.X - labelSize / 2, m_enableJetpack.Position.Y + buttonsOffset);

            enableVoxelDestructionLabel.Position = new Vector2(enableVoxelDestructionLabel.Position.X - labelSize / 2, enableVoxelDestructionLabel.Position.Y + buttonsOffset);
            m_enableVoxelDestruction.Position = new Vector2(m_enableVoxelDestruction.Position.X - labelSize / 2, m_enableVoxelDestruction.Position.Y + buttonsOffset);

            //Middle column checkboxes

            showPlayerNamesOnHudLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, m_enableCopyPasteLabel.Position.Y);
            m_showPlayerNamesOnHud.Position = new Vector2(rightColumnOffset + labelSize / 2, m_enableCopyPasteLabel.Position.Y);

            thrusterDamageLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, clientCanSaveLabel.Position.Y);
            m_thrusterDamage.Position = new Vector2(rightColumnOffset + labelSize / 2, clientCanSaveLabel.Position.Y);

            enableIngameScriptsLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, trashRemovalLabel.Position.Y);
            m_enableIngameScripts.Position = new Vector2(rightColumnOffset + labelSize / 2, m_trashRemoval.Position.Y);

            enable3rdPersonCameraLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, m_enableOxygen.Position.Y);
            m_enable3rdPersonCamera.Position = new Vector2(rightColumnOffset + labelSize / 2, m_enableOxygen.Position.Y);

            enableSunRotationLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, m_disableRespawnShips.Position.Y);
            m_enableSunRotation.Position = new Vector2(rightColumnOffset + labelSize / 2, m_disableRespawnShips.Position.Y);

            spawnWithToolsLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, m_enableJetpack.Position.Y);
            m_spawnWithTools.Position = new Vector2(rightColumnOffset + labelSize / 2, m_enableJetpack.Position.Y);

            if (MyFakes.ENABLE_CARGO_SHIPS)
            {
                parent.Controls.Add(shipsEnabledLabel);
                parent.Controls.Add(m_cargoShipsEnabled);
                shipsEnabledLabel.Position = new Vector2(rightColumnOffset - labelSize / 2, enableWeaponsLabel.Position.Y);
                m_cargoShipsEnabled.Position = new Vector2(rightColumnOffset + labelSize / 2, enableWeaponsLabel.Position.Y);
            }

            enableSpectatorLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, m_autoHealing.Position.Y);
            m_enableSpectator.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_autoHealing.Position.Y);

            resetOwnershipLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, m_enableCopyPasteLabel.Position.Y);
            m_resetOwnership.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_enableCopyPasteLabel.Position.Y);

            permanentDeathLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, clientCanSaveLabel.Position.Y);
            m_permanentDeath.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, clientCanSaveLabel.Position.Y);

            destructibleBlocksLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, m_cargoShipsEnabled.Position.Y);
            m_destructibleBlocks.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_cargoShipsEnabled.Position.Y);

            enableToolShakeLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, trashRemovalLabel.Position.Y);
            m_enableToolShake.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_trashRemoval.Position.Y);

            enableEncountersLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, enable3rdPersonCameraLabel.Position.Y);
            m_enableEncounters.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_enable3rdPersonCamera.Position.Y);

            enableStationVoxelLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, enableSunRotationLabel.Position.Y);
            m_stationVoxelSupport.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_enableSunRotation.Position.Y);

            startInRespawnScreenLabel.Position = new Vector2(rightColumnOffset + 0.75f * labelSize, spawnWithToolsLabel.Position.Y);
            m_startInRespawnScreen.Position = new Vector2(rightColumnOffset + labelSize + 0.75f * labelSize, m_spawnWithTools.Position.Y);

            parent.Controls.Add(showPlayerNamesOnHudLabel);
            parent.Controls.Add(m_showPlayerNamesOnHud);

            parent.Controls.Add(thrusterDamageLabel);
            parent.Controls.Add(m_thrusterDamage);

            parent.Controls.Add(enableSpectatorLabel);
            parent.Controls.Add(m_enableSpectator);

            parent.Controls.Add(resetOwnershipLabel);
            parent.Controls.Add(m_resetOwnership);

            parent.Controls.Add(permanentDeathLabel);
            parent.Controls.Add(m_permanentDeath);

            parent.Controls.Add(destructibleBlocksLabel);
            parent.Controls.Add(m_destructibleBlocks);

            if (MyFakes.ENABLE_PROGRAMMABLE_BLOCK)
            {
                parent.Controls.Add(enableIngameScriptsLabel);
                parent.Controls.Add(m_enableIngameScripts);
            }
            if (MyFakes.ENABLE_TOOL_SHAKE)
            {
                parent.Controls.Add(enableToolShakeLabel);
                parent.Controls.Add(m_enableToolShake);
            }

            parent.Controls.Add(enableEncountersLabel);
            parent.Controls.Add(m_enableEncounters);

            parent.Controls.Add(enable3rdPersonCameraLabel);
            parent.Controls.Add(m_enable3rdPersonCamera);

			parent.Controls.Add(enableStationVoxelLabel);
			parent.Controls.Add(m_stationVoxelSupport);

            parent.Controls.Add(startInRespawnScreenLabel);
            parent.Controls.Add(m_startInRespawnScreen);

            parent.Controls.Add(enableSunRotationLabel);
            parent.Controls.Add(m_enableSunRotation);

            parent.Controls.Add(spawnWithToolsLabel);
            parent.Controls.Add(m_spawnWithTools);

          
            m_survivalModeButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER;
            m_survivalModeButton.Position = m_creativeModeButton.Position + new Vector2(m_onlineMode.Size.X, 0);

            parent.Controls.Add(m_survivalModeButton);

            parent.Controls.Add(m_inventory_x3);
            parent.Controls.Add(m_inventory_x10);
            m_inventory_x3.Position = m_inventory_x1.Position + new Vector2(m_inventory_x1.Size.X + 0.017f, 0);
            m_inventory_x10.Position = m_inventory_x3.Position + new Vector2(m_inventory_x3.Size.X + 0.017f, 0);

            parent.Controls.Add(m_refinery_x3);
            parent.Controls.Add(m_refinery_x10);
            m_refinery_x3.Position = m_refinery_x1.Position + new Vector2(m_refinery_x1.Size.X + 0.017f, 0);
            m_refinery_x10.Position = m_refinery_x3.Position + new Vector2(m_refinery_x3.Size.X + 0.017f, 0);

            parent.Controls.Add(m_assembler_x3);
            parent.Controls.Add(m_assembler_x10);
            m_assembler_x3.Position = m_assembler_x1.Position + new Vector2(m_assembler_x1.Size.X + 0.017f, 0);
            m_assembler_x10.Position = m_assembler_x3.Position + new Vector2(m_assembler_x3.Size.X + 0.017f, 0);

            parent.Controls.Add(m_welder_half);
            parent.Controls.Add(m_welder_x2);
            parent.Controls.Add(m_welder_x5);
            m_welder_half.Position = m_welder_x1.Position + new Vector2(m_welder_x1.Size.X + 0.017f, 0);
            m_welder_x2.Position = m_welder_half.Position + new Vector2(m_welder_half.Size.X + 0.017f, 0);
            m_welder_x5.Position = m_welder_x2.Position + new Vector2(m_welder_x2.Size.X + 0.017f, 0);

            parent.Controls.Add(m_grinder_half);
            parent.Controls.Add(m_grinder_x2);
            parent.Controls.Add(m_grinder_x5);
            m_grinder_half.Position = m_grinder_x1.Position + new Vector2(m_grinder_x1.Size.X + 0.017f, 0);
            m_grinder_x2.Position = m_grinder_half.Position + new Vector2(m_grinder_half.Size.X + 0.017f, 0);
            m_grinder_x5.Position = m_grinder_x2.Position + new Vector2(m_grinder_x2.Size.X + 0.017f, 0);

            Controls.Add(m_okButton);
            Controls.Add(m_cancelButton);

            Controls.Add(scrollPanel);
            CloseButtonEnabled = true;
        }
        public override void RecreateControls(bool constructor)
        {
            float width = 0.284375f + 0.025f;
            base.RecreateControls(constructor);

            AddCaption(MySpaceTexts.ScreenCaptionWorldGeneratorSettings);

            m_moonMinSizeSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: width,
                minValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MIN_LIMIT,
                maxValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MAX_LIMIT,
                labelText: new StringBuilder("{0} m").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.09f,
                intValue: true
            );

            m_moonMinSizeSlider.ValueChanged += (x) =>
            {
                if (x.Value > m_moonMaxSizeSlider.Value)
                {
                    m_moonMaxSizeSlider.Value = x.Value;
                }
            };

            m_moonMaxSizeSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: width,
                minValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MIN_LIMIT,
                maxValue: MyProceduralPlanetCellGenerator.MOON_SIZE_MAX_LIMIT,
                labelText: new StringBuilder("{0} m").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.09f,
                intValue: true
            );

            m_moonMaxSizeSlider.ValueChanged += (x) =>
            {
                if (x.Value < m_moonMinSizeSlider.Value)
                {
                    m_moonMinSizeSlider.Value = x.Value;
                }
            };

            m_planetMinSizeSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: width,
                minValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MIN_LIMIT,
                maxValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MAX_LIMIT,
                labelText: new StringBuilder("{0} m").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.09f,
                intValue: true
            );

            m_planetMinSizeSlider.ValueChanged += (x) =>
            {
                if (x.Value > m_planetMaxSizeSlider.Value)
                {
                    m_planetMaxSizeSlider.Value = x.Value;
                }
            };

            m_planetMaxSizeSlider = new MyGuiControlSlider(
                position: Vector2.Zero,
                width: width,
                minValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MIN_LIMIT,
                maxValue: MyProceduralPlanetCellGenerator.PLANET_SIZE_MAX_LIMIT,
                labelText: new StringBuilder("{0} m").ToString(),
                labelDecimalPlaces: 0,
                labelSpaceWidth: 0.09f,
                intValue: true
            );

            m_planetMaxSizeSlider.ValueChanged += (x) =>
            {
                if (x.Value < m_planetMinSizeSlider.Value)
                {
                    m_planetMinSizeSlider.Value = x.Value;
                }
            };

            m_asteroidAmountLabel = MakeLabel(MySpaceTexts.Asteroid_Amount);
            m_asteroidAmountCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));

            m_asteroidAmountCombo.ItemSelected += m_asteroidAmountCombo_ItemSelected;

            m_asteroidAmountCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettingsAsteroidAmount));

            m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.Normal, MySpaceTexts.WorldSettings_AsteroidAmountNormal);
            m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.More, MySpaceTexts.WorldSettings_AsteroidAmountLarge);
            if (Environment.Is64BitProcess)
                m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.Many, MySpaceTexts.WorldSettings_AsteroidAmountExtreme);

            if (MyFakes.ENABLE_ASTEROID_FIELDS)
            {
                m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.ProceduralLow, MySpaceTexts.WorldSettings_AsteroidAmountProceduralLow);
                m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.ProceduralNormal, MySpaceTexts.WorldSettings_AsteroidAmountProceduralNormal);
                if (Environment.Is64BitProcess)
                    m_asteroidAmountCombo.AddItem((int)AsteroidAmountEnum.ProceduralHigh, MySpaceTexts.WorldSettings_AsteroidAmountProceduralHigh);
            }


            Controls.Add(m_asteroidAmountLabel);
            Controls.Add(m_asteroidAmountCombo);


            m_floraDensityLabel = MakeLabel(MySpaceTexts.WorldSettings_FloraDensity);
            m_floraDensityCombo = new MyGuiControlCombobox(size: new Vector2(width, 0.04f));

            m_floraDensityCombo.AddItem((int)MyFloraDensityEnum.NONE, MySpaceTexts.WorldSettings_FloraDensity_None);
            m_floraDensityCombo.AddItem((int)MyFloraDensityEnum.LOW, MySpaceTexts.WorldSettings_FloraDensity_Low);
            m_floraDensityCombo.AddItem((int)MyFloraDensityEnum.MEDIUM, MySpaceTexts.WorldSettings_FloraDensity_Medium);
            m_floraDensityCombo.AddItem((int)MyFloraDensityEnum.HIGH, MySpaceTexts.WorldSettings_FloraDensity_High);
            m_floraDensityCombo.AddItem((int)MyFloraDensityEnum.EXTREME, MySpaceTexts.WorldSettings_FloraDensity_Extreme);

            m_floraDensityCombo.SetToolTip(MyTexts.GetString(MySpaceTexts.ToolTipWorldSettings_FloraDensity));
            Controls.Add(m_floraDensityLabel);
            Controls.Add(m_floraDensityCombo);

            m_moonSizeMinLabel = MakeLabel(MySpaceTexts.WorldSettings_MoonSizeMin);
            Controls.Add(m_moonSizeMinLabel);
            Controls.Add(m_moonMinSizeSlider);

            m_moonSizeMaxLabel = MakeLabel(MySpaceTexts.WorldSettings_MoonSizeMax);
            Controls.Add(m_moonSizeMaxLabel);
            Controls.Add(m_moonMaxSizeSlider);

            m_planetSizeMinLabel = MakeLabel(MySpaceTexts.WorldSettings_PlanetSizeMin);
            Controls.Add(m_planetSizeMinLabel);
            Controls.Add(m_planetMinSizeSlider);

            m_planetSizeMaxLabel = MakeLabel(MySpaceTexts.WorldSettings_PlanetSizeMax);
            Controls.Add(m_planetSizeMaxLabel);
            Controls.Add(m_planetMaxSizeSlider);


            var enablePlanetsLabel = MakeLabel(MySpaceTexts.WorldSettings_EnablePlanets);
            m_enablePlanets = new MyGuiControlCheckbox();
            m_enablePlanets.SetToolTip(MySpaceTexts.ToolTipWorldSettings_EnablePlanets);
            m_enablePlanets.IsCheckedChanged += enablePlanets_IsCheckedChanged;
            Controls.Add(enablePlanetsLabel);
            Controls.Add(m_enablePlanets);

            int numControls = 0;
            float MARGIN_TOP = 0.22f;
            float MARGIN_LEFT = 0.055f;
            float labelSize = 0.25f;
            Vector2 originL, originC;
            Vector2 controlsDelta = new Vector2(0f, 0.052f);
            float rightColumnOffset;
            originL = -m_size.Value / 2 + new Vector2(MARGIN_LEFT, MARGIN_TOP);
            originC = originL + new Vector2(labelSize, 0f);
            rightColumnOffset = originC.X + width - labelSize - 0.017f;

            foreach (var control in Controls)
            {
                control.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
                if (control is MyGuiControlLabel)
                    control.Position = originL + controlsDelta * numControls;
                else
                    control.Position = originC + controlsDelta * numControls++;
            }


            Vector2 buttonsOrigin = m_size.Value / 2 - new Vector2(0.23f, 0.03f);
            m_okButton = new MyGuiControlButton(position: buttonsOrigin - new Vector2(0.01f, 0f), size: MyGuiConstants.BACK_BUTTON_SIZE, text: MyTexts.Get(MySpaceTexts.Ok), onButtonClick: OkButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            m_cancelButton = new MyGuiControlButton(position: buttonsOrigin + new Vector2(0.01f, 0f), size: MyGuiConstants.BACK_BUTTON_SIZE, text: MyTexts.Get(MySpaceTexts.Cancel), onButtonClick: CancelButtonClicked, originAlign: MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);

            Controls.Add(m_okButton);
            Controls.Add(m_cancelButton);
        }