2019-07-02 06:47:39 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Configuration;
|
|
|
|
using osu.Game.Screens.Play;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
|
|
|
public abstract class ModBlockFail : Mod, IApplicableFailOverride, IApplicableToHUD, IReadFromConfig
|
|
|
|
{
|
2019-07-07 04:30:30 +08:00
|
|
|
private Bindable<bool> showHealthBar;
|
2019-07-02 06:47:39 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// We never fail, 'yo.
|
|
|
|
/// </summary>
|
|
|
|
public bool AllowFail => false;
|
|
|
|
|
|
|
|
public void ReadFromConfig(OsuConfigManager config)
|
|
|
|
{
|
2019-07-07 04:30:30 +08:00
|
|
|
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail);
|
2019-07-02 06:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
2019-07-07 04:30:30 +08:00
|
|
|
overlay.ShowHealthbar.BindTo(showHealthBar);
|
2019-07-02 06:47:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|