mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Query for input manager once
This commit is contained in:
@ -8,6 +8,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
@ -44,6 +45,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private Task loadTask;
|
private Task loadTask;
|
||||||
|
|
||||||
|
private InputManager inputManager;
|
||||||
|
|
||||||
public PlayerLoader(Func<Player> createPlayer)
|
public PlayerLoader(Func<Player> createPlayer)
|
||||||
{
|
{
|
||||||
this.createPlayer = createPlayer;
|
this.createPlayer = createPlayer;
|
||||||
@ -203,6 +206,12 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
inputManager = GetContainingInputManager();
|
||||||
|
base.LoadComplete();
|
||||||
|
}
|
||||||
|
|
||||||
private void cancelLoad()
|
private void cancelLoad()
|
||||||
{
|
{
|
||||||
pushDebounce?.Cancel();
|
pushDebounce?.Cancel();
|
||||||
@ -244,7 +253,7 @@ namespace osu.Game.Screens.Play
|
|||||||
if (!this.IsCurrentScreen())
|
if (!this.IsCurrentScreen())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (GetContainingInputManager()?.HoveredDrawables.Contains(VisualSettings) == true)
|
if (inputManager.HoveredDrawables.Contains(VisualSettings))
|
||||||
{
|
{
|
||||||
// Acts as an "on hover" trigger for the visual settings panel.
|
// Acts as an "on hover" trigger for the visual settings panel.
|
||||||
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
||||||
|
Reference in New Issue
Block a user