protected override void Update(GameTime gameTime) { //First tick initialization if (firstFrame == false) { firstFrame = true; FirstUpdate(); } Time.GameTime = gameTime; InputManager.Update(); base.Update(gameTime); if (quitOnEscape) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } } else { //Handle pausing if (InputManager.Released("misc.pause")) { TogglePause(); } } #if !CONSOLE && CLIENT //Screenshots if (InputManager.Released("misc.screenshot")) { CaptureScreenshot(); } #if DEBUG //Disable block rendering if (InputManager.IsPressed("debug.hotkey") && InputManager.Released("debug.renderchunks")) { GameSettings.RenderChunkBorders = !GameSettings.RenderChunkBorders; } //Show physics colliders if (InputManager.IsPressed("debug.hotkey") && InputManager.Released("debug.physicscolliders")) { GameSettings.Debug.RenderPhysicsTestLocations = !GameSettings.Debug.RenderPhysicsTestLocations; } //Show entity colliders if (InputManager.IsPressed("debug.hotkey") && InputManager.Released("debug.entitycolliders")) { GameSettings.DrawHitboxes = !GameSettings.DrawHitboxes; } //Respawn if (InputManager.IsPressed("debug.hotkey") && InputManager.Released("debug.respawn")) { if (IsGameWorldloaded) { theWorld.player.position = new Vector3(theWorld.spawnX, theWorld.spawnY, theWorld.spawnZ); theWorld.player.Velocity = Vector3.Zero; } } //Noclip if (InputManager.IsPressed("debug.hotkey") && InputManager.Released("debug.noclip")) { if (IsGameWorldloaded) { theWorld.player.noClip = !theWorld.player.noClip; } } #endif DiscordManager.OnUpdate(); #endif //Time logging Snooper.Snoop("time.totalplayed", gameTime.ElapsedGameTime.TotalSeconds); TimeSinceBoot += gameTime.ElapsedGameTime.TotalSeconds; Profiler.Start("UI Update", Color.LightCyan); foreach (GuiScreen ui in GUIs) { ui.Update(); } Profiler.Stop("UI Update"); IsMouseVisible = isPaused || IsGameWorldloaded == false; FinalUpdate(); }