Add safety against pushing to non-current screen

This commit is contained in:
Dean Herbert 2021-08-05 14:00:16 +09:00
parent c84bd2c74d
commit fd54487186
2 changed files with 10 additions and 2 deletions

View File

@ -49,7 +49,11 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match
RelativeSizeAxes = Axes.X,
Height = 40,
Text = "Select beatmap",
Action = () => matchSubScreen.Push(new MultiplayerMatchSongSelect()),
Action = () =>
{
if (matchSubScreen.IsCurrentScreen())
matchSubScreen.Push(new MultiplayerMatchSongSelect());
},
Alpha = 0
}
}

View File

@ -230,7 +230,11 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
settingsOverlay = new PlaylistsMatchSettingsOverlay
{
RelativeSizeAxes = Axes.Both,
EditPlaylist = () => this.Push(new PlaylistsSongSelect()),
EditPlaylist = () =>
{
if (this.IsCurrentScreen())
this.Push(new PlaylistsSongSelect());
},
State = { Value = roomId.Value == null ? Visibility.Visible : Visibility.Hidden }
}
});