/// <summary> /// Ctor - /// </summary> /// <param name="map"></param> /// <param name="md5"></param> /// <param name="scores"></param> /// <param name="replay"></param> public GameplayScreen(Qua map, string md5, List<Score> scores, Replay replay = null) { TimePlayed = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); Map = map; LocalScores = scores; MapHash = md5; LoadedReplay = replay; Timing = new GameplayAudioTiming(this); // Remove paused modifier if enabled. if (ModManager.IsActivated(ModIdentifier.Paused)) ModManager.RemoveMod(ModIdentifier.Paused); // Handle autoplay replays. if (ModManager.IsActivated(ModIdentifier.Autoplay)) LoadedReplay = ReplayHelper.GeneratePerfectReplay(map, MapHash); // Determine if we're in replay mode. if (LoadedReplay != null) { InReplayMode = true; AddModsFromReplay(); } // Create the current replay that will be captured. ReplayCapturer = new ReplayCapturer(this); SetRuleset(); SetRichPresence(); AudioTrack.AllowPlayback = true; View = new GameplayScreenView(this); }
/// <summary> /// Ctor - /// </summary> /// <param name="map"></param> /// <param name="md5"></param> /// <param name="scores"></param> /// <param name="replay"></param> /// <param name="isPlayTesting"></param> /// <param name="playTestTime"></param> /// <param name="isCalibratingOffset"></param> public GameplayScreen(Qua map, string md5, List <Score> scores, Replay replay = null, bool isPlayTesting = false, double playTestTime = 0, bool isCalibratingOffset = false) { TimePlayed = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); if (isPlayTesting) { var testingQua = ObjectHelper.DeepClone(map); testingQua.HitObjects.RemoveAll(x => x.StartTime < playTestTime); Map = testingQua; OriginalEditorMap = map; } else { Map = map; } LocalScores = scores; MapHash = md5; LoadedReplay = replay; IsPlayTesting = isPlayTesting; PlayTestAudioTime = playTestTime; IsCalibratingOffset = isCalibratingOffset; Timing = new GameplayAudioTiming(this); // Remove paused modifier if enabled. if (ModManager.IsActivated(ModIdentifier.Paused)) { ModManager.RemoveMod(ModIdentifier.Paused); } // Handle autoplay replays. if (ModManager.IsActivated(ModIdentifier.Autoplay)) { LoadedReplay = ReplayHelper.GeneratePerfectReplay(map, MapHash); } // Determine if we're in replay mode. if (LoadedReplay != null) { InReplayMode = true; } // Create the current replay that will be captured. ReplayCapturer = new ReplayCapturer(this); SetRuleset(); SetRichPresence(); AudioTrack.AllowPlayback = true; if (IsCalibratingOffset) { Metronome = new Metronome(map); } View = new GameplayScreenView(this); }
/// <summary> /// Ctor - /// </summary> /// <param name="map"></param> /// <param name="md5"></param> /// <param name="scores"></param> /// <param name="replay"></param> /// <param name="isPlayTesting"></param> /// <param name="playTestTime"></param> /// <param name="isCalibratingOffset"></param> /// <param name="spectatorClient"></param> public GameplayScreen(Qua map, string md5, List <Score> scores, Replay replay = null, bool isPlayTesting = false, double playTestTime = 0, bool isCalibratingOffset = false, SpectatorClient spectatorClient = null) { TimePlayed = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); if (isPlayTesting) { var testingQua = ObjectHelper.DeepClone(map); testingQua.HitObjects.RemoveAll(x => x.StartTime < playTestTime); Qua.RestoreDefaultValues(testingQua); Map = testingQua; OriginalEditorMap = map; } else { Map = map; } LocalScores = scores; MapHash = md5; LoadedReplay = replay; IsPlayTesting = isPlayTesting; PlayTestAudioTime = playTestTime; IsCalibratingOffset = isCalibratingOffset; IsMultiplayerGame = OnlineManager.CurrentGame != null; SpectatorClient = spectatorClient; if (SpectatorClient != null) { LoadedReplay = SpectatorClient.Replay; } if (IsMultiplayerGame) { OnlineManager.Client.OnUserJoinedGame += OnUserJoinedGame; OnlineManager.Client.OnUserLeftGame += OnUserLeftGame; OnlineManager.Client.OnAllPlayersLoaded += OnAllPlayersLoaded; OnlineManager.Client.OnAllPlayersSkipped += OnAllPlayersSkipped; } Timing = new GameplayAudioTiming(this); // Initialize the custom audio sample cache and the sound effect index. if (!IsCalibratingOffset) { CustomAudioSampleCache.LoadSamples(MapManager.Selected.Value, MapHash); } NextSoundEffectIndex = 0; UpdateNextSoundEffectIndex(); // Remove paused modifier if enabled. if (ModManager.IsActivated(ModIdentifier.Paused)) { ModManager.RemoveMod(ModIdentifier.Paused); } // Handle autoplay replays. if (ModManager.IsActivated(ModIdentifier.Autoplay)) { LoadedReplay = ReplayHelper.GeneratePerfectReplay(map, MapHash); } // Determine if we're in replay mode. if (LoadedReplay != null) { InReplayMode = true; } // Create the current replay that will be captured. ReplayCapturer = new ReplayCapturer(this); SetRuleset(); SetRichPresence(); AudioTrack.AllowPlayback = true; if (IsCalibratingOffset) { Metronome = new Metronome(map); } View = new GameplayScreenView(this); }