2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
2019-03-27 10:29:27 +00:00
|
|
|
using osu.Framework.Graphics.Sprites;
|
2018-04-13 09:19:50 +00:00
|
|
|
using osu.Game.Graphics;
|
2019-11-23 17:32:16 +00:00
|
|
|
using osu.Game.Rulesets.Objects;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
using osu.Game.Screens.Play;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mods
|
|
|
|
{
|
2019-11-23 17:32:16 +00:00
|
|
|
public abstract class ModCinema<T> : ModCinema, IApplicableToDrawableRuleset<T>
|
|
|
|
where T : HitObject
|
|
|
|
{
|
|
|
|
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
|
|
|
{
|
2021-02-11 08:47:29 +00:00
|
|
|
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap, drawableRuleset.Mods));
|
2019-11-23 17:32:16 +00:00
|
|
|
|
2019-12-12 06:16:34 +00:00
|
|
|
// AlwaysPresent required for hitsounds
|
2019-11-23 17:32:16 +00:00
|
|
|
drawableRuleset.Playfield.AlwaysPresent = true;
|
|
|
|
drawableRuleset.Playfield.Hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-25 07:24:29 +00:00
|
|
|
public class ModCinema : ModAutoplay, IApplicableToHUD, IApplicableToPlayer
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
public override string Name => "Cinema";
|
2018-11-30 08:16:00 +00:00
|
|
|
public override string Acronym => "CN";
|
2020-01-14 13:22:00 +00:00
|
|
|
public override IconUsage? Icon => OsuIcon.ModCinema;
|
2018-04-13 09:19:50 +00:00
|
|
|
public override string Description => "Watch the video without visual distractions.";
|
2019-11-23 17:32:16 +00:00
|
|
|
|
|
|
|
public void ApplyToHUD(HUDOverlay overlay)
|
|
|
|
{
|
2019-12-12 06:09:55 +00:00
|
|
|
overlay.ShowHud.Value = false;
|
|
|
|
overlay.ShowHud.Disabled = true;
|
2019-11-23 17:32:16 +00:00
|
|
|
}
|
2019-11-24 07:37:06 +00:00
|
|
|
|
2019-11-25 07:24:29 +00:00
|
|
|
public void ApplyToPlayer(Player player)
|
|
|
|
{
|
2021-04-13 06:24:35 +00:00
|
|
|
player.ApplyToBackground(b => b.IgnoreUserSettings.Value = true);
|
2019-11-25 07:24:29 +00:00
|
|
|
player.DimmableStoryboard.IgnoreUserSettings.Value = true;
|
2019-12-12 06:14:59 +00:00
|
|
|
|
|
|
|
player.BreakOverlay.Hide();
|
2019-11-25 07:24:29 +00:00
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
}
|
|
|
|
}
|