mirror of https://github.com/ppy/osu
Revert incorrect removal of `exitConfirmed` flag
Removing it meant that it was _literally impossible_ to exit multiplayer.
This commit is contained in:
parent
3dd18c777a
commit
9aa7c7f591
|
@ -247,13 +247,15 @@ protected override void UpdateMods()
|
|||
[Resolved(canBeNull: true)]
|
||||
private IDialogOverlay dialogOverlay { get; set; }
|
||||
|
||||
private bool exitConfirmed;
|
||||
|
||||
public override bool OnExiting(ScreenExitEvent e)
|
||||
{
|
||||
// room has not been created yet or we're offline; exit immediately.
|
||||
if (client.Room == null || !IsConnected)
|
||||
return base.OnExiting(e);
|
||||
|
||||
if (dialogOverlay != null)
|
||||
if (!exitConfirmed && dialogOverlay != null)
|
||||
{
|
||||
if (dialogOverlay.CurrentDialog is ConfirmDialog confirmDialog)
|
||||
confirmDialog.PerformOkAction();
|
||||
|
@ -261,6 +263,7 @@ public override bool OnExiting(ScreenExitEvent e)
|
|||
{
|
||||
dialogOverlay.Push(new ConfirmDialog("Are you sure you want to leave this multiplayer match?", () =>
|
||||
{
|
||||
exitConfirmed = true;
|
||||
if (this.IsCurrentScreen())
|
||||
this.Exit();
|
||||
}));
|
||||
|
|
Loading…
Reference in New Issue