private void PlayEmulator() { var gi = gamesList.SelectedItem as GameInfo; if (gi == null) return; // this.IsEnabled = false; main.Content = null; fullscreenCanvas.Children.Add(_ev); _isInGameMode = true; String fileName = Guid.NewGuid().ToString() + ".wr"; var settingsManager = _serviceLocator.GetInstance<ISettingsManager>(); var replayManager = _serviceLocator.GetInstance<IReplayManager>(); // replayManager.AddReplay(new RecordedReplay(gi.Game.Id, fileName, DateTime.Now)); ReplaySettings rs = new ReplaySettings() { IsRecording = false, IsPlayingBack = false, FileName = fileName }; InputSettings ins = new InputSettings() { IsUserInputEnabled = true }; settingsManager.ApplySettings(rs, true); settingsManager.ApplySettings(ins, true); RunEmulator(); }
private void PreviewEmulator() { var settingsManager = _serviceLocator.GetInstance<ISettingsManager>(); var replayManager = _serviceLocator.GetInstance<IReplayManager>(); GameInfo gi = gamesList.SelectedItem as GameInfo; if (gi == null) return; var replay = replayManager.GetGameReplays(gi.Game).FirstOrDefault(); ReplaySettings rs = new ReplaySettings(); rs.IsRecording = false; if (replay == null) { rs.IsPlayingBack = false; } else { rs.IsPlayingBack = true; rs.FileName = replay.FileName; } InputSettings ins = new InputSettings() { IsUserInputEnabled = false }; settingsManager.ApplySettings(rs, true); settingsManager.ApplySettings(ins, true); RunEmulator(); }