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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2019-07-02 06:47:39 +08:00
|
|
|
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>
|
2020-05-12 19:08:35 +08:00
|
|
|
public bool PerformFail() => false;
|
2019-09-19 17:00:11 +08:00
|
|
|
|
2019-09-19 16:44:24 +08:00
|
|
|
public bool RestartOnFail => false;
|
2019-09-19 00:45:42 +08:00
|
|
|
|
2019-07-02 06:47:39 +08:00
|
|
|
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)
|
|
|
|
{
|
2021-12-10 13:15:00 +08:00
|
|
|
overlay.ShowHealthBar.BindTo(showHealthBar);
|
2019-07-02 06:47:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|