Пример #1
0
        /// <summary>
        ///     Changes to a different screen.
        ///     Adds extra functionality such as setting the current screen.
        /// </summary>
        /// <param name="screen"></param>
        public static void ChangeScreen(QuaverScreen screen)
        {
            Logger.Important($"Changed to Screen '{screen.Type}'", LogType.Runtime);

            var game = (QuaverGame)GameBase.Game;

            if (game.CurrentScreen != null)
            {
                LastScreen = game.CurrentScreen.Type;
            }

            game.CurrentScreen = screen;

            ScreenManager.ChangeScreen(screen);
            QueuedScreen = screen;

            // Update client status on the server.
            var status = screen.GetClientStatus();

            if (status != null)
            {
                OnlineManager.Client?.UpdateClientStatus(status);
            }

            OtherGameMapDatabaseCache.RunThread();
        }
Пример #2
0
        /// <summary>
        ///     Removes the top screen from the stack
        /// </summary>
        public static void RemoveTopScreen()
        {
            var game = (QuaverGame)GameBase.Game;

            if (game.CurrentScreen != null)
            {
                LastScreen = game.CurrentScreen.Type;
            }

            ScreenManager.RemoveScreen();

            var screen = (QuaverScreen)ScreenManager.Screens.Peek();

            game.CurrentScreen = screen;
            QueuedScreen       = screen;

            // Update client status on the server.
            var status = screen.GetClientStatus();

            if (status != null)
            {
                OnlineManager.Client?.UpdateClientStatus(status);
            }

            OtherGameMapDatabaseCache.RunThread();
        }