From 9aa7c7f59197b9754e98e1ba5ce5e4730f4d5f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 22 Jan 2024 15:35:03 +0100 Subject: [PATCH] Revert incorrect removal of `exitConfirmed` flag Removing it meant that it was _literally impossible_ to exit multiplayer. --- .../OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs index aab7ac3280..a37314de0e 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs @@ -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(); }));