mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix incorrect parent state transfer
This commit is contained in:
@ -59,13 +59,16 @@ namespace osu.Game.Rulesets.UI
|
|||||||
private int direction;
|
private int direction;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(GameplayClock clock)
|
private void load(GameplayClock clock, ISamplePlaybackDisabler sampleDisabler)
|
||||||
{
|
{
|
||||||
if (clock != null)
|
if (clock != null)
|
||||||
{
|
{
|
||||||
parentGameplayClock = stabilityGameplayClock.ParentGameplayClock = clock;
|
parentGameplayClock = stabilityGameplayClock.ParentGameplayClock = clock;
|
||||||
GameplayClock.IsPaused.BindTo(clock.IsPaused);
|
GameplayClock.IsPaused.BindTo(clock.IsPaused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is a bit temporary. should really be done inside of GameplayClock (but requires large structural changes).
|
||||||
|
stabilityGameplayClock.ParentSampleDisabler = sampleDisabler;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -225,6 +228,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
public GameplayClock ParentGameplayClock;
|
public GameplayClock ParentGameplayClock;
|
||||||
|
|
||||||
|
public ISamplePlaybackDisabler ParentSampleDisabler;
|
||||||
|
|
||||||
public override IEnumerable<Bindable<double>> NonGameplayAdjustments => ParentGameplayClock?.NonGameplayAdjustments ?? Enumerable.Empty<Bindable<double>>();
|
public override IEnumerable<Bindable<double>> NonGameplayAdjustments => ParentGameplayClock?.NonGameplayAdjustments ?? Enumerable.Empty<Bindable<double>>();
|
||||||
|
|
||||||
public StabilityGameplayClock(FramedClock underlyingClock)
|
public StabilityGameplayClock(FramedClock underlyingClock)
|
||||||
@ -234,7 +239,9 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
protected override bool ShouldDisableSamplePlayback =>
|
protected override bool ShouldDisableSamplePlayback =>
|
||||||
// handle the case where playback is catching up to real-time.
|
// handle the case where playback is catching up to real-time.
|
||||||
base.ShouldDisableSamplePlayback || (ParentGameplayClock != null && Math.Abs(CurrentTime - ParentGameplayClock.CurrentTime) > 200);
|
base.ShouldDisableSamplePlayback
|
||||||
|
|| ParentSampleDisabler?.SamplePlaybackDisabled.Value == true
|
||||||
|
|| (ParentGameplayClock != null && Math.Abs(CurrentTime - ParentGameplayClock.CurrentTime) > 200);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user