diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index 973fcffba8..302cdf69c0 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -24,7 +24,7 @@ public abstract class ModAutoplay : Mod, ICreateReplayData public sealed override bool ValidForMultiplayer => false; public sealed override bool ValidForMultiplayerAsFreeMod => false; - public override Type[] IncompatibleMods => new[] { typeof(ModCinema), typeof(ModRelax), typeof(ModAdaptiveSpeed) }; + public override Type[] IncompatibleMods => new[] { typeof(ModCinema), typeof(ModRelax), typeof(ModAdaptiveSpeed), typeof(ModTouchDevice) }; public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0; diff --git a/osu.Game/Rulesets/Mods/ModTouchDevice.cs b/osu.Game/Rulesets/Mods/ModTouchDevice.cs index f532e7b19d..c29ff28f1a 100644 --- a/osu.Game/Rulesets/Mods/ModTouchDevice.cs +++ b/osu.Game/Rulesets/Mods/ModTouchDevice.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Localisation; namespace osu.Game.Rulesets.Mods @@ -13,5 +14,6 @@ public class ModTouchDevice : Mod, IApplicableMod public sealed override double ScoreMultiplier => 1; public sealed override ModType Type => ModType.System; public sealed override bool AlwaysValidForSubmission => true; + public sealed override Type[] IncompatibleMods => new[] { typeof(ICreateReplayData) }; } } diff --git a/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs b/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs index 5c27e59c5b..973dc12e12 100644 --- a/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs +++ b/osu.Game/Screens/Select/SongSelectTouchInputHandler.cs @@ -9,6 +9,7 @@ using osu.Game.Configuration; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; +using osu.Game.Utils; namespace osu.Game.Screens.Select { @@ -52,7 +53,15 @@ private void updateState() bool touchDeviceModEnabled = mods.Value.Any(mod => mod is ModTouchDevice); if (touchActive.Value && !touchDeviceModEnabled) - mods.Value = mods.Value.Append(touchDeviceMod).ToArray(); + { + var candidateMods = mods.Value.Append(touchDeviceMod).ToArray(); + + if (!ModUtils.CheckCompatibleSet(candidateMods, out _)) + return; + + mods.Value = candidateMods; + } + if (!touchActive.Value && touchDeviceModEnabled) mods.Value = mods.Value.Where(mod => mod is not ModTouchDevice).ToArray(); }