From c901a4fd7e5c25b816cf4fa2280b6c1c175046a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 19 Nov 2021 13:27:28 +0900 Subject: [PATCH] Show better error message when selecting an unavailable beatmap during multiplayer room creation --- .../Match/MultiplayerMatchSettingsOverlay.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs index 5bc76a10bc..90feea4e6e 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/MultiplayerMatchSettingsOverlay.cs @@ -365,7 +365,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match { Debug.Assert(applyingSettingsOperation != null); - ErrorText.Text = text; + // see https://github.com/ppy/osu-web/blob/2c97aaeb64fb4ed97c747d8383a35b30f57428c7/app/Models/Multiplayer/PlaylistItem.php#L48. + const string not_found_prefix = "beatmaps not found:"; + + if (text.StartsWith(not_found_prefix, StringComparison.Ordinal)) + { + ErrorText.Text = "The selected beatmap is not available online."; + SelectedItem.Value.MarkInvalid(); + } + else + { + ErrorText.Text = text; + } + ErrorText.FadeIn(50); applyingSettingsOperation.Dispose();