Beispiel #1
0
 private void DrawAppVersion()
 {
     if (ENABLE_DETAILED_BUILD_INFO)
     {
         Vector2 zero            = Vector2.Zero;
         Vector2 normalizedCoord = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, 8, 8);
         if (!string.IsNullOrEmpty(MyGameService.BranchName))
         {
             BranchName.Clear();
             BranchName.Append(" Branch: ");
             BranchName.Append(MyGameService.BranchName);
             zero = MyGuiManager.MeasureString("BuildInfoHighlight", BranchName, 0.6f);
             MyGuiManager.DrawString("BuildInfoHighlight", BranchName.ToString(), normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
             normalizedCoord.X -= zero.X;
         }
         MyGuiManager.DrawString("BuildInfo", "Space Engineers Version: " + MyFinalBuildConstants.APP_VERSION_STRING_DOTS.ToString(), normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     }
     else
     {
         Vector2 zero            = Vector2.Zero;
         Vector2 normalizedCoord = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, 8, 8);
         if (!string.IsNullOrEmpty(MyGameService.BranchName))
         {
             BranchName.Clear();
             BranchName.Append(" ");
             BranchName.Append(MyGameService.BranchName);
             zero = MyGuiManager.MeasureString("BuildInfoHighlight", BranchName, 0.6f);
             MyGuiManager.DrawString("BuildInfoHighlight", BranchName.ToString(), normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
             normalizedCoord.X -= zero.X;
         }
         MyGuiManager.DrawString("BuildInfo", MyFinalBuildConstants.APP_VERSION_STRING_DOTS.ToString(), normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     }
 }
Beispiel #2
0
    private void DrawPerformanceWarning(int xPosition, int yPosition, MyGuiDrawAlignEnum alignment, string texturepath, float length, float width)
    {
        if (!Controls.Contains(m_warningLabel))
        {
            Controls.Add(m_warningLabel);
        }
        if (m_warningNotifications.Count != 0)
        {
            Vector2 position = MyGuiManager.ComputeFullscreenGuiCoordinate(alignment, xPosition, yPosition);
            position -= new Vector2(length / 1.5f, 0f);

            MyGuiManager.DrawSpriteBatch(Path.GetFullPath(Path.Combine(MyFileSystem.UserDataPath, texturepath)), position, new Vector2(length / 1.5f, width / 1.5f), Color.White, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER);
            StringBuilder stringBuilder = new StringBuilder();
            if (MyInput.Static.IsJoystickLastUsed)
            {
                stringBuilder.AppendFormat(MyCommonTexts.PerformanceWarningCombinationGamepad, MyControllerHelper.GetCodeForControl(MyControllerHelper.CX_BASE, MyControlsSpace.WARNING_SCREEN));
            }
            else
            {
                stringBuilder.AppendFormat(MyCommonTexts.PerformanceWarningCombination, MyGuiSandbox.GetKeyName(MyControlsSpace.HELP_SCREEN));
            }
            MyGuiManager.DrawString("White", MyTexts.GetString(m_warningNotifications[0]), position + new Vector2(0.09f, -0.011f), 0.7f, null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
            MyGuiManager.DrawString("White", stringBuilder.ToString(), position + new Vector2(0.09f, 0.018f), 0.6f, null, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER);
            stringBuilder.Clear();
            MyGuiManager.DrawString("White", stringBuilder.AppendFormat("({0})", m_warningNotifications.Count).ToString(), position + new Vector2(0.177f, -0.023f), 0.55f, null, MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_CENTER);
            m_warningNotifications.RemoveAt(0);
        }
    }
Beispiel #3
0
    private void DrawBuildDate()
    {
        Vector2 normalizedCoord = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

        normalizedCoord.Y -= 0f;
        MyGuiManager.DrawString("BuildInfo", BUILD_DATE, normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
    }
Beispiel #4
0
 public override bool Draw()
 {
     if (!base.Draw())
     {
         return(false);
     }
     if (MySandboxGame.Config.EnablePerformanceWarnings)
     {
         if (!MyGameService.Service.GetInstallStatus(out var _))
         {
             if (!m_warningNotifications.Contains(MyCommonTexts.PerformanceWarningHeading_InstallInProgress))
             {
                 m_warningNotifications.Add(MyCommonTexts.PerformanceWarningHeading_InstallInProgress);
             }
         }
         else if (MySandboxGame.Config.ExperimentalMode && !m_warningNotifications.Contains(MyCommonTexts.PerformanceWarningHeading_ExperimentalMode))
         {
             m_warningNotifications.Add(MyCommonTexts.PerformanceWarningHeading_ExperimentalMode);
         }
     }
     DrawGameLogo(m_transitionAlpha, MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, 44, 68), MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, 1f, 1f, "MenuPacks\\MenuPack\\Textures\\minecraft.png");
     DrawPerformanceWarning(0, 0, MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, "MenuPacks\\MenuPack\\Textures\\toasts.png", 0.3f, 0.1f);
     if (DrawBuildInformation)
     {
         DrawObfuscationStatus();
         DrawSteamStatus();
         DrawAppVersion();
     }
     return(true);
 }
        private void DrawPluginLoaded()
        {
            Vector2 size;
            Vector2 textLeftBottomPosition = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM, 8, 8);

            textLeftBottomPosition.Y -= 0 * TEXT_LINE_HEIGHT;

            StringBuilder pluginWithVersion = new StringBuilder();

            pluginWithVersion.AppendFormat(PLUGIN_LOADED.ToString(), VersionCheck.Static.GetVersion());

            MyGuiManager.DrawString(MyFontEnum.BuildInfo, pluginWithVersion, textLeftBottomPosition, 1, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 1), MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);

            size = MyGuiManager.MeasureString(MyFontEnum.BuildInfo, pluginWithVersion, 1);

            textLeftBottomPosition.X += size.X;

            if (MySettings.Static.Settings.Enable)
            {
                MyGuiManager.DrawString(MyFontEnum.BuildInfoHighlight, PLUGIN_ENABLED, textLeftBottomPosition, 1, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 1), MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
            }
            else
            {
                MyGuiManager.DrawString(MyFontEnum.BuildInfoHighlight, PLUGIN_DISABLED, textLeftBottomPosition, 1, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 1), MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM);
            }
        }
Beispiel #6
0
    /// <summary>
    /// Creates the news and Dlc banners on the right of the screen.
    /// </summary>
    private void CreateRightSection(Vector2 buttonSize)
    {
        m_newsControl = new MyGuiControlNews
        {
            Position    = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM) - 5f * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA,
            Size        = new Vector2(0.4f, 0.28f),
            OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP
        };
        Controls.Add(m_newsControl);
        float   num  = m_newsControl.Size.X - 0.004f;
        float   num2 = 0.407226563f;
        float   num3 = num * num2 * 1.33333337f;
        Vector2 size = new Vector2(m_newsControl.Size.X, num3 + 0.052f);

        m_dlcBannersControl = new MyGuiControlDLCBanners
        {
            Position    = new Vector2(m_newsControl.Position.X, 0.26f),
            OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP
        };
        m_dlcBannersControl.Size    = size;
        m_dlcBannersControl.Visible = false;
        Vector2 vector = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM) + new Vector2(buttonSize.X / 2f, 0f) + new Vector2(15f, 0f) / MyGuiConstants.GUI_OPTIMAL_SIZE;

        vector.Y += 0.043f;
        Controls.Add(m_dlcBannersControl);
    }
Beispiel #7
0
        public sealed override void RecreateControls(bool constructor)
        {
            Elements.Clear();
            Elements.Add(new MyGuiControlLabel
            {
                Text        = "Torch Console",
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP,
                Position    = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP)
            });

            Controls.Clear();
            _textBox = new MyGuiControlTextbox
            {
                BorderEnabled = false,
                Enabled       = true,
                OriginAlign   = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP,
                Position      = new Vector2(-0.5f)
            };
            Controls.Add(_textBox);

            var pistonBtn = new MyGuiControlImageButton
            {
                Name          = "TorchButton",
                Text          = "Torch",
                HighlightType = MyGuiControlHighlightType.WHEN_CURSOR_OVER,
                Visible       = true,
                OriginAlign   = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP
            };

            Controls.Add(pistonBtn);
        }
Beispiel #8
0
 private void DrawBuildDate()
 {
     Vector2 textRightBottomPosition = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     textRightBottomPosition.Y -= 0 * TEXT_LINE_HEIGHT;
     MyGuiManager.DrawString(MyFontEnum.BuildInfo, BUILD_DATE, textRightBottomPosition, MyGuiConstants.APP_VERSION_TEXT_SCALE,
         new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
 }
 public MyGuiScreenCreateOrEditFaction()
     : base(size: new Vector2(0.5f, 0.5f),
            position: MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER),
            backgroundColor: MyGuiConstants.SCREEN_BACKGROUND_COLOR,
            backgroundTexture: MyGuiConstants.TEXTURE_SCREEN_BACKGROUND.Texture)
 {
     CanHideOthers         = false;
     EnabledBackgroundFade = false;
 }
Beispiel #10
0
 private void DrawSteamStatus()
 {
     if (!MyGameService.IsActive)
     {
         Vector2 normalizedCoord = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
         normalizedCoord.Y -= 0.028f;
         MyGuiManager.DrawString("BuildInfo", "SERVICE NOT AVAILABLE".ToString(), normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     }
 }
Beispiel #11
0
 private void DrawObfuscationStatus()
 {
     if (MyPerGameSettings.ShowObfuscationStatus && !MyObfuscation.Enabled)
     {
         Vector2 normalizedCoord = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
         normalizedCoord.Y -= 0.0420000032f;
         MyGuiManager.DrawString("BuildInfoHighlight", "NOT OBFUSCATED", normalizedCoord, 0.6f, new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha, 0.6f), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     }
 }
Beispiel #12
0
        /// <inheritdoc />
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);
            var     buttonSize = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui;
            Vector2 leftButtonPositionOrigin = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM) + new Vector2(buttonSize.X / 2f, 0f);
            var     btn = MakeButton(leftButtonPositionOrigin - 9 * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyStringId.GetOrCompute("Torch"), TorchButtonClicked);

            Controls.Add(btn);
        }
Beispiel #13
0
 private void DrawSteamStatus()
 {
     if (MySandboxGame.Services.SteamService == null || !MySteam.IsActive)
     {
         Vector2 textRightBottomPosition = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
         textRightBottomPosition.Y -= 2 * TEXT_LINE_HEIGHT;
         MyGuiManager.DrawString(MyFontEnum.BuildInfo, STEAM_INACTIVE, textRightBottomPosition, MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                 new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
     }
 }
        /// <summary>
        /// Recreates the gui controls and replaces the new game button to insert its own new game menu.
        /// Also shows a message, if a new version of the plugin is available
        /// </summary>
        /// <param name="constructor"></param>
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);
            if (!m_pauseGame)
            {
                m_elemtents = new MyGuiControlElementGroup();
                m_elemtents.HighlightChanged += OnHighlightChange;
                MyGuiControlButton button = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonCampaign))
                        {
                            button = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button != null)
                {
                    int index = Controls.IndexOf(button);
                    MyGuiControlButton newGameButton = MakeButton(button.Position, MyCommonTexts.ScreenMenuButtonCampaign, OnNewGameClick);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button.Tooltips);
                }

                if (!VersionCheck.Static.IsNewest() && !OPENED_VERSION_NOTIFICATION)
                {
                    OPENED_VERSION_NOTIFICATION = true;
                    MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox(MyMessageBoxStyleEnum.Info, MyMessageBoxButtonsType.YES_NO, new StringBuilder(MyPluginTexts.MESSAGES.UPDATE_AVAILABLE_BOX), new StringBuilder(MyPluginTexts.MESSAGES.UPDATE_AVAILABLE_TITLE), null, null, null, null, OnUpdateNotifiactionMessageClose));
                }
            }

            MyGuiControlLabel pluginVersionLabel = new MyGuiControlLabel();

            pluginVersionLabel.Text        = string.Format(PLUGIN_LOADED.ToString(), VersionCheck.Static.GetVersion());
            pluginVersionLabel.Position    = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM, 8, 8);
            pluginVersionLabel.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;
            pluginVersionLabel.PositionY  -= pluginVersionLabel.Size.Y / 2;

            MyGuiControlButton pluginSettingsBtn = MyPluginGuiHelper.CreateDebugButton("Settings", OnPluginSettingsClick);

            pluginSettingsBtn.Position    = pluginVersionLabel.Position;
            pluginSettingsBtn.PositionX  += pluginVersionLabel.Size.X + (8 / MyGuiConstants.GUI_OPTIMAL_SIZE.X);
            pluginSettingsBtn.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_CENTER;

            Controls.Add(pluginVersionLabel);
            Controls.Add(pluginSettingsBtn);
        }
    private void CreateMainMenu()
    {
        base.GamepadHelpTextId     = MySpaceTexts.MainMenuScreen_Help_Screen;
        base.EnabledBackgroundFade = false;
        MyGuiControlButton myGuiControlButton  = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_CENTER, 0, 0), MyCustomTexts.StartGame, OnClickStartGame);
        MyGuiControlButton myGuiControlButton2 = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, 196, 84), MyCustomTexts.OldButtonsAndMenus, OnClickOldMenus);

        Controls.Add(myGuiControlButton);
        m_elementGroup.Add(myGuiControlButton);
        Controls.Add(myGuiControlButton2);
        m_elementGroup.Add(myGuiControlButton2);
    }
Beispiel #16
0
        /// <inheritdoc />
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            Vector2 minSizeGui = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui;
            Vector2 value      = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM, 54, 54) + new Vector2(minSizeGui.X / 2f, 0f) + new Vector2(15f, 0f) / MyGuiConstants.GUI_OPTIMAL_SIZE;

            MyGuiControlButton myGuiControlButton = MakeButton(value - 9 * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA,
                                                               MyStringId.GetOrCompute("Torch"), TorchButtonClicked, MyCommonTexts.ToolTipExitToWindows);

            Controls.Add(myGuiControlButton);
            _elementsGroup.Invoke(this).Add(myGuiControlButton);
        }
Beispiel #17
0
        private void DrawAppVersion()
        {
            Vector2 size;
            Vector2 textRightBottomPosition =
                MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

            textRightBottomPosition.Y -= 1 * TEXT_LINE_HEIGHT;

            if (MyFinalBuildConstants.IS_OFFICIAL)
            {
                if (MySteam.BranchName != null)
                {
                    BranchName.Clear();
                    BranchName.Append(" ");
                    BranchName.Append(MySteam.BranchName);

                    size = MyGuiManager.MeasureString(MyFontEnum.BuildInfoHighlight, BranchName,
                                                      MyGuiConstants.APP_VERSION_TEXT_SCALE);
                    MyGuiManager.DrawString(MyFontEnum.BuildInfoHighlight, BranchName, textRightBottomPosition,
                                            MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                            new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha),
                                            MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

                    textRightBottomPosition.X -= size.X;
                }
            }
            else
            {
                size = MyGuiManager.MeasureString(MyFontEnum.BuildInfoHighlight, NON_OFFICIAL,
                                                  MyGuiConstants.APP_VERSION_TEXT_SCALE);
                MyGuiManager.DrawString(MyFontEnum.BuildInfoHighlight, NON_OFFICIAL, textRightBottomPosition,
                                        MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                        new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha),
                                        MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

                textRightBottomPosition.X -= size.X;
            }

            size = MyGuiManager.MeasureString(MyFontEnum.BuildInfo, PLATFORM, MyGuiConstants.APP_VERSION_TEXT_SCALE);
            MyGuiManager.DrawString(MyFontEnum.BuildInfo, PLATFORM, textRightBottomPosition,
                                    MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                    new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha),
                                    MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);

            textRightBottomPosition.X -= size.X;

            MyGuiManager.DrawString(MyFontEnum.BuildInfo, APP_VERSION, textRightBottomPosition,
                                    MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                    new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha),
                                    MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
        }
Beispiel #18
0
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);

            var align     = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP;
            var logoPanel = new MyGuiControlPanel(
                position: MyGuiManager.ComputeFullscreenGuiCoordinate(align, 54, 84),
                size: MyGuiConstants.TEXTURE_KEEN_LOGO.MinSizeGui,
                originAlign: align
                );

            logoPanel.BackgroundTexture = MyGuiConstants.TEXTURE_KEEN_LOGO;
            Controls.Add(logoPanel);
        }
Beispiel #19
0
        private void DrawObfuscationStatus()
        {
            if (!MyPerGameSettings.ShowObfuscationStatus)
            {
                return; // no obfuscation for space anymore !
            }

            if (!MyObfuscation.Enabled)
            {
                Vector2 textRightBottomPosition = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
                textRightBottomPosition.Y -= 3 * TEXT_LINE_HEIGHT;
                MyGuiManager.DrawString(MyFontEnum.BuildInfoHighlight, NOT_OBFUSCATED, textRightBottomPosition, MyGuiConstants.APP_VERSION_TEXT_SCALE,
                                        new Color(MyGuiConstants.LABEL_TEXT_COLOR * m_transitionAlpha), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM);
            }
        }
        public MyGuiScreenVoxelHandSetting()
            : base(size: new Vector2(0.25f, 0.5f),
                   backgroundColor: MyGuiConstants.SCREEN_BACKGROUND_COLOR,
                   backgroundTexture: MyGuiConstants.TEXTURE_HUD_BG_LARGE_DEFAULT.Texture)
        {
            CanHideOthers         = false;
            EnabledBackgroundFade = false;

            m_position    = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP);
            m_position.X -= m_size.Value.X * 0.44f;
            m_position.Y += m_size.Value.Y - 0.24f;

            RecreateControls(true);

            MySessionComponentVoxelHand.Static.ScreenVisible = true;
        }
Beispiel #21
0
        public MyGuiScreenWardrobe(MyCharacter user)
            : base(size: new Vector2(0.31f, 0.55f),
                   position: MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP),
                   backgroundColor: MyGuiConstants.SCREEN_BACKGROUND_COLOR,
                   backgroundTexture: MyGuiConstants.TEXTURE_SCREEN_BACKGROUND.Texture)
        {
            EnabledBackgroundFade = false;

            m_user        = user;
            m_storedModel = m_user.ModelName;
            m_storedHSV   = m_user.ColorMask;

            m_selectedModel = GetDisplayName(m_user.ModelName);
            m_selectedHSV   = m_storedHSV;

            m_displayModels = new Dictionary <string, int>();
            m_models        = new Dictionary <int, string>();

            int i = 0;

            foreach (var character in MyDefinitionManager.Static.Characters)
            {
                if (!character.UsableByPlayer)
                {
                    continue;
                }

                var key = GetDisplayName(character.Name);
                m_displayModels[key] = i;
                m_models[i++]        = character.Name;
            }

            RecreateControls(true);

            m_sliderHue.Value        = m_selectedHSV.X * 360f;
            m_sliderSaturation.Value = m_selectedHSV.Y * 100f;
            m_sliderValue.Value      = m_selectedHSV.Z * 100f;

            m_sliderHue.ValueChanged        += OnValueChange;
            m_sliderSaturation.ValueChanged += OnValueChange;
            m_sliderValue.ValueChanged      += OnValueChange;

            ChangeCamera();
            UpdateLabels();
        }
Beispiel #22
0
    /// <summary>
    /// Draws the buttons in the main menu or pause menu. Also draws the Keen Software House logo and controllor hints.
    /// </summary>
    /// <param name="constructor"></param>
    public override void RecreateControls(bool constructor)
    {
        base.RecreateControls(constructor);
        m_elementGroup = new MyGuiControlElementGroup();
        Vector2 minSizeGui = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui;
        Vector2 leftButtonPositionOrigin = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM) + new Vector2(minSizeGui.X / 2f, 0f) + new Vector2(15f, 0f) / MyGuiConstants.GUI_OPTIMAL_SIZE;

        leftButtonPositionOrigin.Y += 0.043f;
        _ = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM) + new Vector2((0f - minSizeGui.X) / 2f, 0f);
        Vector2 lastButtonPosition = Vector2.Zero;

        if (MyGuiScreenGamePlay.Static == null)
        {
            CreateMainMenu(leftButtonPositionOrigin, out lastButtonPosition);
        }
        else
        {
            CreateInGameMenu(leftButtonPositionOrigin, out lastButtonPosition);
        }
        //Draws the controllor hints under the buttons.
        MyGuiControlLabel myGuiControlLabel = new MyGuiControlLabel(lastButtonPosition + new Vector2((0f - minSizeGui.X) / 2f, minSizeGui.Y / 2f));

        myGuiControlLabel.Name = MyGuiScreenBase.GAMEPAD_HELP_LABEL_NAME;
        Controls.Add(myGuiControlLabel);
        //Draws the Keen Software House Logo in the top righthand corner.
        MyGuiControlPanel myGuiControlPanel = new MyGuiControlPanel(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, 49, 82), MyGuiConstants.TEXTURE_KEEN_LOGO.MinSizeGui, null, null, null, MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP);

        myGuiControlPanel.BackgroundTexture = MyGuiConstants.TEXTURE_KEEN_LOGO;
        Controls.Add(myGuiControlPanel);
        //Refreshes the badges under the game logo.
        m_myBadgeHelper.RefreshGameLogo();
        //Creates the news and Dlc banners on the right of the screen.
        CreateRightSection(minSizeGui);
        CheckLowMemSwitchToLow();
        if (MyGuiScreenGamePlay.Static == null && !MyPlatformGameSettings.FEEDBACK_ON_EXIT && !string.IsNullOrEmpty(MyPlatformGameSettings.FEEDBACK_URL))
        {
            MyGuiSandbox.OpenUrl(MyPlatformGameSettings.FEEDBACK_URL, UrlOpenMode.ExternalWithConfirm, MyTexts.Get(MyCommonTexts.MessageBoxTextBetaFeedback), MyTexts.Get(MyCommonTexts.MessageBoxCaptionBetaFeedback));
        }
    }
Beispiel #23
0
        //  Because only main menu's controla depends on fullscreen pixel coordinates (not normalized), after we change
        //  screen resolution we need to recreate controls too. Otherwise they will be still on old/bad positions, and
        //  for example when changing from 1920x1200 to 800x600 they would be out of screen
        public override void RecreateControls(bool constructor)
        {
            base.RecreateControls(constructor);


            // Enable background fade when we're in game, but in main menu we disable it.
            var     buttonSize = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui;
            Vector2 leftButtonPositionOrigin  = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM) + new Vector2(buttonSize.X / 2f, 0f);
            Vector2 rightButtonPositionOrigin = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM) + new Vector2(-buttonSize.X / 2f, 0f);

            // In main menu
            if (MyGuiScreenGamePlay.Static == null)
            {
                EnabledBackgroundFade = false;
                // Left main menu part

                var a = MyGuiManager.GetSafeFullscreenRectangle();
                var fullScreenSize = new Vector2(a.Width / (a.Height * (4 / 3f)), 1f);

                // New Game
                // Load world
                // Join world
                // Workshop
                //
                // Options
                // Help
                // Credits
                // Exit to windows
                int buttonIndex = MyPerGameSettings.MultiplayerEnabled ? 9 : 8;
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA - MyGuiConstants.MENU_BUTTONS_POSITION_DELTA / 2, MyCommonTexts.ScreenMenuButtonContinueGame, OnContinueGameClicked));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonCampaign, OnClickNewGame));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonLoadGame, OnClickLoad));
                if (MyPerGameSettings.MultiplayerEnabled)
                {
                    Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonJoinGame, OnJoinWorld));
                }
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonCustomGame, OnCustomGameClicked));
                --buttonIndex;
                //Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonSubscribedWorlds, OnClickSubscribedWorlds, MyCommonTexts.ToolTipMenuSubscribedWorlds));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonOptions, OnClickOptions));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonHelp, OnClickHelp));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonCredits, OnClickCredits));
                Controls.Add(MakeButton(leftButtonPositionOrigin - (buttonIndex--) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonExitToWindows, OnClickExitToWindows));

                Vector2 textRightTopPosition = MyGuiManager.GetScreenTextRightTopPosition();
                Vector2 position             = textRightTopPosition + 8f * MyGuiConstants.CONTROLS_DELTA + new Vector2(-.1f, .06f);
            }
            else // In-game
            {
                MyAnalyticsHelper.ReportActivityStart(null, "show_main_menu", string.Empty, "gui", string.Empty);

                EnabledBackgroundFade = true;
                int buttonRowIndex = Sync.MultiplayerActive ? 6 : 5;

                // Save
                // Load button (only on dev)
                //
                // Options
                // Help
                // Exit to main menu
                var saveButton   = MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonSave, OnClickSaveWorld);
                var saveAsButton = MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.LoadScreenButtonSaveAs, OnClickSaveAs);

                if (!Sync.IsServer || (MySession.Static.Battle))
                {
                    saveButton.Enabled = false;
                    saveButton.ShowTooltipWhenDisabled = true;
                    saveButton.SetToolTip(MyCommonTexts.NotificationClientCannotSave);

                    saveAsButton.Enabled = false;
                    saveButton.ShowTooltipWhenDisabled = true;
                    saveButton.SetToolTip(MyCommonTexts.NotificationClientCannotSave);
                }

                Controls.Add(saveButton);
                Controls.Add(saveAsButton);

                //               --buttonRowIndex; // empty line
                if (Sync.MultiplayerActive)
                {
                    Controls.Add(MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonPlayers, OnClickPlayers));
                }
                Controls.Add(MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonOptions, OnClickOptions));
                Controls.Add(MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonHelp, OnClickHelp));
                Controls.Add(MakeButton(leftButtonPositionOrigin - ((float)(--buttonRowIndex)) * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA, MyCommonTexts.ScreenMenuButtonExitToMainMenu, OnExitToMainMenuClick));
            }

            var logoPanel = new MyGuiControlPanel(
                position: MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, 54, 84),
                size: MyGuiConstants.TEXTURE_KEEN_LOGO.MinSizeGui,
                originAlign: MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP
                );

            logoPanel.BackgroundTexture = MyGuiConstants.TEXTURE_KEEN_LOGO;
            Controls.Add(logoPanel);

            // Recommend button
            Vector2 pos = rightButtonPositionOrigin - 8f * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA;

            Controls.Add(MakeButton(pos, MyCommonTexts.ScreenMenuButtonRecommend, OnClickRecommend));
            m_newsControl = new MyGuiControlNews()
            {
                Position    = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM) - 7f * MyGuiConstants.MENU_BUTTONS_POSITION_DELTA,
                Size        = new Vector2(0.4f, 0.28f),
                OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP,
            };
            Controls.Add(m_newsControl);

            var webButton = MakeButton(
                MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_CENTER_AND_VERTICAL_BOTTOM, 70),
                MySpaceTexts.Blank, OnClickGameWeb);

            webButton.Text        = MyPerGameSettings.GameWebUrl;
            webButton.VisualStyle = MyGuiControlButtonStyleEnum.UrlText;
            Controls.Add(webButton);

            var reportButton = MakeButton(
                new Vector2(m_newsControl.Position.X, m_newsControl.Position.Y + m_newsControl.Size.Y),
                //MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM, 140,80),
                MyCommonTexts.ReportBug, OnClickReportBug);

            reportButton.OriginAlign = MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP;
            reportButton.VisualStyle = MyGuiControlButtonStyleEnum.UrlText;
            Controls.Add(reportButton);

            CheckLowMemSwitchToLow();
        }
        public MyGuiScreenWardrobe(MyCharacter user, HashSet <string> customCharacterNames = null)
            : base(size: new Vector2(0.31f, 0.55f),
                   position: MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP),
                   backgroundColor: MyGuiConstants.SCREEN_BACKGROUND_COLOR,
                   backgroundTexture: MyGuiConstants.TEXTURE_SCREEN_BACKGROUND.Texture)
        {
            EnabledBackgroundFade = false;

            m_user        = user;
            m_storedModel = m_user.ModelName;
            m_storedHSV   = m_user.ColorMask;

            m_selectedModel = GetDisplayName(m_user.ModelName);
            m_selectedHSV   = m_storedHSV;

            m_displayModels = new Dictionary <string, int>();
            m_models        = new Dictionary <int, string>();

            int i = 0;

            if (customCharacterNames == null)
            {
                foreach (var character in MyDefinitionManager.Static.Characters)
                {
                    // NPCs can't be played with while in survival mode
                    if (MySession.Static.SurvivalMode && !character.UsableByPlayer)
                    {
                        continue;
                    }
                    if (!character.Public)
                    {
                        continue;
                    }

                    var key = GetDisplayName(character.Name);
                    m_displayModels[key] = i;
                    m_models[i++]        = character.Name;
                }
            }
            else
            {
                var definedCharacters = MyDefinitionManager.Static.Characters;

                foreach (var characterName in customCharacterNames)
                {
                    MyCharacterDefinition definition;
                    // NPCs can't be played with while in survival mode
                    if (!definedCharacters.TryGetValue(characterName, out definition) || MySession.Static.SurvivalMode && !definition.UsableByPlayer)
                    {
                        continue;
                    }
                    if (!definition.Public)
                    {
                        continue;
                    }

                    var key = GetDisplayName(definition.Name);
                    m_displayModels[key] = i;
                    m_models[i++]        = definition.Name;
                }
            }

            RecreateControls(true);

            m_sliderHue.Value        = m_selectedHSV.X * 360f;
            m_sliderSaturation.Value = m_selectedHSV.Y * 100f;
            m_sliderValue.Value      = m_selectedHSV.Z * 100f;

            m_sliderHue.ValueChanged        += OnValueChange;
            m_sliderSaturation.ValueChanged += OnValueChange;
            m_sliderValue.ValueChanged      += OnValueChange;

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

        m_elemtents = new MyGuiControlElementGroup();
        m_elemtents.HighlightChanged += OnHighlightChange;
        if (!m_pauseGame)
        {
            if (MyGuiScreenGamePlay.Static == null)
            {
                MyGuiControlButton button = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonContinueGame))
                        {
                            button = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button != null)
                {
                    int index = Controls.IndexOf(button);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonContinueGame, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button.Tooltips);
                }
                MyGuiControlButton button2 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonCampaign))
                        {
                            button2 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button2 != null)
                {
                    int index = Controls.IndexOf(button2);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button2.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button2.Tooltips);
                }
                MyGuiControlButton button3 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonLoadGame))
                        {
                            button3 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button3 != null)
                {
                    int index = Controls.IndexOf(button3);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button3.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button3.Tooltips);
                }
                MyGuiControlButton button4 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonJoinGame))
                        {
                            button4 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button4 != null)
                {
                    int index = Controls.IndexOf(button4);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button4.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button4.Tooltips);
                }
                MyGuiControlButton button5 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonOptions))
                        {
                            button5 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button5 != null)
                {
                    int index = Controls.IndexOf(button5);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button5.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button5.Tooltips);
                }
                MyGuiControlButton button6 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonInventory))
                        {
                            button6 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button6 != null)
                {
                    int index = Controls.IndexOf(button6);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button6.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button6.Tooltips);
                }
                MyGuiControlButton button7 = null;
                foreach (var c in Controls)
                {
                    if (c is MyGuiControlButton)
                    {
                        m_elemtents.Add(c);
                        if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonExitToWindows))
                        {
                            button7 = (MyGuiControlButton)c;
                        }
                    }
                }
                if (button7 != null)
                {
                    int index = Controls.IndexOf(button7);
                    MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                    Controls.Add(newGameButton);
                    m_elemtents.Add(newGameButton);
                    newGameButton.Name = button7.Name;
                    Controls[index]    = newGameButton;
                    newGameButton.SetToolTip(button7.Tooltips);
                }
            }
        }



        if (m_pauseGame)
        {
            MyGuiControlButton button8 = null;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    m_elemtents.Add(c);
                    if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonSave))
                    {
                        button8 = (MyGuiControlButton)c;
                    }
                }
            }
            if (button8 != null)
            {
                int index = Controls.IndexOf(button8);
                MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonContinueGame, NullButtonAction);
                Controls.Add(newGameButton);
                m_elemtents.Add(newGameButton);
                newGameButton.Name = button8.Name;
                Controls[index]    = newGameButton;
                newGameButton.SetToolTip(button8.Tooltips);
            }
            MyGuiControlButton button9 = null;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    m_elemtents.Add(c);
                    if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.LoadScreenButtonSaveAs))
                    {
                        button9 = (MyGuiControlButton)c;
                    }
                }
            }
            if (button9 != null)
            {
                int index = Controls.IndexOf(button9);
                MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                Controls.Add(newGameButton);
                m_elemtents.Add(newGameButton);
                newGameButton.Name = button9.Name;
                Controls[index]    = newGameButton;
                newGameButton.SetToolTip(button9.Tooltips);
            }
            MyGuiControlButton button10 = null;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    m_elemtents.Add(c);
                    if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonPlayers))
                    {
                        button10 = (MyGuiControlButton)c;
                    }
                }
            }
            if (button10 != null)
            {
                int index = Controls.IndexOf(button10);
                MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                Controls.Add(newGameButton);
                m_elemtents.Add(newGameButton);
                newGameButton.Name = button10.Name;
                Controls[index]    = newGameButton;
                newGameButton.SetToolTip(button10.Tooltips);
            }
            MyGuiControlButton button11 = null;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    m_elemtents.Add(c);
                    if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonOptions))
                    {
                        button11 = (MyGuiControlButton)c;
                    }
                }
            }
            if (button11 != null)
            {
                int index = Controls.IndexOf(button11);
                MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                Controls.Add(newGameButton);
                m_elemtents.Add(newGameButton);
                newGameButton.Name = button11.Name;
                Controls[index]    = newGameButton;
                newGameButton.SetToolTip(button11.Tooltips);
            }
            MyGuiControlButton button12 = null;
            foreach (var c in Controls)
            {
                if (c is MyGuiControlButton)
                {
                    m_elemtents.Add(c);
                    if (((MyGuiControlButton)c).Text == MyTexts.GetString(MyCommonTexts.ScreenMenuButtonExitToMainMenu))
                    {
                        button12 = (MyGuiControlButton)c;
                    }
                }
            }
            if (button12 != null)
            {
                int index = Controls.IndexOf(button12);
                MyGuiControlButton newGameButton = MakeButton(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, -1000, -1000), MyCommonTexts.ScreenMenuButtonCampaign, NullButtonAction);
                Controls.Add(newGameButton);
                m_elemtents.Add(newGameButton);
                newGameButton.Name = button12.Name;
                Controls[index]    = newGameButton;
                newGameButton.SetToolTip(button12.Tooltips);
            }
        }
        m_elementGroup = new MyGuiControlElementGroup();
        Vector2 minSizeGui = MyGuiControlButton.GetVisualStyle(MyGuiControlButtonStyleEnum.Default).NormalTexture.MinSizeGui;
        Vector2 leftButtonPositionOrigin = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_BOTTOM) + new Vector2(minSizeGui.X / 2f, 0f) + new Vector2(15f, 0f) / MyGuiConstants.GUI_OPTIMAL_SIZE;

        leftButtonPositionOrigin.Y += 0.043f;
        _ = MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_BOTTOM) + new Vector2((0f - minSizeGui.X) / 2f, 0f);
        Vector2 lastButtonPosition = Vector2.Zero;

        if (MyGuiScreenGamePlay.Static == null)
        {
            CreateMainMenu();
        }
        else
        {
            CreateInGameMenu();
        }
        //Draws the controllor hints under the buttons.
        MyGuiControlLabel myGuiControlLabel = new MyGuiControlLabel(MyGuiManager.ComputeFullscreenGuiCoordinate(MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP, 49, 82));

        myGuiControlLabel.Name = MyGuiScreenBase.GAMEPAD_HELP_LABEL_NAME;
        Controls.Add(myGuiControlLabel);
        //Refreshes the badges under the game logo.
        m_myBadgeHelper.RefreshGameLogo();
        CheckLowMemSwitchToLow();
        if (MyGuiScreenGamePlay.Static == null && !MyPlatformGameSettings.FEEDBACK_ON_EXIT && !string.IsNullOrEmpty(MyPlatformGameSettings.FEEDBACK_URL))
        {
            MyGuiSandbox.OpenUrl(MyPlatformGameSettings.FEEDBACK_URL, UrlOpenMode.ExternalWithConfirm, MyTexts.Get(MyCommonTexts.MessageBoxTextBetaFeedback), MyTexts.Get(MyCommonTexts.MessageBoxCaptionBetaFeedback));
        }
    }