Add the ability to disable user input on specific DrawableHitObjects

This commit is contained in:
Dean Herbert 2020-03-29 14:30:45 +09:00
parent b259708915
commit a2b3fe180e
1 changed files with 13 additions and 0 deletions

View File

@ -38,6 +38,19 @@ public abstract class DrawableHitObject : SkinReloadableDrawable
private readonly Lazy<List<DrawableHitObject>> nestedHitObjects = new Lazy<List<DrawableHitObject>>();
public IReadOnlyList<DrawableHitObject> NestedHitObjects => nestedHitObjects.IsValueCreated ? nestedHitObjects.Value : (IReadOnlyList<DrawableHitObject>)Array.Empty<DrawableHitObject>();
/// <summary>
/// Whether this object should handle any user input events.
/// </summary>
public bool HandleUserInput { get; set; } = true;
public override bool HandlePositionalInput => HandleUserInput;
public override bool HandleNonPositionalInput => HandleUserInput;
public override bool PropagatePositionalInputSubTree => HandleUserInput;
public override bool PropagateNonPositionalInputSubTree => HandleUserInput;
/// <summary>
/// Invoked when a <see cref="JudgementResult"/> has been applied by this <see cref="DrawableHitObject"/> or a nested <see cref="DrawableHitObject"/>.
/// </summary>