mirror of
https://github.com/ppy/osu
synced 2024-12-25 08:12:41 +00:00
Hide the menu cursor while inside the playfield by default
This commit is contained in:
parent
4dc8e0ae20
commit
f181ee1843
@ -18,6 +18,7 @@ using osu.Game.Rulesets.Osu.Scoring;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
@ -30,6 +31,8 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
}
|
||||
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; // always show the gameplay cursor
|
||||
|
||||
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
|
||||
|
||||
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
||||
|
@ -34,6 +34,7 @@ using osu.Game.Rulesets.Configuration;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
@ -331,6 +332,9 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => true; // required for IProvideCursor
|
||||
|
||||
// only show the cursor when within the playfield, by default.
|
||||
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => Playfield.ReceivePositionalInputAt(screenSpacePos);
|
||||
|
||||
CursorContainer IProvideCursor.Cursor => Playfield.Cursor;
|
||||
|
||||
public override GameplayCursorContainer Cursor => Playfield.Cursor;
|
||||
|
@ -100,10 +100,13 @@ namespace osu.Game.Rulesets.UI
|
||||
public GameplayCursorContainer Cursor { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provide an optional cursor which is to be used for gameplay.
|
||||
/// Provide a cursor which is to be used for gameplay.
|
||||
/// </summary>
|
||||
/// <returns>The cursor, or null if a cursor is not rqeuired.</returns>
|
||||
protected virtual GameplayCursorContainer CreateCursor() => null;
|
||||
/// <remarks>
|
||||
/// The default provided cursor is invisible when inside the bounds of the <see cref="Playfield"/>.
|
||||
/// </remarks>
|
||||
/// <returns>The cursor, or null to show the menu cursor.</returns>
|
||||
protected virtual GameplayCursorContainer CreateCursor() => new InvisibleCursorContainer();
|
||||
|
||||
/// <summary>
|
||||
/// Registers a <see cref="Playfield"/> as a nested <see cref="Playfield"/>.
|
||||
@ -143,5 +146,14 @@ namespace osu.Game.Rulesets.UI
|
||||
/// Creates the container that will be used to contain the <see cref="DrawableHitObject"/>s.
|
||||
/// </summary>
|
||||
protected virtual HitObjectContainer CreateHitObjectContainer() => new HitObjectContainer();
|
||||
|
||||
public class InvisibleCursorContainer : GameplayCursorContainer
|
||||
{
|
||||
protected override Drawable CreateCursor() => new InvisibleCursor();
|
||||
|
||||
private class InvisibleCursor : Drawable
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user