public void Deactivated() { PeriodicChecksTimer.Dispose(); CoreOperationsAllowed = false; PlatformService.HandleGameplayKeyShortcuts = false; PlatformService.ChangeMousePointerVisibility(MousePointerVisibility.Visible); }
private void CleanupAndGoBack() { StreamProvider?.Dispose(); StreamProvider = null; if (RootFrame.CurrentSourcePageType == GamePlayerPageType) { RootFrame.GoBack(); } PlatformService.ChangeMousePointerVisibility(MousePointerVisibility.Visible); }
public GamePlayerVM(IPlatformService platformService, IEmulationService emulationService, ISaveStateService saveStateService) { PlatformService = platformService; EmulationService = emulationService; SaveStateService = saveStateService; ShouldDisplayTouchGamepad = PlatformService.ShouldDisplayTouchGamepad; TappedCommand = new RelayCommand(() => { DisplayPlayerUI = !DisplayPlayerUI; }); PointerMovedCommand = new RelayCommand(() => { PlatformService.ChangeMousePointerVisibility(MousePointerVisibility.Visible); LastPointerMoveTime = DateTimeOffset.UtcNow; DisplayPlayerUI = true; }); ToggleFullScreenCommand = new RelayCommand(() => RequestFullScreenChange(FullScreenChangeType.Toggle)); TogglePauseCommand = new RelayCommand(() => { var task = TogglePause(false); }, () => CoreOperationsAllowed); ResetCommand = new RelayCommand(Reset, () => CoreOperationsAllowed); StopCommand = new RelayCommand(Stop, () => CoreOperationsAllowed); SaveStateSlot1 = new RelayCommand(() => SaveState(1), () => CoreOperationsAllowed); SaveStateSlot2 = new RelayCommand(() => SaveState(2), () => CoreOperationsAllowed); SaveStateSlot3 = new RelayCommand(() => SaveState(3), () => CoreOperationsAllowed); SaveStateSlot4 = new RelayCommand(() => SaveState(4), () => CoreOperationsAllowed); SaveStateSlot5 = new RelayCommand(() => SaveState(5), () => CoreOperationsAllowed); SaveStateSlot6 = new RelayCommand(() => SaveState(6), () => CoreOperationsAllowed); LoadStateSlot1 = new RelayCommand(() => LoadState(1), () => CoreOperationsAllowed); LoadStateSlot2 = new RelayCommand(() => LoadState(2), () => CoreOperationsAllowed); LoadStateSlot3 = new RelayCommand(() => LoadState(3), () => CoreOperationsAllowed); LoadStateSlot4 = new RelayCommand(() => LoadState(4), () => CoreOperationsAllowed); LoadStateSlot5 = new RelayCommand(() => LoadState(5), () => CoreOperationsAllowed); LoadStateSlot6 = new RelayCommand(() => LoadState(6), () => CoreOperationsAllowed); InjectInputCommand = new RelayCommand <InjectedInputTypes>(d => EmulationService.InjectInputPlayer1(d)); AllCoreCommands = new RelayCommand[] { TogglePauseCommand, ResetCommand, StopCommand, SaveStateSlot1, SaveStateSlot2, SaveStateSlot3, SaveStateSlot4, SaveStateSlot5, SaveStateSlot6, LoadStateSlot1, LoadStateSlot2, LoadStateSlot3, LoadStateSlot4, LoadStateSlot5, LoadStateSlot6 }; EmulationService.GameStarted += OnGameStarted; PlatformService.FullScreenChangeRequested += (d, e) => RequestFullScreenChange(e.Type); PlatformService.PauseToggleRequested += d => OnPauseToggleKey(); PlatformService.GameStateOperationRequested += OnGameStateOperationRequested; }