From d37cefbad826004c257cac67daad6db3ba93a95f Mon Sep 17 00:00:00 2001 From: iiSaLMaN Date: Sat, 29 Jun 2019 04:23:59 +0300 Subject: [PATCH] Implement IApplicableToHUD --- osu.Game/Rulesets/Mods/IApplicableToHUD.cs | 18 ++++++++++++++++++ osu.Game/Screens/Play/Player.cs | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 osu.Game/Rulesets/Mods/IApplicableToHUD.cs diff --git a/osu.Game/Rulesets/Mods/IApplicableToHUD.cs b/osu.Game/Rulesets/Mods/IApplicableToHUD.cs new file mode 100644 index 0000000000..4fb535a0b3 --- /dev/null +++ b/osu.Game/Rulesets/Mods/IApplicableToHUD.cs @@ -0,0 +1,18 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Game.Screens.Play; + +namespace osu.Game.Rulesets.Mods +{ + /// + /// An interface for mods that apply changes to the . + /// + public interface IApplicableToHUD : IApplicableMod + { + /// + /// Provide a . Called once on initialisation of a play instance. + /// + void ApplyToHUD(HUDOverlay overlay); + } +} diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 957498dc44..1ae234ab2e 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -494,6 +494,9 @@ namespace osu.Game.Screens.Play GameplayClockContainer.Restart(); GameplayClockContainer.FadeInFromZero(750, Easing.OutQuint); + + foreach (var mod in Mods.Value.OfType()) + mod.ApplyToHUD(HUDOverlay); } public override void OnSuspending(IScreen next)