mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
Simplify Hud visibility change
This commit is contained in:
parent
9cb614fee7
commit
eafe215169
@ -30,7 +30,6 @@ namespace osu.Game.Screens.Play
|
||||
public readonly SongProgress Progress;
|
||||
public readonly ModDisplay ModDisplay;
|
||||
|
||||
private Bindable<bool> showKeyCounter;
|
||||
private Bindable<bool> showHud;
|
||||
|
||||
private static bool hasShownNotificationOnce;
|
||||
@ -46,6 +45,7 @@ namespace osu.Game.Screens.Play
|
||||
protected HUDOverlay()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
AlwaysPresent = true;
|
||||
|
||||
Add(content = new Container
|
||||
{
|
||||
@ -67,24 +67,8 @@ namespace osu.Game.Screens.Play
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuConfigManager config, NotificationManager notificationManager)
|
||||
{
|
||||
showKeyCounter = config.GetBindable<bool>(OsuSetting.KeyOverlay);
|
||||
showKeyCounter.ValueChanged += keyCounterVisibility =>
|
||||
{
|
||||
if (keyCounterVisibility)
|
||||
KeyCounter.FadeIn(duration);
|
||||
else
|
||||
KeyCounter.FadeOut(duration);
|
||||
};
|
||||
showKeyCounter.TriggerChange();
|
||||
|
||||
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
|
||||
showHud.ValueChanged += hudVisibility =>
|
||||
{
|
||||
if (hudVisibility)
|
||||
content.FadeIn(duration);
|
||||
else
|
||||
content.FadeOut(duration);
|
||||
};
|
||||
showHud.ValueChanged += hudVisibility => FadeTo(hudVisibility ? 1 : 0, duration);
|
||||
showHud.TriggerChange();
|
||||
|
||||
if (!showHud && !hasShownNotificationOnce)
|
||||
|
Loading…
Reference in New Issue
Block a user