2021-02-24 12:39:15 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-02-24 12:39:15 +08:00
|
|
|
using System;
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2021-05-15 11:51:39 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2021-02-24 12:39:15 +08: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 14:05:12 +08:00
|
|
|
protected abstract CoverExpandDirection ExpandDirection { get; }
|
2021-02-24 12:39:15 +08: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;
|
|
|
|
|
|
|
|
hocParent.Remove(hoc);
|
|
|
|
hocParent.Add(new PlayfieldCoveringWrapper(hoc).With(c =>
|
|
|
|
{
|
|
|
|
c.RelativeSizeAxes = Axes.Both;
|
|
|
|
c.Direction = ExpandDirection;
|
|
|
|
c.Coverage = 0.5f;
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
2021-05-15 11:51:39 +08:00
|
|
|
|
|
|
|
protected override void ApplyIncreasedVisibilityState(DrawableHitObject hitObject, ArmedState state)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void ApplyNormalVisibilityState(DrawableHitObject hitObject, ArmedState state)
|
|
|
|
{
|
|
|
|
}
|
2021-02-24 12:39:15 +08:00
|
|
|
}
|
|
|
|
}
|