Mark "autoplay" and "cinema" mods as mutually exclusive

This commit is contained in:
Salman Ahmed 2022-03-29 17:25:05 +03:00
parent 30fae452a4
commit 8d4356f23b
2 changed files with 5 additions and 1 deletions

View File

@ -26,7 +26,7 @@ public abstract class ModAutoplay : Mod, IApplicableFailOverride, ICreateReplay
public override bool UserPlayable => false;
public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModFailCondition), typeof(ModNoFail) };
public override Type[] IncompatibleMods => new[] { typeof(ModCinema), typeof(ModRelax), typeof(ModFailCondition), typeof(ModNoFail) };
public override bool HasImplementation => GetType().GenericTypeArguments.Length == 0;

View File

@ -1,6 +1,8 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Linq;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Rulesets.Objects;
@ -27,6 +29,8 @@ public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
public override IconUsage? Icon => OsuIcon.ModCinema;
public override string Description => "Watch the video without visual distractions.";
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModAutoplay)).ToArray();
public void ApplyToHUD(HUDOverlay overlay)
{
overlay.ShowHud.Value = false;