mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Add DimAmount for UserDimContainer
This commit is contained in:
parent
a2682b3ce3
commit
f9c6190426
@ -48,13 +48,15 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected Bindable<double> UserDimLevel { get; private set; }
|
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> LightenDuringBreaks { get; private set; }
|
||||||
|
|
||||||
protected Bindable<bool> ShowStoryboard { get; private set; }
|
protected Bindable<bool> ShowStoryboard { get; private set; }
|
||||||
|
|
||||||
private float breakLightening => LightenDuringBreaks.Value && IsBreakTime.Value ? BREAK_LIGHTEN_AMOUNT : 0;
|
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;
|
protected override Container<Drawable> Content => dimContent;
|
||||||
|
|
||||||
@ -76,6 +78,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
ShowStoryboard = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
|
||||||
|
|
||||||
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
UserDimLevel.ValueChanged += _ => UpdateVisuals();
|
||||||
|
DimAmount.ValueChanged += _ => UpdateVisuals();
|
||||||
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
|
LightenDuringBreaks.ValueChanged += _ => UpdateVisuals();
|
||||||
IsBreakTime.ValueChanged += _ => UpdateVisuals();
|
IsBreakTime.ValueChanged += _ => UpdateVisuals();
|
||||||
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
ShowStoryboard.ValueChanged += _ => UpdateVisuals();
|
||||||
|
@ -43,6 +43,8 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public readonly Bindable<float> BlurAmount = new BindableFloat();
|
public readonly Bindable<float> BlurAmount = new BindableFloat();
|
||||||
|
|
||||||
|
public readonly Bindable<float> DimAmount = new Bindable<float>();
|
||||||
|
|
||||||
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
||||||
|
|
||||||
private readonly DimmableBackground dimmable;
|
private readonly DimmableBackground dimmable;
|
||||||
@ -58,6 +60,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings);
|
dimmable.IgnoreUserSettings.BindTo(IgnoreUserSettings);
|
||||||
dimmable.IsBreakTime.BindTo(IsBreakTime);
|
dimmable.IsBreakTime.BindTo(IsBreakTime);
|
||||||
dimmable.BlurAmount.BindTo(BlurAmount);
|
dimmable.BlurAmount.BindTo(BlurAmount);
|
||||||
|
dimmable.DimAmount.BindTo(DimAmount);
|
||||||
|
|
||||||
StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground);
|
StoryboardReplacesBackground.BindTo(dimmable.StoryboardReplacesBackground);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user