mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 13:12:54 +08:00
Ensure FailAnimation
can't be Start
ed after filters are already removed
This commit is contained in:
parent
136dcee3b5
commit
4c45f7d938
@ -105,6 +105,7 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool started;
|
private bool started;
|
||||||
|
private bool filtersRemoved;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start the fail animation playing.
|
/// Start the fail animation playing.
|
||||||
@ -113,6 +114,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
if (started) throw new InvalidOperationException("Animation cannot be started more than once.");
|
if (started) throw new InvalidOperationException("Animation cannot be started more than once.");
|
||||||
|
if (filtersRemoved) throw new InvalidOperationException("Animation cannot be started after filters have been removed.");
|
||||||
|
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
@ -155,6 +157,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
public void RemoveFilters(bool resetTrackFrequency = true)
|
public void RemoveFilters(bool resetTrackFrequency = true)
|
||||||
{
|
{
|
||||||
|
if (filtersRemoved)
|
||||||
|
return;
|
||||||
|
|
||||||
|
filtersRemoved = true;
|
||||||
|
|
||||||
if (resetTrackFrequency)
|
if (resetTrackFrequency)
|
||||||
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user