1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Add DimLevel property

This commit is contained in:
iiSaLMaN 2019-08-08 22:13:48 +03:00
parent a3d90da7d4
commit 0fcc6c1676
2 changed files with 5 additions and 3 deletions

View File

@ -36,6 +36,8 @@ namespace osu.Game.Graphics.Containers
protected Bindable<bool> ShowStoryboard { get; private set; }
protected double DimLevel => EnableUserDim.Value ? UserDimLevel.Value : 0;
protected override Container<Drawable> Content => dimContent;
private Container dimContent { get; }
@ -69,7 +71,7 @@ namespace osu.Game.Graphics.Containers
/// <summary>
/// Whether the content of this container should currently be visible.
/// </summary>
protected virtual bool ShowDimContent => !EnableUserDim.Value;
protected virtual bool ShowDimContent => true;
/// <summary>
/// Should be invoked when any dependent dim level or user setting is changed and bring the visual state up-to-date.
@ -79,7 +81,7 @@ namespace osu.Game.Graphics.Containers
ContentDisplayed = ShowDimContent;
dimContent.FadeTo(ContentDisplayed ? 1 : 0, BACKGROUND_FADE_DURATION, Easing.OutQuint);
dimContent.FadeColour(EnableUserDim.Value ? OsuColour.Gray(1 - (float)UserDimLevel.Value) : Color4.White, BACKGROUND_FADE_DURATION, Easing.OutQuint);
dimContent.FadeColour(OsuColour.Gray(1 - (float)DimLevel), BACKGROUND_FADE_DURATION, Easing.OutQuint);
}
}
}

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Play
base.LoadComplete();
}
protected override bool ShowDimContent => base.ShowDimContent || (ShowStoryboard.Value && UserDimLevel.Value < 1);
protected override bool ShowDimContent => ShowStoryboard.Value && DimLevel < 1;
private void initializeStoryboard(bool async)
{