mirror of
https://github.com/ppy/osu
synced 2025-03-22 02:47:04 +00:00
Merge pull request #4457 from peppy/fix-hold-to-quit
Fix HoldForMenuButton getting stuck in a confirming state
This commit is contained in:
commit
246b214fa6
@ -92,30 +92,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
public Action HoverGained;
|
public Action HoverGained;
|
||||||
public Action HoverLost;
|
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]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
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.
|
// avoid starting a new confirm call until we finish animating.
|
||||||
pendingAnimation = true;
|
pendingAnimation = true;
|
||||||
|
|
||||||
Progress.Value = 0;
|
AbortConfirm();
|
||||||
|
|
||||||
overlayCircle.ScaleTo(0, 100)
|
overlayCircle.ScaleTo(0, 100)
|
||||||
.Then().FadeOut().ScaleTo(1).FadeIn(500)
|
.Then().FadeOut().ScaleTo(1).FadeIn(500)
|
||||||
@ -207,6 +183,31 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
base.OnHoverLost(e);
|
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)
|
protected override bool OnMouseDown(MouseDownEvent e)
|
||||||
{
|
{
|
||||||
if (!pendingAnimation && e.CurrentState.Mouse.Buttons.Count() == 1)
|
if (!pendingAnimation && e.CurrentState.Mouse.Buttons.Count() == 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user