Update ModAutoplay matching to use new UserPlayable flag instead

This commit is contained in:
Dean Herbert 2021-06-09 14:32:48 +09:00
parent d0e9f8ef90
commit b754c52392
4 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.OnlinePlay
public new Func<Mod, bool> IsValidMod
{
get => base.IsValidMod;
set => base.IsValidMod = m => m.HasImplementation && !(m is ModAutoplay) && value(m);
set => base.IsValidMod = m => m.HasImplementation && m.UserPlayable && value(m);
}
public FreeModSelectOverlay()

View File

@ -161,7 +161,7 @@ namespace osu.Game.Screens.OnlinePlay
/// </summary>
/// <param name="mod">The <see cref="Mod"/> to check.</param>
/// <returns>Whether <paramref name="mod"/> is a valid mod for online play.</returns>
protected virtual bool IsValidMod(Mod mod) => mod.HasImplementation && !ModUtils.FlattenMod(mod).Any(m => m is ModAutoplay);
protected virtual bool IsValidMod(Mod mod) => mod.HasImplementation && ModUtils.FlattenMod(mod).All(m => m.UserPlayable);
/// <summary>
/// Checks whether a given <see cref="Mod"/> is valid for per-player free-mod selection.

View File

@ -44,9 +44,9 @@ namespace osu.Game.Screens.Play
// Token request construction should happen post-load to allow derived classes to potentially prepare DI backings that are used to create the request.
var tcs = new TaskCompletionSource<bool>();
if (Mods.Value.Any(m => m is ModAutoplay))
if (Mods.Value.Any(m => !m.UserPlayable))
{
handleTokenFailure(new InvalidOperationException("Autoplay loaded."));
handleTokenFailure(new InvalidOperationException("Non-user playable mod selected."));
return false;
}

View File

@ -153,7 +153,7 @@ namespace osu.Game.Screens.Ranking
if (Score != null)
{
// only show flair / animation when arriving after watching a play that isn't autoplay.
bool shouldFlair = player != null && !Score.Mods.Any(m => m is ModAutoplay);
bool shouldFlair = player != null && Score.Mods.All(m => m.UserPlayable);
ScorePanelList.AddScore(Score, shouldFlair);