mirror of
https://github.com/ppy/osu
synced 2024-12-28 18:02:53 +00:00
Update ModAutoplay
matching to use new UserPlayable
flag instead
This commit is contained in:
parent
d0e9f8ef90
commit
b754c52392
@ -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()
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user