1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 18:32:56 +08:00

Move confirm dialog logic to OnExiting

This commit is contained in:
Joseph Madamba 2021-06-21 20:22:18 -07:00
parent 00b4cf1829
commit 9bcd1e6922

View File

@ -305,6 +305,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
return true;
}
return base.OnBackButton();
}
public override bool OnExiting(IScreen next)
{
if (client.Room == null)
{
// room has not been created yet; exit immediately.
return base.OnExiting(next);
}
if (!exitConfirmed && dialogOverlay != null)
{
dialogOverlay.Push(new ConfirmDialog("Are you sure you want to leave this multiplayer match?", () =>
@ -316,7 +327,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
return true;
}
return base.OnBackButton();
return base.OnExiting(next);
}
private ModSettingChangeTracker modSettingChangeTracker;