Add DimAmount for UserDimContainer

This commit is contained in:
cdwcgt 2022-10-25 13:00:53 +09:00
parent a2682b3ce3
commit f9c6190426
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2
2 changed files with 7 additions and 1 deletions

View File

@ -48,13 +48,15 @@ namespace osu.Game.Graphics.Containers
protected Bindable<double> UserDimLevel { get; private set; }
public Bindable<float> DimAmount { get; set; } = new Bindable<float>();
protected Bindable<bool> LightenDuringBreaks { get; private set; }
protected Bindable<bool> ShowStoryboard { get; private set; }
private float breakLightening => LightenDuringBreaks.Value && IsBreakTime.Value ? BREAK_LIGHTEN_AMOUNT : 0;
protected float DimLevel => Math.Max(!IgnoreUserSettings.Value ? (float)UserDimLevel.Value - breakLightening : 0, 0);
protected float DimLevel => Math.Max(!IgnoreUserSettings.Value ? (float)UserDimLevel.Value - breakLightening : DimAmount.Value, 0);
protected override Container<Drawable> Content => dimContent;
@ -76,6 +78,7 @@ namespace osu.Game.Graphics.Containers
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
UserDimLevel.ValueChanged += _ => UpdateVisuals();
DimAmount.ValueChanged += _ => UpdateVisuals();
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
IsBreakTime.ValueChanged += _ => UpdateVisuals();
ShowStoryboard.ValueChanged += _ => UpdateVisuals();

View File

@ -43,6 +43,8 @@ namespace osu.Game.Screens.Backgrounds
/// </summary>
public readonly Bindable<float> BlurAmount = new BindableFloat();
public readonly Bindable<float> DimAmount = new Bindable<float>();
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
private readonly DimmableBackground dimmable;
@ -58,6 +60,7 @@ namespace osu.Game.Screens.Backgrounds
dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings);
dimmable.IsBreakTime.BindTo(IsBreakTime);
dimmable.BlurAmount.BindTo(BlurAmount);
dimmable.DimAmount.BindTo(DimAmount);
StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground);
}