1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Allow PlayerLoader to proceed even if the mouse is hovering an overlay panel

This commit is contained in:
Dean Herbert 2019-07-05 15:32:07 +09:00
parent 655e96b2c1
commit b902457f8d

View File

@ -18,6 +18,7 @@ using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Menu;
using osu.Game.Screens.Play.HUD;
@ -53,6 +54,8 @@ namespace osu.Game.Screens.Play
private InputManager inputManager;
private IdleTracker idleTracker;
public PlayerLoader(Func<Player> createPlayer)
{
this.createPlayer = createPlayer;
@ -93,7 +96,8 @@ namespace osu.Game.Screens.Play
VisualSettings = new VisualSettings(),
new InputSettings()
}
}
},
idleTracker = new IdleTracker(750)
});
loadNewPlayer();
@ -193,7 +197,7 @@ namespace osu.Game.Screens.Play
// Here because IsHovered will not update unless we do so.
public override bool HandlePositionalInput => true;
private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && GetContainingInputManager()?.DraggedDrawable == null;
private bool readyForPush => player.LoadState == LoadState.Ready && (IsHovered || idleTracker.IsIdle.Value) && inputManager?.DraggedDrawable == null;
private void pushWhenLoaded()
{