mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
Fix HoldForMenuButton getting stuck in a confirming state
Closes #4446.
This commit is contained in:
parent
7805b95a1e
commit
38e75421ab
@ -92,30 +92,6 @@ namespace osu.Game.Screens.Play.HUD
|
||||
public Action HoverGained;
|
||||
public Action HoverLost;
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
BeginConfirm();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(GlobalAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
AbortConfirm();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
@ -178,7 +154,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
// avoid starting a new confirm call until we finish animating.
|
||||
pendingAnimation = true;
|
||||
|
||||
Progress.Value = 0;
|
||||
AbortConfirm();
|
||||
|
||||
overlayCircle.ScaleTo(0, 100)
|
||||
.Then().FadeOut().ScaleTo(1).FadeIn(500)
|
||||
@ -207,6 +183,32 @@ namespace osu.Game.Screens.Play.HUD
|
||||
base.OnHoverLost(e);
|
||||
}
|
||||
|
||||
public bool OnPressed(GlobalAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
if (!pendingAnimation)
|
||||
BeginConfirm();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool OnReleased(GlobalAction action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GlobalAction.Back:
|
||||
AbortConfirm();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
if (!pendingAnimation && e.CurrentState.Mouse.Buttons.Count() == 1)
|
||||
|
Loading…
Reference in New Issue
Block a user