mirror of
https://github.com/ppy/osu
synced 2024-12-29 10:22:43 +00:00
Apply proposed naming changes
This commit is contained in:
parent
e9ecf26b6a
commit
20e277d2e5
@ -63,7 +63,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
return;
|
||||
|
||||
modsContainer.Add(new ModButton(new ModNoMod()));
|
||||
modsContainer.AddRange(rulesetInstance.AllMods.Where(m => m.IsPlayable(ModUsage.User)).Select(m => new ModButton(m)));
|
||||
modsContainer.AddRange(rulesetInstance.AllMods.Where(m => m.IsPlayable(ModUsage.SoloLocal)).Select(m => new ModButton(m)));
|
||||
|
||||
modsContainer.ForEach(button =>
|
||||
{
|
||||
|
@ -39,8 +39,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// <remarks>
|
||||
/// <list type="bullet">
|
||||
/// <item>Should be always <c>false</c> for cases where the user is not interacting with the game.</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerRoomWide"/> for mods that make gameplay duration dependent on user input (e.g. <see cref="ModAdaptiveSpeed"/>).</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerPerPlayer"/> for mods that affect the gameplay duration (e.g. <see cref="ModRateAdjust"/> and <see cref="ModTimeRamp"/>).</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerGlobal"/> for mods that make gameplay duration dependent on user input (e.g. <see cref="ModAdaptiveSpeed"/>).</item>
|
||||
/// <item>Should be <c>false</c> in <see cref="ModUsage.MultiplayerLocal"/> for mods that affect the gameplay duration (e.g. <see cref="ModRateAdjust"/> and <see cref="ModTimeRamp"/>).</item>
|
||||
/// </list>
|
||||
/// </remarks>
|
||||
/// <param name="usage">The mod usage.</param>
|
||||
|
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public override double ScoreMultiplier => 1;
|
||||
|
||||
public override bool IsPlayable(ModUsage usage) => usage == ModUsage.User;
|
||||
public override bool IsPlayable(ModUsage usage) => usage == ModUsage.SoloLocal;
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModTimeRamp) };
|
||||
|
||||
|
@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public abstract class ModRateAdjust : Mod, IApplicableToRate
|
||||
{
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerPerPlayer;
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerLocal;
|
||||
|
||||
public abstract BindableNumber<double> SpeedChange { get; }
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
|
||||
public abstract BindableBool AdjustPitch { get; }
|
||||
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerPerPlayer;
|
||||
public override bool IsPlayable(ModUsage usage) => usage != ModUsage.MultiplayerLocal;
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust), typeof(ModAdaptiveSpeed) };
|
||||
|
||||
|
@ -11,17 +11,17 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// <summary>
|
||||
/// This mod can be used for a per-user gameplay session.
|
||||
/// </summary>
|
||||
User,
|
||||
SoloLocal,
|
||||
|
||||
/// <summary>
|
||||
/// This mod can be used in multiplayer but must be applied to all users.
|
||||
/// This is generally the case for mods which affect the length of gameplay.
|
||||
/// </summary>
|
||||
MultiplayerRoomWide,
|
||||
MultiplayerGlobal,
|
||||
|
||||
/// <summary>
|
||||
/// This mod can be used in multiplayer either at a room or per-player level (i.e. "free mod").
|
||||
/// </summary>
|
||||
MultiplayerPerPlayer,
|
||||
MultiplayerLocal,
|
||||
}
|
||||
}
|
||||
|
@ -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.IsPlayable(ModUsage.User) && value(m);
|
||||
set => base.IsValidMod = m => m.HasImplementation && m.IsPlayable(ModUsage.SoloLocal) && value(m);
|
||||
}
|
||||
|
||||
public FreeModSelectOverlay()
|
||||
|
@ -95,8 +95,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
|
||||
protected override BeatmapDetailArea CreateBeatmapDetailArea() => new PlayBeatmapDetailArea();
|
||||
|
||||
protected override bool IsValidMod(Mod mod) => base.IsValidMod(mod) && mod.IsPlayable(ModUsage.MultiplayerRoomWide);
|
||||
protected override bool IsValidMod(Mod mod) => base.IsValidMod(mod) && mod.IsPlayable(ModUsage.MultiplayerGlobal);
|
||||
|
||||
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && mod.IsPlayable(ModUsage.MultiplayerPerPlayer);
|
||||
protected override bool IsValidFreeMod(Mod mod) => base.IsValidFreeMod(mod) && mod.IsPlayable(ModUsage.MultiplayerLocal);
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +170,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).All(m => m.IsPlayable(ModUsage.User));
|
||||
protected virtual bool IsValidMod(Mod mod) => mod.HasImplementation && ModUtils.FlattenMod(mod).All(m => m.IsPlayable(ModUsage.SoloLocal));
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether a given <see cref="Mod"/> is valid for per-player free-mod selection.
|
||||
|
@ -188,7 +188,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
if (score.NewValue == null)
|
||||
return;
|
||||
|
||||
if (score.NewValue.Mods.Any(m => !m.IsPlayable(ModUsage.User)))
|
||||
if (score.NewValue.Mods.Any(m => !m.IsPlayable(ModUsage.SoloLocal)))
|
||||
return;
|
||||
|
||||
var hitEvents = score.NewValue.HitEvents;
|
||||
|
@ -48,7 +48,7 @@ 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.IsPlayable(ModUsage.User)))
|
||||
if (Mods.Value.Any(m => !m.IsPlayable(ModUsage.SoloLocal)))
|
||||
{
|
||||
handleTokenFailure(new InvalidOperationException("Non-user playable mod selected."));
|
||||
return false;
|
||||
|
@ -146,7 +146,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.All(m => m.IsPlayable(ModUsage.User));
|
||||
bool shouldFlair = player != null && Score.Mods.All(m => m.IsPlayable(ModUsage.SoloLocal));
|
||||
|
||||
ScorePanelList.AddScore(Score, shouldFlair);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ namespace osu.Game.Utils
|
||||
/// <param name="invalidMods">Invalid mods, if any were found. Will be null if all mods were valid.</param>
|
||||
/// <returns>Whether the input mods were all valid. If false, <paramref name="invalidMods"/> will contain all invalid entries.</returns>
|
||||
public static bool CheckValidRequiredModsForMultiplayer(IEnumerable<Mod> mods, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerRoomWide), out invalidMods);
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerGlobal), out invalidMods);
|
||||
|
||||
/// <summary>
|
||||
/// Checks that all <see cref="Mod"/>s in a combination are valid as "free mods" in a multiplayer match session.
|
||||
@ -130,7 +130,7 @@ namespace osu.Game.Utils
|
||||
/// <param name="invalidMods">Invalid mods, if any were found. Will be null if all mods were valid.</param>
|
||||
/// <returns>Whether the input mods were all valid. If false, <paramref name="invalidMods"/> will contain all invalid entries.</returns>
|
||||
public static bool CheckValidFreeModsForMultiplayer(IEnumerable<Mod> mods, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerPerPlayer), out invalidMods);
|
||||
=> checkValid(mods, m => m.IsPlayable(ModUsage.MultiplayerLocal), out invalidMods);
|
||||
|
||||
private static bool checkValid(IEnumerable<Mod> mods, Predicate<Mod> valid, [NotNullWhen(false)] out List<Mod>? invalidMods)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user