mirror of
https://github.com/ppy/osu
synced 2024-12-16 11:56:31 +00:00
Merge pull request #11827 from peppy/perform-from-screen-subclass-support
Allow beatmap imports from any derived version of SongSelect, rather than only PlaySongSelect
This commit is contained in:
commit
a6d163619a
@ -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>
|
||||
|
@ -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 => t.IsAssignableFrom(type)) && !beatmap.Disabled)
|
||||
{
|
||||
finalAction(current);
|
||||
Cancel();
|
||||
@ -91,13 +93,14 @@ namespace osu.Game
|
||||
|
||||
while (current != null)
|
||||
{
|
||||
if (validScreens.Contains(current.GetType()))
|
||||
if (validScreens.Any(t => t.IsAssignableFrom(type)))
|
||||
{
|
||||
current.MakeCurrent();
|
||||
break;
|
||||
}
|
||||
|
||||
current = current.GetParentScreen();
|
||||
type = current?.GetType();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user