1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:47:28 +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;
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection);
}, validScreens: new[] { typeof(PlaySongSelect) });
}, validScreens: new[] { typeof(SongSelect) });
}
/// <summary>

View File

@ -82,7 +82,9 @@ namespace osu.Game
game?.CloseAllOverlays(false);
// 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);
Cancel();
@ -91,13 +93,14 @@ namespace osu.Game
while (current != null)
{
if (validScreens.Contains(current.GetType()))
if (validScreens.Any(t => type.IsAssignableFrom(t)))
{
current.MakeCurrent();
break;
}
current = current.GetParentScreen();
type = current?.GetType();
}
}