示例#1
0
        public static void Update(GameTime gameTime)
        {
            GameTime = gameTime;

            KeyBoardHandler.Update();
            ControllerHandler.Update();

            BaseConnectScreen.UpdateConnectSet();

            if (!GameInstance.IsActive)
            {
                if (CurrentScreen.CanBePaused)
                {
                    Core.SetScreen(Screen.CreatePauseScreen(CurrentScreen));
                }
            }
            else
            {
                if (KeyBoardHandler.KeyPressed(KeyBindings.Escape) || ControllerHandler.ButtonDown(Buttons.Start))
                {
                    CurrentScreen.EscapePressed();
                }
            }

            CurrentScreen?.Update(gameTime);
            if (CurrentScreen.CanChat)
            {
                if (KeyBoardHandler.KeyPressed(KeyBindings.Chat) || ControllerHandler.ButtonPressed(Buttons.RightShoulder))
                {
                    if (BaseJoinServerScreen.Online || Player.SandBoxMode || GameController.IS_DEBUG_ACTIVE)
                    {
                        SetScreen(Screen.CreateChatScreen((CurrentScreen)));
                    }
                }
            }

            MainGameFunctions.FunctionKeys();
            MusicManager.Update(gameTime);

            GameMessage.Update();
            Controls.MakeMouseVisible();

            MouseHandler.Update();

            LoadingDots.Update();
            ForcedCrash.Update();

            ServersManager.Update();
        }