1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-24 19:17:20 +08:00

Fix player settings overlay appearing while in skin editor

This commit is contained in:
Dean Herbert 2024-12-13 17:18:00 +09:00
parent b470e30cc0
commit 1e809c7f16
No known key found for this signature in database

View File

@ -86,11 +86,31 @@ namespace osu.Game.Screens.Play.HUD
inputManager = GetContainingInputManager()!;
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
screenSpacePos.X > button.ScreenSpaceDrawQuad.TopLeft.X;
protected override bool OnMouseMove(MouseMoveEvent e)
{
checkExpanded();
return base.OnMouseMove(e);
}
protected override void Update()
{
base.Update();
Expanded.Value = inputManager.CurrentState.Mouse.Position.X >= button.ScreenSpaceDrawQuad.TopLeft.X;
// Only check expanded if already expanded.
// This is because if we are always checking, it would bypass blocking overlays.
// Case in point: the skin editor overlay blocks input from reaching the player, but checking raw coordinates would make settings pop out.
if (Expanded.Value)
checkExpanded();
}
private void checkExpanded()
{
float screenMouseX = inputManager.CurrentState.Mouse.Position.X;
Expanded.Value = screenMouseX >= button.ScreenSpaceDrawQuad.TopLeft.X && screenMouseX <= ToScreenSpace(new Vector2(DrawWidth + EXPANDED_WIDTH, 0)).X;
}
protected override void OnHoverLost(HoverLostEvent e)