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>
|
2020-05-12 11:08:35 +00:00
|
|
|
public bool PerformFail() => false;
|
2019-09-19 09:00:11 +00:00
|
|
|
|
2019-09-19 08:44:24 +00:00
|
|
|
public bool RestartOnFail => false;
|
2019-09-18 16:45:42 +00:00
|
|
|
|
2019-07-01 22:47:39 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|