mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 17:53:15 +08:00
Allow playfield to specify whether it has a cursor or not.
This commit is contained in:
parent
4b1588a21d
commit
4aafc172ca
@ -21,6 +21,8 @@ namespace osu.Game.Modes.Osu.UI
|
|||||||
private readonly Container judgementLayer;
|
private readonly Container judgementLayer;
|
||||||
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
|
private readonly ConnectionRenderer<OsuHitObject> connectionLayer;
|
||||||
|
|
||||||
|
public override bool ProvidingUserCursor => true;
|
||||||
|
|
||||||
public override Vector2 Size
|
public override Vector2 Size
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -42,6 +42,16 @@ namespace osu.Game.Modes.UI
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected readonly KeyConversionInputManager KeyConversionInputManager;
|
protected readonly KeyConversionInputManager KeyConversionInputManager;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we are currently providing the local user a gameplay cursor.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool ProvidingUserCursor => false;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we have a replay loaded currently.
|
||||||
|
/// </summary>
|
||||||
|
public bool HasReplayLoaded => InputManager.ReplayInputHandler != null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether all the HitObjects have been judged.
|
/// Whether all the HitObjects have been judged.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -157,6 +167,8 @@ namespace osu.Game.Modes.UI
|
|||||||
{
|
{
|
||||||
public event Action<TJudgement> OnJudgement;
|
public event Action<TJudgement> OnJudgement;
|
||||||
|
|
||||||
|
public sealed override bool ProvidingUserCursor => !HasReplayLoaded && Playfield.ProvidingUserCursor;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None);
|
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result != HitResult.None);
|
||||||
|
|
||||||
|
@ -22,6 +22,11 @@ namespace osu.Game.Modes.UI
|
|||||||
|
|
||||||
internal Container<Drawable> ScaledContent;
|
internal Container<Drawable> ScaledContent;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether we are currently providing the local user a gameplay cursor.
|
||||||
|
/// </summary>
|
||||||
|
public virtual bool ProvidingUserCursor => false;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container<Drawable> content;
|
private readonly Container<Drawable> content;
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ namespace osu.Game
|
|||||||
if (intro?.ChildScreen != null)
|
if (intro?.ChildScreen != null)
|
||||||
intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
|
intro.ChildScreen.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight };
|
||||||
|
|
||||||
Cursor.State = currentScreen == null || currentScreen.HasLocalCursorDisplayed ? Visibility.Hidden : Visibility.Visible;
|
Cursor.State = currentScreen?.HasLocalCursorDisplayed == false ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void screenAdded(Screen newScreen)
|
private void screenAdded(Screen newScreen)
|
||||||
|
@ -31,9 +31,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
internal override bool ShowOverlays => false;
|
internal override bool ShowOverlays => false;
|
||||||
|
|
||||||
internal override bool HasLocalCursorDisplayed => !hasReplayLoaded && !IsPaused;
|
internal override bool HasLocalCursorDisplayed => !IsPaused && HitRenderer.ProvidingUserCursor;
|
||||||
|
|
||||||
private bool hasReplayLoaded => HitRenderer.InputManager.ReplayInputHandler != null;
|
|
||||||
|
|
||||||
public BeatmapInfo BeatmapInfo;
|
public BeatmapInfo BeatmapInfo;
|
||||||
|
|
||||||
@ -305,7 +303,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
if (pauseOverlay == null) return false;
|
if (pauseOverlay == null) return false;
|
||||||
|
|
||||||
if (hasReplayLoaded)
|
if (HitRenderer.HasReplayLoaded)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
if (pauseOverlay.State != Visibility.Visible && !canPause) return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user