mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Move hit windows lookup to DrawableRuleset
This commit is contained in:
@ -13,6 +13,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Input;
|
||||
@ -390,6 +391,28 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
public ResumeOverlay ResumeOverlay { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns first available <see cref="HitWindows"/> provided by a <see cref="HitObject"/>.
|
||||
/// </summary>
|
||||
[CanBeNull]
|
||||
public HitWindows FirstAvailableHitWindows
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (var h in Objects)
|
||||
{
|
||||
if (h.HitWindows != null)
|
||||
return h.HitWindows;
|
||||
|
||||
foreach (var n in h.NestedHitObjects)
|
||||
if (n.HitWindows != null)
|
||||
return n.HitWindows;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual ResumeOverlay CreateResumeOverlay() => null;
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user