2019-01-24 16:43:03 +08:00
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2022-03-29 22:25:05 +08:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2019-03-27 18:29:27 +08:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-08-11 03:54:48 +08:00
|
|
|
using osu.Framework.Localisation;
|
2017-04-21 16:33:20 +08:00
|
|
|
using osu.Game.Graphics;
|
2019-11-24 01:32:16 +08:00
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
using osu.Game.Screens.Play;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2017-04-21 16:33:20 +08:00
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2019-11-24 01:32:16 +08:00
|
|
|
public abstract class ModCinema<T> : ModCinema, IApplicableToDrawableRuleset<T>
|
|
|
|
where T : HitObject
|
|
|
|
{
|
|
|
|
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
|
|
|
{
|
2019-12-12 14:16:34 +08:00
|
|
|
// AlwaysPresent required for hitsounds
|
2021-12-15 12:23:11 +08:00
|
|
|
drawableRuleset.AlwaysPresent = true;
|
|
|
|
drawableRuleset.Hide();
|
2019-11-24 01:32:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-23 20:12:47 +08:00
|
|
|
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer, IApplicableFailOverride
|
2017-04-21 16:33:20 +08:00
|
|
|
{
|
|
|
|
public override string Name => "Cinema";
|
2018-11-30 16:16:00 +08:00
|
|
|
public override string Acronym => "CN";
|
2020-01-14 21:22:00 +08:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModCinema;
|
2022-08-11 03:54:48 +08:00
|
|
|
public override LocalisableString Description => "Watch the video without visual distractions.";
|
2019-11-24 01:32:16 +08:00
|
|
|
|
2023-12-23 22:10:31 +08:00
|
|
|
public override Type[] IncompatibleMods => base.IncompatibleMods.Concat(new[] { typeof(ModAutoplay), typeof(ModNoFail) }).ToArray();
|
2022-03-29 22:25:05 +08:00
|
|
|
|
2019-11-24 01:32:16 +08:00
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
2019-12-12 14:09:55 +08:00
|
|
|
overlay.ShowHud.Value = false;
|
|
|
|
overlay.ShowHud.Disabled = true;
|
2019-11-24 01:32:16 +08:00
|
|
|
}
|
2019-11-24 15:37:06 +08:00
|
|
|
|
2019-11-25 15:24:29 +08:00
|
|
|
public void ApplyToPlayer(Player player)
|
|
|
|
{
|
2021-04-13 14:24:35 +08:00
|
|
|
player.ApplyToBackground(b => b.IgnoreUserSettings.Value = true);
|
2019-11-25 15:24:29 +08:00
|
|
|
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
|
2019-12-12 14:14:59 +08:00
|
|
|
|
|
|
|
player.BreakOverlay.Hide();
|
2019-11-25 15:24:29 +08:00
|
|
|
}
|
2023-12-23 20:12:47 +08:00
|
|
|
|
|
|
|
public bool PerformFail() => false;
|
|
|
|
|
|
|
|
public bool RestartOnFail => false;
|
2017-04-21 16:33:20 +08:00
|
|
|
}
|
2018-01-05 19:21:19 +08:00
|
|
|
}
|