mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 21:02:55 +08:00
Internalize HitObjects to playfields, since some playfields may not use that container.
This commit is contained in:
parent
ba998035a8
commit
62656b98df
@ -187,17 +187,19 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
||||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judged);
|
|
||||||
|
protected override bool AllObjectsJudged => drawableObjects.All(o => o.Judged);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The playfield.
|
/// The playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected Playfield<TObject, TJudgement> Playfield;
|
protected Playfield<TObject, TJudgement> Playfield;
|
||||||
|
|
||||||
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container content;
|
private readonly Container content;
|
||||||
|
|
||||||
public override IEnumerable<HitObject> Objects => Beatmap.HitObjects;
|
private List<DrawableHitObject<TObject, TJudgement>> drawableObjects = new List<DrawableHitObject<TObject, TJudgement>>();
|
||||||
|
|
||||||
protected HitRenderer(WorkingBeatmap beatmap)
|
protected HitRenderer(WorkingBeatmap beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
@ -224,6 +226,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
private void loadObjects()
|
private void loadObjects()
|
||||||
{
|
{
|
||||||
|
drawableObjects.Clear();
|
||||||
|
|
||||||
foreach (TObject h in Beatmap.HitObjects)
|
foreach (TObject h in Beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
var drawableObject = GetVisualRepresentation(h);
|
var drawableObject = GetVisualRepresentation(h);
|
||||||
@ -233,6 +237,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
drawableObject.OnJudgement += onJudgement;
|
drawableObject.OnJudgement += onJudgement;
|
||||||
|
|
||||||
|
drawableObjects.Add(drawableObject);
|
||||||
Playfield.Add(drawableObject);
|
Playfield.Add(drawableObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The HitObjects contained in this Playfield.
|
/// The HitObjects contained in this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
protected HitObjectContainer<DrawableHitObject<TObject, TJudgement>> HitObjects;
|
||||||
|
|
||||||
internal Container<Drawable> ScaledContent;
|
internal Container<Drawable> ScaledContent;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user