mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Hide menu cursor when user is idle
This commit is contained in:
@ -49,7 +49,11 @@ namespace osu.Game.Graphics.Cursor
|
||||
[Resolved]
|
||||
private OsuUserInputManager inputManager { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private OsuGame? game { get; set; }
|
||||
|
||||
private readonly IBindable<bool> mouseInputSource = new BindableBool();
|
||||
private readonly IBindable<bool> isIdle = new BindableBool();
|
||||
|
||||
private readonly Bindable<Visibility> internalState = new Bindable<Visibility>();
|
||||
|
||||
@ -62,6 +66,11 @@ namespace osu.Game.Graphics.Cursor
|
||||
mouseInputSource.BindTo(inputManager.IsMouseInputSource);
|
||||
mouseInputSource.BindValueChanged(_ => updateInternalVisibility(), true);
|
||||
|
||||
if (game != null)
|
||||
{
|
||||
isIdle.BindTo(game.IsIdle);
|
||||
isIdle.BindValueChanged(_ => updateInternalVisibility());
|
||||
}
|
||||
}
|
||||
|
||||
private void updateInternalVisibility()
|
||||
|
Reference in New Issue
Block a user