mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Merge pull request #22868 from peppy/no-epilepsy-warning-storyboard-disable
Don't show epilepsy warning when storyboards are disabled
This commit is contained in:
commit
e6872629f3
@ -45,6 +45,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private SessionStatics sessionStatics { get; set; }
|
private SessionStatics sessionStatics { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
[Cached(typeof(INotificationOverlay))]
|
[Cached(typeof(INotificationOverlay))]
|
||||||
private readonly NotificationOverlay notificationOverlay;
|
private readonly NotificationOverlay notificationOverlay;
|
||||||
|
|
||||||
@ -317,6 +320,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
saveVolumes();
|
saveVolumes();
|
||||||
setFullVolume();
|
setFullVolume();
|
||||||
|
|
||||||
|
AddStep("enable storyboards", () => config.SetValue(OsuSetting.ShowStoryboard, true));
|
||||||
AddStep("change epilepsy warning", () => epilepsyWarning = warning);
|
AddStep("change epilepsy warning", () => epilepsyWarning = warning);
|
||||||
AddStep("load dummy beatmap", () => resetPlayer(false));
|
AddStep("load dummy beatmap", () => resetPlayer(false));
|
||||||
|
|
||||||
@ -333,12 +337,30 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
restoreVolumes();
|
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]
|
[Test]
|
||||||
public void TestEpilepsyWarningEarlyExit()
|
public void TestEpilepsyWarningEarlyExit()
|
||||||
{
|
{
|
||||||
saveVolumes();
|
saveVolumes();
|
||||||
setFullVolume();
|
setFullVolume();
|
||||||
|
|
||||||
|
AddStep("enable storyboards", () => config.SetValue(OsuSetting.ShowStoryboard, true));
|
||||||
AddStep("set epilepsy warning", () => epilepsyWarning = true);
|
AddStep("set epilepsy warning", () => epilepsyWarning = true);
|
||||||
AddStep("load dummy beatmap", () => resetPlayer(false));
|
AddStep("load dummy beatmap", () => resetPlayer(false));
|
||||||
|
|
||||||
@ -449,7 +471,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("click notification", () => notification.TriggerClick());
|
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
|
private partial class TestPlayerLoader : PlayerLoader
|
||||||
{
|
{
|
||||||
|
@ -67,6 +67,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private OsuScrollContainer settingsScroll = null!;
|
private OsuScrollContainer settingsScroll = null!;
|
||||||
|
|
||||||
|
private Bindable<bool> showStoryboards = null!;
|
||||||
|
|
||||||
private bool backgroundBrightnessReduction;
|
private bool backgroundBrightnessReduction;
|
||||||
|
|
||||||
private readonly BindableDouble volumeAdjustment = new BindableDouble(1);
|
private readonly BindableDouble volumeAdjustment = new BindableDouble(1);
|
||||||
@ -149,10 +151,11 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(SessionStatics sessionStatics, AudioManager audio)
|
private void load(SessionStatics sessionStatics, AudioManager audio, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
muteWarningShownOnce = sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce);
|
muteWarningShownOnce = sessionStatics.GetBindable<bool>(Static.MutedAudioNotificationShownOnce);
|
||||||
batteryWarningShownOnce = sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce);
|
batteryWarningShownOnce = sessionStatics.GetBindable<bool>(Static.LowBatteryNotificationShownOnce);
|
||||||
|
showStoryboards = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
|
|
||||||
const float padding = 25;
|
const float padding = 25;
|
||||||
|
|
||||||
@ -463,7 +466,10 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
// only show if the warning was created (i.e. the beatmap needs it)
|
// only show if the warning was created (i.e. the beatmap needs it)
|
||||||
// and this is not a restart of the map (the warning expires after first load).
|
// and this is not a restart of the map (the warning expires after first load).
|
||||||
if (epilepsyWarning?.IsAlive == true)
|
//
|
||||||
|
// note the late check of storyboard enable as the user may have just changed it
|
||||||
|
// from the settings on the loader screen.
|
||||||
|
if (epilepsyWarning?.IsAlive == true && showStoryboards.Value)
|
||||||
{
|
{
|
||||||
const double epilepsy_display_length = 3000;
|
const double epilepsy_display_length = 3000;
|
||||||
|
|
||||||
@ -483,6 +489,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
// This goes hand-in-hand with the restoration of low pass filter in contentOut().
|
// This goes hand-in-hand with the restoration of low pass filter in contentOut().
|
||||||
this.TransformBindableTo(volumeAdjustment, 0, CONTENT_OUT_DURATION, Easing.OutCubic);
|
this.TransformBindableTo(volumeAdjustment, 0, CONTENT_OUT_DURATION, Easing.OutCubic);
|
||||||
|
epilepsyWarning?.Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
pushSequence.Schedule(() =>
|
pushSequence.Schedule(() =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user