2019-07-01 22:47:39 +00: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-06 20:30:30 +00:00
|
|
|
private Bindable<bool> showHealthBar;
|
2019-07-01 22:47:39 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// We never fail, 'yo.
|
|
|
|
/// </summary>
|
|
|
|
public bool AllowFail => false;
|
|
|
|
|
|
|
|
public void ReadFromConfig(OsuConfigManager config)
|
|
|
|
{
|
2019-07-06 20:30:30 +00:00
|
|
|
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail);
|
2019-07-01 22:47:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
2019-07-06 20:30:30 +00:00
|
|
|
overlay.ShowHealthbar.BindTo(showHealthBar);
|
2019-07-01 22:47:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|