mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Allow switching between latency and menu cursor using IProvideCursor
This commit is contained in:
parent
52538dc708
commit
ed6817ae6a
@ -8,8 +8,10 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Utility.SampleComponents;
|
||||
using osuTK.Input;
|
||||
@ -17,7 +19,7 @@ using osuTK.Input;
|
||||
namespace osu.Game.Screens.Utility
|
||||
{
|
||||
[Cached]
|
||||
public class LatencyArea : CompositeDrawable
|
||||
public class LatencyArea : CompositeDrawable, IProvideCursor
|
||||
{
|
||||
[Resolved]
|
||||
private OverlayColourProvider overlayColourProvider { get; set; } = null!;
|
||||
@ -36,6 +38,10 @@ namespace osu.Game.Screens.Utility
|
||||
|
||||
public readonly Bindable<LatencyVisualMode> VisualMode = new Bindable<LatencyVisualMode>();
|
||||
|
||||
public CursorContainer? Cursor { get; private set; }
|
||||
|
||||
public bool ProvidingUserCursor => IsActiveArea.Value;
|
||||
|
||||
public LatencyArea(Key key, int? targetFrameRate)
|
||||
{
|
||||
this.key = key;
|
||||
@ -87,7 +93,7 @@ namespace osu.Game.Screens.Utility
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new LatencyCursorContainer
|
||||
Cursor = new LatencyCursorContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
@ -101,7 +107,7 @@ namespace osu.Game.Screens.Utility
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new LatencyCursorContainer
|
||||
Cursor = new LatencyCursorContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
@ -115,7 +121,7 @@ namespace osu.Game.Screens.Utility
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
new LatencyCursorContainer
|
||||
Cursor = new LatencyCursorContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
|
@ -41,8 +41,6 @@ namespace osu.Game.Screens.Utility
|
||||
|
||||
public override bool HideOverlaysOnEnter => true;
|
||||
|
||||
public override bool CursorVisible => mainArea.Count == 0;
|
||||
|
||||
public override float BackgroundParallaxAmount => 0;
|
||||
|
||||
private readonly LinkFlowContainer explanatoryText;
|
||||
|
Loading…
Reference in New Issue
Block a user