Add `IHasNoTimedInputs` interface to scope change further

This commit is contained in:
Dean Herbert 2023-06-06 22:22:42 +09:00
parent d1300f75c0
commit 247fa088db
3 changed files with 17 additions and 2 deletions

View File

@ -18,7 +18,7 @@
namespace osu.Game.Rulesets.Osu.Mods
{
public class OsuModRelax : ModRelax, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToPlayer
public class OsuModRelax : ModRelax, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToPlayer, IHasNoTimedInputs
{
public override LocalisableString Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";

View File

@ -0,0 +1,15 @@
// 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.
namespace osu.Game.Rulesets.Mods
{
/// <summary>
/// Denotes a mod which removes timed inputs from a ruleset which would usually have them.
/// </summary>
/// <remarks>
/// This will be used, for instance, to omit showing offset calibration UI post-gameplay.
/// </remarks>
public interface IHasNoTimedInputs
{
}
}

View File

@ -184,7 +184,7 @@ private void scoreChanged(ValueChangedEvent<ScoreInfo?> score)
if (score.NewValue == null)
return;
if (score.NewValue.Mods.Any(m => !m.UserPlayable || m is ModRelax))
if (score.NewValue.Mods.Any(m => !m.UserPlayable || m is IHasNoTimedInputs))
return;
var hitEvents = score.NewValue.HitEvents;