2021-02-24 04:39:15 +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.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Linq;
|
2023-01-09 07:49:36 +00:00
|
|
|
using osu.Framework.Bindables;
|
2021-02-24 04:39:15 +00:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2023-01-11 19:13:29 +00:00
|
|
|
using osu.Game.Configuration;
|
2021-02-24 04:39:15 +00:00
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2021-05-15 03:51:39 +00:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2021-02-24 04:39:15 +00:00
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Mods
|
|
|
|
{
|
|
|
|
public abstract class ManiaModPlayfieldCover : ModHidden, IApplicableToDrawableRuleset<ManiaHitObject>
|
|
|
|
{
|
|
|
|
public override Type[] IncompatibleMods => new[] { typeof(ModFlashlight<ManiaHitObject>) };
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// The direction in which the cover should expand.
|
|
|
|
/// </summary>
|
2021-02-24 06:05:12 +00:00
|
|
|
protected abstract CoverExpandDirection ExpandDirection { get; }
|
2021-02-24 04:39:15 +00:00
|
|
|
|
2023-01-11 19:13:29 +00:00
|
|
|
[SettingSource("Coverage", "The proportion of playfield height that notes will be hidden for.")]
|
2023-01-09 07:49:36 +00:00
|
|
|
public abstract BindableNumber<float> Coverage { get; }
|
2022-12-19 23:31:28 +00:00
|
|
|
|
2021-02-24 04:39:15 +00:00
|
|
|
public virtual void ApplyToDrawableRuleset(DrawableRuleset<ManiaHitObject> drawableRuleset)
|
|
|
|
{
|
|
|
|
ManiaPlayfield maniaPlayfield = (ManiaPlayfield)drawableRuleset.Playfield;
|
|
|
|
|
|
|
|
foreach (Column column in maniaPlayfield.Stages.SelectMany(stage => stage.Columns))
|
|
|
|
{
|
|
|
|
HitObjectContainer hoc = column.HitObjectArea.HitObjectContainer;
|
|
|
|
Container hocParent = (Container)hoc.Parent;
|
|
|
|
|
2022-08-26 06:19:05 +00:00
|
|
|
hocParent.Remove(hoc, false);
|
2021-02-24 04:39:15 +00:00
|
|
|
hocParent.Add(new PlayfieldCoveringWrapper(hoc).With(c =>
|
|
|
|
{
|
|
|
|
c.RelativeSizeAxes = Axes.Both;
|
|
|
|
c.Direction = ExpandDirection;
|
2023-01-09 07:49:36 +00:00
|
|
|
c.Coverage = Coverage.Value;
|
2021-02-24 04:39:15 +00:00
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
2021-05-15 03:51:39 +00:00
|
|
|
|
|
|
|
protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state)
|
|
|
|
{
|
|
|
|
}
|
2021-02-24 04:39:15 +00:00
|
|
|
}
|
|
|
|
}
|