mirror of
https://github.com/osukey/osukey.git
synced 2025-06-16 16:57:56 +09: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.");
|
throw new ArgumentException("Can't have zero or fewer stages.");
|
||||||
|
|
||||||
GridContainer playfieldGrid;
|
GridContainer playfieldGrid;
|
||||||
InternalChild = playfieldGrid = new GridContainer
|
AddInternal(playfieldGrid = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[] { new Drawable[stageDefinitions.Count] }
|
Content = new[] { new Drawable[stageDefinitions.Count] }
|
||||||
};
|
});
|
||||||
|
|
||||||
var normalColumnAction = ManiaAction.Key1;
|
var normalColumnAction = ManiaAction.Key1;
|
||||||
var specialColumnAction = ManiaAction.Special1;
|
var specialColumnAction = ManiaAction.Special1;
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
|
|
||||||
const float relax_leniency = 3;
|
const float relax_leniency = 3;
|
||||||
|
|
||||||
foreach (var drawable in playfield.HitObjects.AliveObjects)
|
foreach (var drawable in playfield.HitObjectContainer.AliveObjects)
|
||||||
{
|
{
|
||||||
if (!(drawable is DrawableOsuHitObject osuHit))
|
if (!(drawable is DrawableOsuHitObject osuHit))
|
||||||
continue;
|
continue;
|
||||||
|
@ -61,7 +61,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
|
|
||||||
public override void PostProcess()
|
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)
|
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
|
||||||
|
@ -19,12 +19,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="DrawableHitObject"/> contained in this Playfield.
|
/// The <see cref="DrawableHitObject"/> contained in this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public HitObjectContainer HitObjects { get; private set; }
|
public HitObjectContainer HitObjectContainer { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// All the <see cref="DrawableHitObject"/>s contained in this <see cref="Playfield"/> and all <see cref="NestedPlayfields"/>.
|
/// All the <see cref="DrawableHitObject"/>s contained in this <see cref="Playfield"/> and all <see cref="NestedPlayfields"/>.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// All <see cref="Playfield"/>s nested inside this <see cref="Playfield"/>.
|
/// All <see cref="Playfield"/>s nested inside this <see cref="Playfield"/>.
|
||||||
@ -60,10 +60,10 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
this.beatmap = beatmap.Value;
|
this.beatmap = beatmap.Value;
|
||||||
|
|
||||||
HitObjects = CreateHitObjectContainer();
|
HitObjectContainer = CreateHitObjectContainer();
|
||||||
HitObjects.RelativeSizeAxes = Axes.Both;
|
HitObjectContainer.RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Add(HitObjects);
|
Add(HitObjectContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -75,13 +75,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// Adds a DrawableHitObject to this Playfield.
|
/// Adds a DrawableHitObject to this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="h">The DrawableHitObject to add.</param>
|
/// <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>
|
/// <summary>
|
||||||
/// Remove a DrawableHitObject from this Playfield.
|
/// Remove a DrawableHitObject from this Playfield.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="h">The DrawableHitObject to remove.</param>
|
/// <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>
|
/// <summary>
|
||||||
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.
|
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.
|
||||||
|
@ -306,7 +306,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
Playfield.PostProcess();
|
Playfield.PostProcess();
|
||||||
|
|
||||||
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
foreach (var mod in Mods.OfType<IApplicableToDrawableHitObjects>())
|
||||||
mod.ApplyToDrawableHitObjects(Playfield.HitObjects.Objects);
|
mod.ApplyToDrawableHitObjects(Playfield.HitObjectContainer.Objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -55,7 +55,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The container that contains the <see cref="DrawableHitObject"/>s.
|
/// The container that contains the <see cref="DrawableHitObject"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)base.HitObjects;
|
public new ScrollingHitObjectContainer HitObjects => (ScrollingHitObjectContainer)HitObjectContainer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The direction in which <see cref="DrawableHitObject"/>s in this <see cref="ScrollingPlayfield"/> should scroll.
|
/// The direction in which <see cref="DrawableHitObject"/>s in this <see cref="ScrollingPlayfield"/> should scroll.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user