private void OnUpdateNotifiactionMessageClose(MyGuiScreenMessageBox.ResultEnum r)
 {
     if (r == MyGuiScreenMessageBox.ResultEnum.YES)
     {
         MyGuiSandbox.OpenUrl(VersionCheck.Static.GetLatestVersionPage(), UrlOpenMode.SteamOrExternalWithConfirm);
     }
 }
Beispiel #2
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 #3
0
 void OnClickRecommendOK(MyGuiScreenMessageBox.ResultEnum result)
 {
     MyGuiSandbox.OpenUrl(MySteamConstants.URL_RECOMMEND_GAME, UrlOpenMode.SteamOrExternal);
 }
Beispiel #4
0
 private void OnClickGameWeb(MyGuiControlButton sender)
 {
     MyGuiSandbox.OpenUrl(MyPerGameSettings.GameWebUrl, UrlOpenMode.SteamOrExternalWithConfirm);
 }
Beispiel #5
0
 private void OnClickReportBug(MyGuiControlButton obj)
 {
     MyGuiSandbox.OpenUrl(MyPerGameSettings.BugReportUrl, UrlOpenMode.SteamOrExternalWithConfirm, MyTexts.AppendFormat(new StringBuilder(), MyCommonTexts.MessageBoxTextOpenBrowser, "forums.keenswh.com"));
 }
Beispiel #6
0
 public override void Show()
 {
     MyGuiSandbox.OpenUrl("https://github.com/" + Id, UrlOpenMode.SteamOrExternalWithConfirm);
 }
 public override void Show()
 {
     MyGuiSandbox.OpenUrl("https://steamcommunity.com/workshop/filedetails/?id=" + Id, UrlOpenMode.SteamOrExternalWithConfirm);
 }
    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));
        }
    }