mirror of https://github.com/ppy/osu
Reduce background brightness at PlayerLoader
This commit is contained in:
parent
7281b64eb6
commit
7bc7df2249
|
@ -247,6 +247,7 @@ private void cancelLoad()
|
||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
{
|
{
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
base.OnSuspending(next);
|
base.OnSuspending(next);
|
||||||
cancelLoad();
|
cancelLoad();
|
||||||
}
|
}
|
||||||
|
@ -258,6 +259,7 @@ public override bool OnExiting(IScreen next)
|
||||||
cancelLoad();
|
cancelLoad();
|
||||||
|
|
||||||
Background.EnableUserDim.Value = false;
|
Background.EnableUserDim.Value = false;
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
|
|
||||||
return base.OnExiting(next);
|
return base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
@ -273,6 +275,22 @@ protected override void Dispose(bool isDisposing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool backgroundBrightnessReduction;
|
||||||
|
|
||||||
|
protected bool BackgroundBrightnessReduction
|
||||||
|
{
|
||||||
|
get => backgroundBrightnessReduction;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == backgroundBrightnessReduction)
|
||||||
|
return;
|
||||||
|
|
||||||
|
backgroundBrightnessReduction = value;
|
||||||
|
|
||||||
|
Background.FadeColour(OsuColour.Gray(backgroundBrightnessReduction ? 0.8f : 1), 200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
@ -287,12 +305,16 @@ protected override void Update()
|
||||||
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
||||||
Background.EnableUserDim.Value = true;
|
Background.EnableUserDim.Value = true;
|
||||||
Background.BlurAmount.Value = 0;
|
Background.BlurAmount.Value = 0;
|
||||||
|
|
||||||
|
BackgroundBrightnessReduction = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Returns background dim and blur to the values specified by PlayerLoader.
|
// Returns background dim and blur to the values specified by PlayerLoader.
|
||||||
Background.EnableUserDim.Value = false;
|
Background.EnableUserDim.Value = false;
|
||||||
Background.BlurAmount.Value = BACKGROUND_BLUR;
|
Background.BlurAmount.Value = BACKGROUND_BLUR;
|
||||||
|
|
||||||
|
BackgroundBrightnessReduction = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue