Example #1
0
 private static void AddCloseHandler(MyGuiScreenBase previousScreen, MyGuiScreenLogo logoScreen, Action afterLogosAction)
 {
     previousScreen.Closed += (screen) =>
     {
         if (!screen.Canceled)
             MyGuiManager.AddScreen(logoScreen);
         else
             afterLogosAction();
     };
 }
Example #2
0
        public static void BackToIntroLogos(Action afterLogosAction)
        {
            MyGuiManager.CloseAllScreensNowExcept(null);

            string[] logos = new string[]
            {
                "Textures\\Logo\\keen_swh",
                "Textures\\Logo\\miner_wars_2081",
                "Textures\\Logo\\vrage",
            };

            MyGuiScreenBase previousScreen = null;

            foreach (var logo in logos)
            {
                var logoScreen = new MyGuiScreenLogo(logo);
                if (previousScreen != null)
                    AddCloseHandler(previousScreen, logoScreen, afterLogosAction);
                else
                    MyGuiManager.AddScreen(logoScreen);

                previousScreen = logoScreen;
            }

            if (previousScreen != null)
                previousScreen.Closed += (screen) => afterLogosAction();
            else
                afterLogosAction();
        }