mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:42:58 +08:00
Merge branch 'master' into gameplay-test/share-clock-state
This commit is contained in:
commit
fdbb59fd1d
@ -31,12 +31,18 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddUntilStep("wait for fail", () => Player.HasFailed);
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
||||||
AddUntilStep("wait for fail overlay", () => ((FailPlayer)Player).FailOverlay.State.Value == Visibility.Visible);
|
AddUntilStep("wait for fail overlay", () => ((FailPlayer)Player).FailOverlay.State.Value == Visibility.Visible);
|
||||||
|
|
||||||
|
// The pause screen and fail animation both ramp frequency.
|
||||||
|
// This tests to ensure that it doesn't reset during that handoff.
|
||||||
|
AddAssert("frequency only ever decreased", () => !((FailPlayer)Player).FrequencyIncreased);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class FailPlayer : TestPlayer
|
private class FailPlayer : TestPlayer
|
||||||
{
|
{
|
||||||
public new FailOverlay FailOverlay => base.FailOverlay;
|
public new FailOverlay FailOverlay => base.FailOverlay;
|
||||||
|
|
||||||
|
public bool FrequencyIncreased { get; private set; }
|
||||||
|
|
||||||
public FailPlayer()
|
public FailPlayer()
|
||||||
: base(false, false)
|
: base(false, false)
|
||||||
{
|
{
|
||||||
@ -47,6 +53,19 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
HealthProcessor.FailConditions += (_, __) => true;
|
HealthProcessor.FailConditions += (_, __) => true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double lastFrequency = double.MaxValue;
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
double freq = Beatmap.Value.Track.AggregateFrequency.Value;
|
||||||
|
|
||||||
|
FrequencyIncreased |= freq > lastFrequency;
|
||||||
|
|
||||||
|
lastFrequency = freq;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
this.TransformBindableTo(trackFreq, 0, duration).OnComplete(_ =>
|
this.TransformBindableTo(trackFreq, 0, duration).OnComplete(_ =>
|
||||||
{
|
{
|
||||||
RemoveFilters();
|
// Don't reset frequency as the pause screen may appear post transform, causing a second frequency sweep.
|
||||||
|
RemoveFilters(false);
|
||||||
OnComplete?.Invoke();
|
OnComplete?.Invoke();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -137,15 +138,16 @@ namespace osu.Game.Screens.Play
|
|||||||
Content.FadeColour(Color4.Gray, duration);
|
Content.FadeColour(Color4.Gray, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveFilters()
|
public void RemoveFilters(bool resetTrackFrequency = true)
|
||||||
{
|
{
|
||||||
|
if (resetTrackFrequency)
|
||||||
|
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
||||||
|
|
||||||
if (filters.Parent == null)
|
if (filters.Parent == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RemoveInternal(filters);
|
RemoveInternal(filters);
|
||||||
filters.Dispose();
|
filters.Dispose();
|
||||||
|
|
||||||
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user