mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 20:47:24 +09:00
Move hit windows lookup to DrawableRuleset
This commit is contained in:
parent
0ee0184e01
commit
4cad55cee6
@ -13,6 +13,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
@ -390,6 +391,28 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public ResumeOverlay ResumeOverlay { get; protected set; }
|
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;
|
protected virtual ResumeOverlay CreateResumeOverlay() => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -259,9 +258,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Margin = new MarginPadding { Top = 20, Right = 10 },
|
Margin = new MarginPadding { Top = 20, Right = 10 },
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual HitErrorDisplay CreateHitErrorDisplayOverlay() => new HitErrorDisplay(
|
protected virtual HitErrorDisplay CreateHitErrorDisplayOverlay() => new HitErrorDisplay(scoreProcessor, drawableRuleset.FirstAvailableHitWindows);
|
||||||
scoreProcessor,
|
|
||||||
drawableRuleset.Objects.Concat(drawableRuleset.Objects.SelectMany(h => h.NestedHitObjects)).FirstOrDefault(h => h.HitWindows != null)?.HitWindows);
|
|
||||||
|
|
||||||
protected virtual PlayerSettingsOverlay CreatePlayerSettingsOverlay() => new PlayerSettingsOverlay();
|
protected virtual PlayerSettingsOverlay CreatePlayerSettingsOverlay() => new PlayerSettingsOverlay();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user