1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

move default into StoryboardContainer, fix load bug, remove comment

This commit is contained in:
David Zhao 2019-07-10 12:24:05 +09:00
parent 41afe89c0b
commit 7929104b8a
3 changed files with 5 additions and 17 deletions

View File

@ -334,15 +334,7 @@ namespace osu.Game.Tests.Visual.Background
{
protected override BackgroundScreen CreateBackground() => new FadeAccessibleBackground(Beatmap.Value);
protected override StoryboardContainer CreateStoryboardContainer(Storyboard storyboard)
{
return new TestStoryboardContainer
{
RelativeSizeAxes = Axes.Both,
Alpha = 1,
EnableUserDim = { Value = true }
};
}
protected override StoryboardContainer CreateStoryboardContainer(Storyboard storyboard) => new TestStoryboardContainer { RelativeSizeAxes = Axes.Both };
public TestStoryboardContainer CurrentStoryboardContainer => (TestStoryboardContainer)StoryboardContainer;

View File

@ -19,6 +19,8 @@ namespace osu.Game.Graphics.Containers
public StoryboardContainer(Storyboard storyboard)
{
this.storyboard = storyboard;
EnableUserDim.Default = true;
EnableUserDim.Value = true;
}
[BackgroundDependencyLoader]
@ -29,13 +31,12 @@ namespace osu.Game.Graphics.Containers
protected override void LoadComplete()
{
ShowStoryboard.ValueChanged += _ => initializeStoryboard(true);
ShowStoryboard.BindValueChanged(_ => initializeStoryboard(true), true);
base.LoadComplete();
}
protected override void ApplyFade()
{
// Storyboards cannot be blurred, so just hide the storyboard if it gets toggled.
DimContainer.FadeTo(!ShowStoryboard.Value || UserDimLevel.Value == 1 ? 0 : 1, BACKGROUND_FADE_DURATION, Easing.OutQuint);
}

View File

@ -78,12 +78,7 @@ namespace osu.Game.Screens.Play
protected StoryboardContainer StoryboardContainer { get; private set; }
protected virtual StoryboardContainer CreateStoryboardContainer(Storyboard storyboard) => new StoryboardContainer(storyboard)
{
RelativeSizeAxes = Axes.Both,
Alpha = 1,
EnableUserDim = { Value = true }
};
protected virtual StoryboardContainer CreateStoryboardContainer(Storyboard storyboard) => new StoryboardContainer(storyboard) { RelativeSizeAxes = Axes.Both };
[Cached]
[Cached(Type = typeof(IBindable<IReadOnlyList<Mod>>))]