1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 15:27:26 +08:00
osu-lazer/osu.Game/Rulesets/Mods/ModCinema.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

50 lines
1.6 KiB
C#
Raw Normal View History

// 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
using System;
using System.Linq;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Localisation;
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
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)
{
// AlwaysPresent required for hitsounds
drawableRuleset.AlwaysPresent = true;
drawableRuleset.Hide();
2019-11-24 01:32:16 +08:00
}
}
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
{
public override string Name => "Cinema";
public override string Acronym => "CN";
2020-01-14 21:22:00 +08:00
public override IconUsage? Icon => OsuIcon.ModCinema;
public override LocalisableString Description => "Watch the video without visual distractions.";
2019-11-24 01:32:16 +08:00
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModAutoplay)).ToArray();
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
}
public void ApplyToPlayer(Player player)
{
player.ApplyToBackground(b => b.IgnoreUserSettings.Value = true);
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
2019-12-12 14:14:59 +08:00
player.BreakOverlay.Hide();
}
}
2018-01-05 19:21:19 +08:00
}