1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:20:04 +08:00

Allow beatmap imports from any derived version of SongSelect, rather than only PlaySongSelect

This commit is contained in:
Dean Herbert 2021-02-18 19:19:28 +09:00
parent 46b67dd7bc
commit d85a4a22e5
2 changed files with 6 additions and 3 deletions

View File

@ -383,7 +383,7 @@ namespace osu.Game
Ruleset.Value = selection.Ruleset; Ruleset.Value = selection.Ruleset;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection); Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection);
}, validScreens: new[] { typeof(PlaySongSelect) }); }, validScreens: new[] { typeof(SongSelect) });
} }
/// <summary> /// <summary>

View File

@ -82,7 +82,9 @@ namespace osu.Game
game?.CloseAllOverlays(false); game?.CloseAllOverlays(false);
// we may already be at the target screen type. // we may already be at the target screen type.
if (validScreens.Contains(current.GetType()) && !beatmap.Disabled) var type = current.GetType();
if (validScreens.Any(t => type.IsAssignableFrom(t)) && !beatmap.Disabled)
{ {
finalAction(current); finalAction(current);
Cancel(); Cancel();
@ -91,13 +93,14 @@ namespace osu.Game
while (current != null) while (current != null)
{ {
if (validScreens.Contains(current.GetType())) if (validScreens.Any(t => type.IsAssignableFrom(t)))
{ {
current.MakeCurrent(); current.MakeCurrent();
break; break;
} }
current = current.GetParentScreen(); current = current.GetParentScreen();
type = current?.GetType();
} }
} }