mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move blocking fail logic into a base class
This commit is contained in:
committed by
KingLuigi4932
parent
72e5cbb07f
commit
a8e8650ddd
30
osu.Game/Rulesets/Mods/ModBlockFail.cs
Normal file
30
osu.Game/Rulesets/Mods/ModBlockFail.cs
Normal file
@ -0,0 +1,30 @@
|
||||
// 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
|
||||
{
|
||||
private Bindable<bool> hideHealthBar = new Bindable<bool>();
|
||||
|
||||
/// <summary>
|
||||
/// We never fail, 'yo.
|
||||
/// </summary>
|
||||
public bool AllowFail => false;
|
||||
|
||||
public void ReadFromConfig(OsuConfigManager config)
|
||||
{
|
||||
hideHealthBar = config.GetBindable<bool>(OsuSetting.HideHealthBar);
|
||||
}
|
||||
|
||||
public void ApplyToHUD(HUDOverlay overlay)
|
||||
{
|
||||
if (hideHealthBar.Value)
|
||||
overlay.HealthDisplay.Hide();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user