/// <summary>
        /// Builds the controls for the gui screen by first building the base
        /// controls and then adding the checkbox to enable the plugin and a button to edit
        /// its settings for the world, also initializes an instance of plugin settings to edit.
        /// Adds a new delegate to the create world button, to transfere the set plugin settings
        /// to the plugins settings session component.
        /// </summary>
        protected override void BuildControls()
        {
            base.BuildControls();

            Vector2 vector  = -m_size.Value / 2f + new Vector2(m_isNewGame ? (MARGIN_LEFT_LIST + MyGuiConstants.LISTBOX_WIDTH + MARGIN_LEFT_INFO) : MARGIN_LEFT_LIST, m_isNewGame ? (MARGIN_TOP + 0.015f) : (MARGIN_TOP - 0.105f));
            Vector2 value   = new Vector2(0f, 0.052f);
            Vector2 vector2 = m_size.Value / 2f - vector;

            vector2.X -= MARGIN_RIGHT + 0.005f;
            vector2.Y -= MARGIN_BOTTOM;
            Vector2 vector3 = vector2 * (m_isNewGame ? 0.339f : 0.329f);
            Vector2 vector4 = vector2 - vector3;

            m_enablePluginLabel = new MyGuiControlLabel(null, null, "Enable SEWorldGenPlugin");

            m_enablePlugin = new MyGuiControlCheckbox();
            m_enablePlugin.SetToolTip("Enable the SEWorldGenPlugin for this world");
            m_enablePlugin.IsCheckedChanged = (Action <MyGuiControlCheckbox>) Delegate.Combine(m_enablePlugin.IsCheckedChanged, (Action <MyGuiControlCheckbox>) delegate(MyGuiControlCheckbox s)
            {
                if (PlSettings != null)
                {
                    PlSettings.Enabled             = s.IsChecked;
                    m_pluginSettingsButton.Enabled = m_enablePlugin.IsChecked;
                }
            });

            m_enablePlugin.IsChecked = false;

            m_pluginSettingsButton = new MyGuiControlButton(null, MyGuiControlButtonStyleEnum.Small, null, null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, null, new StringBuilder("Plugin settings"), 0.8f, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, MyGuiControlHighlightType.WHEN_ACTIVE, OnSettingsClick);
            Controls.Add(m_enablePluginLabel);
            Controls.Add(m_enablePlugin);
            Controls.Add(m_pluginSettingsButton);

            m_enablePluginLabel.Position       = vector + value * 5;
            m_enablePluginLabel.PositionY     += MyGuiConstants.BACK_BUTTON_SIZE.Y * 2;
            m_pluginSettingsButton.Enabled     = m_enablePlugin.IsChecked;
            m_enablePlugin.Position            = GetControlPosition();
            m_enablePlugin.PositionY           = m_enablePluginLabel.PositionY;
            m_enablePlugin.OriginAlign         = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
            m_pluginSettingsButton.Position    = m_enablePlugin.Position;
            m_pluginSettingsButton.PositionX  += m_enablePlugin.Size.X + 0.009f;
            m_pluginSettingsButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    MyGuiControlButton b = (MyGuiControlButton)c;
                    if (b.Text == MyTexts.GetString(MyCommonTexts.Start) || b.Text == MyTexts.GetString(MyCommonTexts.Ok))
                    {
                        if (!m_enablePlugin.IsChecked)
                        {
                            PlSettings         = new MyObjectBuilder_WorldSettings();
                            PlSettings.Enabled = m_enablePlugin.IsChecked;
                        }

                        if (m_isNewGame)
                        {
                            b.ButtonClicked += delegate
                            {
                                MySettings.Static.SessionSettings = PlSettings;
                                MyPluginLog.Log("Settings: " + PlSettings.ToString());
                            };
                        }
                        else
                        {
                            b.ButtonClicked += delegate
                            {
                                var name = Checkpoint.SessionName;
                                var path = Path.Combine(MyFileSystem.SavesPath, name.Replace(":", "-"));
                                MyFileUtils.WriteXmlFileToPath(PlSettings, path, MySettingsSession.FILE_NAME, typeof(PluginWorldSettings));
                            };
                        }
                    }
                }
            }

            if (m_isNewGame)
            {
                PlSettings = new MyObjectBuilder_WorldSettings();
            }
            else
            {
                LoadValues();
            }
        }