private IEnumerator StallFreeBack()
    {
        float dur = 0.1f;

        if (MenuSystem.instance.activeMenu == this)
        {
            MenuSystem.instance.FocusOnMouseOver(enable: false);
            Transition(0.9999f, 0f);
        }
        MenuCameraEffects.FadeToBlack(dur);
        yield return(null);

        yield return(new WaitForSeconds(dur));

        yield return(null);

        App.instance.LeaveCustomization();
        while (!Game.instance.HasSceneLoaded)
        {
            yield return(null);
        }
        for (int index = 0; index < 3; index++)
        {
            yield return(null);
        }
        goingBack = false;
        MenuSystem.instance.TransitionBack <MainMenu>(this, 0f);
    }
Exemple #2
0
 public void LobbyLoadLevel(ulong level)
 {
     MenuCameraEffects.FadeToBlack(0.02f);
     Dialogs.ShowLoadLevelProgress(57005uL);
     Listener.instance.EndTransfromOverride();
     SceneManager.LoadScene("Empty");
     EnterLobby(NetGame.isServer);
     if (NetGame.isServer)
     {
         NetGame.instance.ServerLoadLobby(level, WorkshopItemSource.BuiltInLobbies, start: false, 0u);
     }
 }
Exemple #3
0
    private IEnumerator TransitionToCustomisation()
    {
        RemoveStartExperienceLogo();
        if (MenuSystem.instance.activeMenu == this)
        {
            MenuSystem.instance.FocusOnMouseOver(enable: false);
            Transition(-0.99f, 0.3f);
        }
        float dur = 0.5f;

        MenuCameraEffects.FadeToBlack(dur);
        yield return(null);

        yield return(new WaitForSeconds(dur));

        yield return(null);

        transitioning = false;
        MenuSystem.instance.TransitionForward <CustomizationRootMenu>(this, 0f, 10000f);
    }
Exemple #4
0
 public override void ApplyMenuEffects()
 {
     MenuCameraEffects.FadeToBlack(0.001f);
 }
Exemple #5
0
        private IEnumerator LaunchGame(string levelPath, ulong level, WorkshopItemSource type, int checkpoint, int subObjectives, Action onComplete)
        {
            object obj = stateLock;

            Monitor.Enter(obj);
            try
            {
                if (state == AppSate.Menu || state == AppSate.PlayLevel || state == AppSate.ClientJoin || state == AppSate.ClientLobby || state == AppSate.ClientPlayLevel || state == AppSate.ClientWaitServerLoad || state == AppSate.ServerLobby || state != AppSate.ServerPlayLevel)
                {
                }
                bool ui = state == AppSate.Menu || state == AppSate.ServerLobby || state == AppSate.ClientLobby || state == AppSate.ClientJoin;
                if (ui)
                {
                    MenuSystem.instance.FadeOutActive();
                }
                if (isServer || isClient)
                {
                    MenuCameraEffects.FadeToBlack((!ui) ? 0.02f : 0.2f);
                    Dialogs.ShowLoadLevelProgress(level);
                }
                if (isServer)
                {
                    state = AppSate.ServerLoadLevel;
                }
                else if (isClient)
                {
                    state = AppSate.ClientLoadLevel;
                }
                else
                {
                    state = AppSate.LoadLevel;
                }
                queueAfterLevelLoad = null;
                if (ui)
                {
                    yield return(new WaitForSeconds(0.2f));
                }
                NetStream.DiscardPools();
                Game.instance.BeginLoadLevel(levelPath, level, checkpoint, subObjectives, delegate
                {
                    lock (stateLock)
                    {
                        if (state == AppSate.LoadLevel || state == AppSate.ServerLoadLevel || state != AppSate.ClientLoadLevel)
                        {
                        }
                        MenuSystem.instance.ExitMenus();
                        NetStream.DiscardPools();
                        ResumeDeltasAfterLoad();
                        if (onComplete != null)
                        {
                            onComplete();
                        }
                        if (queueAfterLevelLoad != null)
                        {
                            Action action       = queueAfterLevelLoad;
                            queueAfterLevelLoad = null;
                            if (NetGame.netlog)
                            {
                                UnityEngine.Debug.Log("Executing queue");
                            }
                            action();
                        }
                    }
                }, type);
            }
            finally
            {
            }
        }
Exemple #6
0
 public void OnRequestLoadLevel(ulong level, WorkshopItemSource levelType, bool start, uint hash)
 {
     if (start && loadingLevel != level)
     {
         RatingMenu.instance.LoadInit();
     }
     if (NetGame.netlog)
     {
         UnityEngine.Debug.LogFormat("On RequestLoad {0} {1} {2} {3}", level, levelType, start, hash);
     }
     lock (stateLock)
     {
         if (state == AppSate.ClientLoadLevel || state == AppSate.ClientLoadLobby)
         {
             if (NetGame.netlog)
             {
                 UnityEngine.Debug.Log("Queueing on request load");
             }
             queueAfterLevelLoad = delegate
             {
                 OnRequestLoadLevel(level, levelType, start, hash);
             };
         }
         else
         {
             queueAfterLevelLoad = null;
             if (hash == 0)
             {
                 serverLoadedLevel = 57005uL;
             }
             if (!start)
             {
                 loadingLevel        = (loadedLevel = 57005uL);
                 loadedHash          = 0u;
                 queueAfterLevelLoad = null;
                 if (state == AppSate.ClientLobby)
                 {
                     MultiplayerLobbyMenu multiplayerLobbyMenu = MenuSystem.instance.activeMenu as MultiplayerLobbyMenu;
                     if (multiplayerLobbyMenu != null)
                     {
                         multiplayerLobbyMenu.RebindLevel();
                     }
                     state = AppSate.ClientLobby;
                 }
                 else if (isClient)
                 {
                     RatingMenu.instance.LevelOver();
                     if (Game.instance.state == GameState.Paused || Game.instance.state == GameState.PlayingLevel)
                     {
                         ExitGame();
                     }
                     if (RatingMenu.instance.ShowRatingMenu())
                     {
                         GotoRatingsMenu(RatingMenu.RatingDestination.kMultiplayerLobby, showLoading: true);
                     }
                     else
                     {
                         MenuCameraEffects.FadeToBlack(0.02f);
                         Dialogs.ShowLoadLevelProgress(57005uL);
                     }
                     EnterLobby(isServer: false, delegate
                     {
                         state = AppSate.ClientLobby;
                     });
                 }
             }
             else
             {
                 if (loadingLevel != level)
                 {
                     if (state == AppSate.ClientLobby)
                     {
                         ExitLobby();
                     }
                     loadingLevel = level;
                     LaunchGame(level, levelType, 0, 0, delegate
                     {
                         loadedLevel = level;
                         loadedHash  = Game.currentLevel.netHash;
                         if (!LevelLoadedClient())
                         {
                             state = AppSate.ClientWaitServerLoad;
                         }
                     });
                 }
                 if (hash != 0)
                 {
                     serverLoadedLevel = level;
                     serverLoadedHash  = hash;
                     LevelLoadedClient();
                 }
             }
         }
     }
 }
Exemple #7
0
 public void PauseLeave(bool instantLeave = false)
 {
     lock (stateLock)
     {
         RatingMenu.instance.LevelOver();
         bool flag  = RatingMenu.instance.ShowRatingMenu();
         bool flag2 = Game.instance.workshopLevel != null;
         ExitGame();
         if (state == AppSate.PlayLevel)
         {
             EnterMenu();
             PlayerManager.SetSingle();
             if (flag2)
             {
                 MenuCameraEffects.instance.RemoveOverride();
                 LevelSelectMenu2.instance.SetMultiplayerMode(inMultiplayer: false);
                 LevelSelectMenu2.instance.ShowSubscribed();
                 if (flag)
                 {
                     GotoRatingsMenu(RatingMenu.RatingDestination.kLevelSelectMenu, showLoading: false);
                 }
                 else
                 {
                     MenuSystem.instance.ShowMainMenu <LevelSelectMenu2>();
                 }
             }
             else
             {
                 MenuSystem.instance.ShowMainMenu();
             }
         }
         else if (state == AppSate.ServerPlayLevel)
         {
             if (!instantLeave)
             {
                 if (flag)
                 {
                     GotoRatingsMenu(RatingMenu.RatingDestination.kMultiplayerLobby, showLoading: true);
                 }
                 else
                 {
                     MenuCameraEffects.FadeToBlack(0.02f);
                     Dialogs.ShowLoadLevelProgress(57005uL);
                 }
                 EnterLobby(isServer: true);
                 NetGame.instance.ServerLoadLevel(NetGame.instance.currentLevel, NetGame.instance.currentLevelType, start: false, 0u);
             }
             else
             {
                 EnterMenu();
                 MenuSystem.instance.ShowMainMenu();
                 NetGame.instance.LeaveGame();
             }
         }
         else if (state == AppSate.ClientPlayLevel)
         {
             NetGame.instance.LeaveGame();
             EnterMenu();
             if (flag)
             {
                 GotoRatingsMenu(RatingMenu.RatingDestination.kMainMenu, showLoading: false);
             }
             else
             {
                 MenuSystem.instance.ShowMainMenu();
             }
         }
     }
 }