2019-01-24 17:43:03 +09: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 18:19:50 +09:00
|
|
|
|
|
2020-12-13 19:59:07 +01:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Bindables;
|
2017-03-21 20:39:18 +09:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-09-10 13:29:50 +09:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2017-08-08 16:01:18 +09:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2022-11-07 14:18:43 +09:00
|
|
|
|
using osu.Game.Rulesets.Taiko.Skinning.Default;
|
2020-04-23 14:32:48 +09:00
|
|
|
|
using osu.Game.Skinning;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-04-18 16:05:58 +09:00
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
2017-03-21 20:39:18 +09:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A line that scrolls alongside hit objects in the playfield and visualises control points.
|
|
|
|
|
/// </summary>
|
2019-09-10 13:29:50 +09:00
|
|
|
|
public partial class DrawableBarLine : DrawableHitObject<HitObject>
|
2017-03-21 20:39:18 +09:00
|
|
|
|
{
|
2020-12-13 19:59:07 +01:00
|
|
|
|
public new BarLine HitObject => (BarLine)base.HitObject;
|
|
|
|
|
|
2017-04-03 10:04:13 +09:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The width of the line tracker.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private const float tracker_width = 2f;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-11-07 14:18:43 +09:00
|
|
|
|
public readonly Bindable<bool> Major = new Bindable<bool>();
|
2020-12-13 19:59:07 +01:00
|
|
|
|
|
|
|
|
|
public DrawableBarLine()
|
|
|
|
|
: this(null)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-07 14:18:43 +09:00
|
|
|
|
public DrawableBarLine(BarLine? barLine)
|
|
|
|
|
: base(barLine!)
|
2017-03-21 20:39:18 +09:00
|
|
|
|
{
|
2020-12-13 19:59:07 +01:00
|
|
|
|
}
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2020-12-13 19:59:07 +01:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2017-08-09 10:54:00 +09:00
|
|
|
|
Anchor = Anchor.CentreLeft;
|
|
|
|
|
Origin = Anchor.Centre;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-03-21 20:39:18 +09:00
|
|
|
|
RelativeSizeAxes = Axes.Y;
|
2017-04-03 10:04:13 +09:00
|
|
|
|
Width = tracker_width;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2022-11-11 15:47:06 +09:00
|
|
|
|
AddInternal(new SkinnableDrawable(new TaikoSkinComponentLookup(TaikoSkinComponents.BarLine), _ => new DefaultBarLine())
|
2017-03-21 20:39:18 +09:00
|
|
|
|
{
|
2022-11-07 14:18:43 +09:00
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2019-03-25 13:47:28 +09:00
|
|
|
|
});
|
2017-03-21 20:39:18 +09:00
|
|
|
|
}
|
2020-02-23 13:50:05 +09:00
|
|
|
|
|
2020-12-13 19:59:07 +01:00
|
|
|
|
protected override void OnApply()
|
|
|
|
|
{
|
|
|
|
|
base.OnApply();
|
2022-11-07 14:18:43 +09:00
|
|
|
|
Major.BindTo(HitObject.MajorBindable);
|
2020-12-13 19:59:07 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFree()
|
|
|
|
|
{
|
|
|
|
|
base.OnFree();
|
2022-11-07 14:18:43 +09:00
|
|
|
|
Major.UnbindFrom(HitObject.MajorBindable);
|
2020-12-13 19:59:07 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateHitStateTransforms(ArmedState state)
|
|
|
|
|
{
|
|
|
|
|
using (BeginAbsoluteSequence(HitObject.StartTime))
|
|
|
|
|
this.FadeOutFromOne(150).Expire();
|
|
|
|
|
}
|
2017-03-21 20:39:18 +09:00
|
|
|
|
}
|
2017-08-21 15:35:16 +09:00
|
|
|
|
}
|