Change method of cursor creation

This commit is contained in:
Dean Herbert
2019-03-06 17:23:13 +09:00
parent 18826b3a59
commit 7aa30ca3f6
2 changed files with 3 additions and 13 deletions

View File

@ -10,7 +10,6 @@ using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Connections; using osu.Game.Rulesets.Osu.Objects.Drawables.Connections;
using osu.Game.Rulesets.UI; using osu.Game.Rulesets.UI;
using System.Linq; using System.Linq;
using osu.Framework.Graphics.Cursor;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Osu.UI.Cursor; using osu.Game.Rulesets.Osu.UI.Cursor;
@ -36,7 +35,6 @@ namespace osu.Game.Rulesets.Osu.UI
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
Cursor,
connectionLayer = new FollowPointRenderer connectionLayer = new FollowPointRenderer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -53,12 +51,11 @@ namespace osu.Game.Rulesets.Osu.UI
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Depth = -1, Depth = -1,
}, },
Cursor = new GameplayCursorContainer(),
} }
}; };
} }
protected override CursorContainer CreateCursor() => new GameplayCursorContainer();
public override void Add(DrawableHitObject h) public override void Add(DrawableHitObject h)
{ {
h.OnNewResult += onNewResult; h.OnNewResult += onNewResult;

View File

@ -58,8 +58,6 @@ namespace osu.Game.Rulesets.UI
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
hitObjectContainerLazy = new Lazy<HitObjectContainer>(CreateHitObjectContainer); hitObjectContainerLazy = new Lazy<HitObjectContainer>(CreateHitObjectContainer);
Cursor = CreateCursor();
} }
private WorkingBeatmap beatmap; private WorkingBeatmap beatmap;
@ -88,14 +86,9 @@ namespace osu.Game.Rulesets.UI
public virtual bool Remove(DrawableHitObject h) => HitObjectContainer.Remove(h); public virtual bool Remove(DrawableHitObject h) => HitObjectContainer.Remove(h);
/// <summary> /// <summary>
/// Creates the cursor. May be null if no cursor is required. /// The cursor currently being used by this <see cref="Playfield"/>. May be null if no cursor is provided.
/// </summary> /// </summary>
protected virtual CursorContainer CreateCursor() => null; public CursorContainer Cursor { get; protected set; }
/// <summary>
/// The cursor provided by this <see cref="RulesetContainer"/>. May be null if no cursor is provided.
/// </summary>
public CursorContainer Cursor { get; }
/// <summary> /// <summary>
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>. /// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.