From cf2212e79464aa30c0ea721d00bf71f955fbc1a6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 19 Mar 2022 17:20:54 +0900 Subject: [PATCH] Revert "Fix spectator not starting from correct seek point (hotfix)" This reverts commit 2b59eff465ef38c6e2e8c6edf1f8bb368f7eb8a9. --- .../Play/MasterGameplayClockContainer.cs | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs index 410f257a44..af58e9d910 100644 --- a/osu.Game/Screens/Play/MasterGameplayClockContainer.cs +++ b/osu.Game/Screens/Play/MasterGameplayClockContainer.cs @@ -78,12 +78,17 @@ namespace osu.Game.Screens.Play firstHitObjectTime = beatmap.Beatmap.HitObjects.First().StartTime; } - [BackgroundDependencyLoader] - private void load() + protected override void LoadComplete() { - // TODO: This code should not be in the BDL load method, but is to avoid seeks being overwritten. - // See https://github.com/ppy/osu/issues/17267 for the issue. - // See https://github.com/ppy/osu/pull/17302 for a better fix which needs some more time. + base.LoadComplete(); + + userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); + userAudioOffset.BindValueChanged(offset => userGlobalOffsetClock.Offset = offset.NewValue, true); + + beatmapOffsetSubscription = realm.SubscribeToPropertyChanged( + r => r.Find(beatmap.BeatmapInfo.ID)?.UserSettings, + settings => settings.Offset, + val => userBeatmapOffsetClock.Offset = val); // sane default provided by ruleset. startOffset = gameplayStartTime; @@ -107,19 +112,6 @@ namespace osu.Game.Screens.Play Seek(startOffset); } - protected override void LoadComplete() - { - base.LoadComplete(); - - userAudioOffset = config.GetBindable(OsuSetting.AudioOffset); - userAudioOffset.BindValueChanged(offset => userGlobalOffsetClock.Offset = offset.NewValue, true); - - beatmapOffsetSubscription = realm.SubscribeToPropertyChanged( - r => r.Find(beatmap.BeatmapInfo.ID)?.UserSettings, - settings => settings.Offset, - val => userBeatmapOffsetClock.Offset = val); - } - protected override void OnIsPausedChanged(ValueChangedEvent isPaused) { // The source is stopped by a frequency fade first.