protected override void OnCoreGameStateChanged(WF.Player.Core.Engines.EngineGameState oldState, WF.Player.Core.Engines.EngineGameState newState) { // If the engine is stopping or pausing, enables screen lock again. if (newState == WF.Player.Core.Engines.EngineGameState.Stopping || newState == WF.Player.Core.Engines.EngineGameState.Pausing) { App.Current.ViewModel.IsScreenLockEnabled = false; } // Refreshes the blocking progress bar. RefreshProgressBar(newState); }
/// <summary> /// Refreshes the progress bar depending on the game state. /// </summary> /// <param name="engineGameState"></param> private void RefreshProgressBar(WF.Player.Core.Engines.EngineGameState gameState) { // Computes the message to display. string message = null; switch (gameState) { case WF.Player.Core.Engines.EngineGameState.Stopping: message = "Stopping cartridge..."; break; case WF.Player.Core.Engines.EngineGameState.Starting: message = "Starting game..."; break; case WF.Player.Core.Engines.EngineGameState.Restoring: message = "Restoring game..."; break; case WF.Player.Core.Engines.EngineGameState.Saving: message = "Saving cartridge..."; break; case WF.Player.Core.Engines.EngineGameState.Playing: // message = null; break; case WF.Player.Core.Engines.EngineGameState.Initializing: message = "Loading cartridge..."; break; default: message = ProgressBarStatusText ?? ""; break; } // If we need to display a progress message, do it. ProgressBarStatusText = message; IsProgressBarVisible = message != null; }