1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 15:53:51 +08:00

Add tests for suppressing epilepsy warning when storyboard disabled

This commit is contained in:
Bartłomiej Dach 2023-04-05 20:56:50 +02:00
parent 02c6126be7
commit 6df7614b9d
No known key found for this signature in database
2 changed files with 19 additions and 1 deletions

View File

@ -337,6 +337,23 @@ namespace osu.Game.Tests.Visual.Gameplay
restoreVolumes();
}
[Test]
public void TestEpilepsyWarningWithDisabledStoryboard()
{
saveVolumes();
setFullVolume();
AddStep("disable storyboards", () => config.SetValue(OsuSetting.ShowStoryboard, false));
AddStep("change epilepsy warning", () => epilepsyWarning = true);
AddStep("load dummy beatmap", () => resetPlayer(false));
AddUntilStep("wait for current", () => loader.IsCurrentScreen());
AddUntilStep("epilepsy warning absent", () => getWarning() == null);
restoreVolumes();
}
[Test]
public void TestEpilepsyWarningEarlyExit()
{
@ -454,7 +471,7 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("click notification", () => notification.TriggerClick());
}
private EpilepsyWarning getWarning() => loader.ChildrenOfType<EpilepsyWarning>().SingleOrDefault();
private EpilepsyWarning getWarning() => loader.ChildrenOfType<EpilepsyWarning>().SingleOrDefault(w => w.IsAlive);
private partial class TestPlayerLoader : PlayerLoader
{

View File

@ -489,6 +489,7 @@ namespace osu.Game.Screens.Play
{
// This goes hand-in-hand with the restoration of low pass filter in contentOut().
this.TransformBindableTo(volumeAdjustment, 0, CONTENT_OUT_DURATION, Easing.OutCubic);
epilepsyWarning?.Expire();
}
pushSequence.Schedule(() =>