1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-31 00:42:55 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModBlockFail.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
933 B
C#
Raw Normal View History

// 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
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
{
private Bindable<bool> showHealthBar;
/// <summary>
/// We never fail, 'yo.
/// </summary>
public bool PerformFail() => false;
public bool RestartOnFail => false;
2019-09-19 00:45:42 +08:00
public void ReadFromConfig(OsuConfigManager config)
{
showHealthBar = config.GetBindable<bool>(OsuSetting.ShowHealthDisplayWhenCantFail);
}
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHealthBar.BindTo(showHealthBar);
}
}
}