mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Silence hit sounds while seeking
This commit is contained in:
@ -29,14 +29,16 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
internal bool FrameStablePlayback = true;
|
||||
|
||||
[Cached]
|
||||
public GameplayClock GameplayClock { get; }
|
||||
public GameplayClock GameplayClock => stabilityGameplayClock;
|
||||
|
||||
[Cached(typeof(GameplayClock))]
|
||||
private readonly StabilityGameplayClock stabilityGameplayClock;
|
||||
|
||||
public FrameStabilityContainer(double gameplayStartTime = double.MinValue)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
GameplayClock = new GameplayClock(framedClock = new FramedClock(manualClock = new ManualClock()));
|
||||
stabilityGameplayClock = new StabilityGameplayClock(framedClock = new FramedClock(manualClock = new ManualClock()));
|
||||
|
||||
this.gameplayStartTime = gameplayStartTime;
|
||||
}
|
||||
@ -57,7 +59,7 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
if (clock != null)
|
||||
{
|
||||
parentGameplayClock = clock;
|
||||
stabilityGameplayClock.ParentGameplayClock = parentGameplayClock = clock;
|
||||
GameplayClock.IsPaused.BindTo(clock.IsPaused);
|
||||
}
|
||||
}
|
||||
@ -187,5 +189,17 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
public ReplayInputHandler ReplayInputHandler { get; set; }
|
||||
|
||||
private class StabilityGameplayClock : GameplayClock
|
||||
{
|
||||
public IFrameBasedClock ParentGameplayClock;
|
||||
|
||||
public StabilityGameplayClock(FramedClock underlyingClock)
|
||||
: base(underlyingClock)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool IsSeeking => ParentGameplayClock != null && Math.Abs(CurrentTime - ParentGameplayClock.CurrentTime) > 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user