1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Move health display out of the visibility container

This commit is contained in:
Salman Ahmed 2019-07-02 02:19:59 +03:00 committed by KingLuigi4932
parent a8e8650ddd
commit 6a79349f4a

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -40,6 +41,7 @@ namespace osu.Game.Screens.Play
private readonly IReadOnlyList<Mod> mods;
private Bindable<bool> showHud;
private Bindable<bool> hideHealthbar;
private readonly Container visibilityContainer;
private readonly BindableBool replayLoaded = new BindableBool();
@ -77,11 +79,11 @@ namespace osu.Game.Screens.Play
ComboCounter = CreateComboCounter(),
},
},
HealthDisplay = CreateHealthDisplay(),
Progress = CreateProgress(),
ModDisplay = CreateModsContainer(),
}
},
HealthDisplay = CreateHealthDisplay(),
PlayerSettingsOverlay = CreatePlayerSettingsOverlay(),
new FillFlowContainer
{
@ -112,8 +114,14 @@ namespace osu.Game.Screens.Play
ModDisplay.Current.Value = mods;
hideHealthbar = config.GetBindable<bool>(OsuSetting.HideHealthBar);
showHud = config.GetBindable<bool>(OsuSetting.ShowInterface);
showHud.ValueChanged += visible => visibilityContainer.FadeTo(visible.NewValue ? 1 : 0, duration);
showHud.ValueChanged += visible =>
{
visibilityContainer.FadeTo(visible.NewValue ? 1 : 0, duration);
if (!(hideHealthbar.Value && mods.OfType<ModBlockFail>().Any()))
HealthDisplay.FadeTo(visible.NewValue ? 1 : 0, duration);
};
showHud.TriggerChange();
if (!showHud.Value && !hasShownNotificationOnce)