1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-04 02:13:22 +08:00

Continue displaying storyboard even if fully dimmed in specific circumstances

Closes https://github.com/ppy/osu/issues/9315.
Closes https://github.com/ppy/osu/issues/29867.

Notably, this does nothing about
https://github.com/ppy/osu/issues/25075, but I'm not sure what to do
with that one in the first place.
This commit is contained in:
Bartłomiej Dach 2024-09-23 11:08:31 +02:00
parent ccf1acce56
commit 0f758ca25f
No known key found for this signature in database

View File

@ -3,7 +3,9 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
@ -24,6 +26,21 @@ namespace osu.Game.Screens.Play
private readonly Storyboard storyboard;
private readonly IReadOnlyList<Mod> mods;
/// <summary>
/// In certain circumstances, the storyboard cannot be hidden entirely even if it is fully dimmed. Such circumstances include:
/// <list type="bullet">
/// <item>
/// cases where the storyboard has an overlay layer sprite, as it should continue to display fully dimmed
/// <i>in front of</i> the playfield (https://github.com/ppy/osu/issues/29867),
/// </item>
/// <item>
/// cases where the storyboard includes samples - as they are played back via drawable samples,
/// they must be present for the playback to occur (https://github.com/ppy/osu/issues/9315).
/// </item>
/// </list>
/// </summary>
private readonly Lazy<bool> storyboardMustAlwaysBePresent;
private DrawableStoryboard drawableStoryboard;
/// <summary>
@ -38,6 +55,8 @@ namespace osu.Game.Screens.Play
{
this.storyboard = storyboard;
this.mods = mods;
storyboardMustAlwaysBePresent = new Lazy<bool>(() => storyboard.GetLayer(@"Overlay").Elements.Any() || storyboard.Layers.Any(l => l.Elements.OfType<StoryboardSampleInfo>().Any()));
}
[BackgroundDependencyLoader]
@ -54,7 +73,7 @@ namespace osu.Game.Screens.Play
base.LoadComplete();
}
protected override bool ShowDimContent => IgnoreUserSettings.Value || (ShowStoryboard.Value && DimLevel < 1);
protected override bool ShowDimContent => IgnoreUserSettings.Value || (ShowStoryboard.Value && (DimLevel < 1 || storyboardMustAlwaysBePresent.Value));
private void initializeStoryboard(bool async)
{