1
0
mirror of https://github.com/ppy/osu synced 2025-04-01 22:48:33 +00:00

Properly bind WaitingOnFrames

This commit is contained in:
smoogipoo 2021-04-15 19:37:45 +09:00
parent 33cc5c5cb3
commit b391a8f94e

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Timing; using osu.Framework.Timing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -12,14 +13,20 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{ {
public class MultiplayerSpectatorPlayer : SpectatorPlayer public class MultiplayerSpectatorPlayer : SpectatorPlayer
{ {
private readonly SpectatorCatchUpSlaveClock gameplayClock; private readonly ISpectatorSlaveClock gameplayClock;
public MultiplayerSpectatorPlayer(Score score, SpectatorCatchUpSlaveClock gameplayClock) public MultiplayerSpectatorPlayer(Score score, ISpectatorSlaveClock gameplayClock)
: base(score) : base(score)
{ {
this.gameplayClock = gameplayClock; this.gameplayClock = gameplayClock;
} }
[BackgroundDependencyLoader]
private void load()
{
gameplayClock.WaitingOnFrames.BindTo(DrawableRuleset.FrameStableClock.WaitingOnFrames);
}
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart) protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
=> new SubGameplayClockContainer(gameplayClock); => new SubGameplayClockContainer(gameplayClock);
} }