mirror of
https://github.com/ppy/osu
synced 2024-12-29 02:12:43 +00:00
Fix mania throwing an exception on start of map
This commit is contained in:
parent
b1a3dfedd1
commit
68a79f895a
@ -26,11 +26,11 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
throw new ArgumentException("Can't have zero or fewer stages.");
|
||||
|
||||
GridContainer playfieldGrid;
|
||||
InternalChild = playfieldGrid = new GridContainer
|
||||
AddInternal(playfieldGrid = new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Content = new[] { new Drawable[stageDefinitions.Count] }
|
||||
};
|
||||
});
|
||||
|
||||
var normalColumnAction = ManiaAction.Key1;
|
||||
var specialColumnAction = ManiaAction.Special1;
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
|
||||
const float relax_leniency = 3;
|
||||
|
||||
foreach (var drawable in playfield.HitObjects.AliveObjects)
|
||||
foreach (var drawable in playfield.HitObjectContainer.AliveObjects)
|
||||
{
|
||||
if (!(drawable is DrawableOsuHitObject osuHit))
|
||||
continue;
|
||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
|
||||
public override void PostProcess()
|
||||
{
|
||||
connectionLayer.HitObjects = HitObjects.Objects.Select(d => d.HitObject).OfType<OsuHitObject>();
|
||||
connectionLayer.HitObjects = HitObjectContainer.Objects.Select(d => d.HitObject).OfType<OsuHitObject>();
|
||||
}
|
||||
|
||||
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
|
||||
|
@ -19,12 +19,12 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// The <see cref="DrawableHitObject"/> contained in this Playfield.
|
||||
/// </summary>
|
||||
public HitObjectContainer HitObjects { get; private set; }
|
||||
public HitObjectContainer HitObjectContainer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// All the <see cref="DrawableHitObject"/>s contained in this <see cref="Playfield"/> and all <see cref="NestedPlayfields"/>.
|
||||
/// </summary>
|
||||
public IEnumerable<DrawableHitObject> AllHitObjects => HitObjects?.Objects.Concat(NestedPlayfields.SelectMany(p => p.AllHitObjects)) ?? Enumerable.Empty<DrawableHitObject>();
|
||||
public IEnumerable<DrawableHitObject> AllHitObjects => HitObjectContainer?.Objects.Concat(NestedPlayfields.SelectMany(p => p.AllHitObjects)) ?? Enumerable.Empty<DrawableHitObject>();
|
||||
|
||||
/// <summary>
|
||||
/// All <see cref="Playfield"/>s nested inside this <see cref="Playfield"/>.
|
||||
@ -60,10 +60,10 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
this.beatmap = beatmap.Value;
|
||||
|
||||
HitObjects = CreateHitObjectContainer();
|
||||
HitObjects.RelativeSizeAxes = Axes.Both;
|
||||
HitObjectContainer = CreateHitObjectContainer();
|
||||
HitObjectContainer.RelativeSizeAxes = Axes.Both;
|
||||
|
||||
Add(HitObjects);
|
||||
Add(HitObjectContainer);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -75,13 +75,13 @@ namespace osu.Game.Rulesets.UI
|
||||
/// Adds a DrawableHitObject to this Playfield.
|
||||
/// </summary>
|
||||
/// <param name="h">The DrawableHitObject to add.</param>
|
||||
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
|
||||
public virtual void Add(DrawableHitObject h) => HitObjectContainer.Add(h);
|
||||
|
||||
/// <summary>
|
||||
/// Remove a DrawableHitObject from this Playfield.
|
||||
/// </summary>
|
||||
/// <param name="h">The DrawableHitObject to remove.</param>
|
||||
public virtual void Remove(DrawableHitObject h) => HitObjects.Remove(h);
|
||||
public virtual void Remove(DrawableHitObject h) => HitObjectContainer.Remove(h);
|
||||
|
||||
/// <summary>
|
||||
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.
|
||||
|
@ -306,7 +306,7 @@ namespace osu.Game.Rulesets.UI
|
||||
Playfield.PostProcess();
|
||||
|
||||
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjects.Objects);
|
||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
||||
/// <summary>
|
||||
/// The container that contains the <see cref="DrawableHitObject"/>s.
|
||||
/// </summary>
|
||||
public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects;
|
||||
public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)HitObjectContainer;
|
||||
|
||||
/// <summary>
|
||||
/// The direction in which <see cref="DrawableHitObject"/>s in this <see cref="ScrollingPlayfield"/> should scroll.
|
||||
|
Loading…
Reference in New Issue
Block a user