2016-11-17 12:29:35 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Modes.Objects.Drawables;
|
|
|
|
|
using osu.Game.Modes.Osu.Objects.Drawables.Pieces;
|
|
|
|
|
using OpenTK;
|
2016-11-27 14:36:31 +00:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2016-11-17 08:20:51 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Modes.Osu.Objects.Drawables
|
|
|
|
|
{
|
2016-11-26 07:51:51 +00:00
|
|
|
|
class DrawableSlider : DrawableOsuHitObject
|
2016-11-17 08:20:51 +00:00
|
|
|
|
{
|
|
|
|
|
public DrawableSlider(Slider h) : base(h)
|
|
|
|
|
{
|
2016-11-17 12:29:35 +00:00
|
|
|
|
Origin = Anchor.Centre;
|
2016-11-27 14:36:31 +00:00
|
|
|
|
Position = new Vector2(h.Position.X, h.Position.Y);
|
|
|
|
|
|
|
|
|
|
Path sliderPath;
|
|
|
|
|
Add(sliderPath = new Path());
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < h.Curve.Path.Count; ++i)
|
|
|
|
|
sliderPath.Positions.Add(h.Curve.Path[i] - h.Position);
|
|
|
|
|
|
|
|
|
|
h.Position = Vector2.Zero;
|
|
|
|
|
Add(new DrawableHitCircle(h));
|
2016-11-17 12:29:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
//force application of the state that was set before we loaded.
|
|
|
|
|
UpdateState(State);
|
2016-11-17 08:20:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void UpdateState(ArmedState state)
|
|
|
|
|
{
|
2016-11-17 12:29:35 +00:00
|
|
|
|
if (!IsLoaded) return;
|
|
|
|
|
|
|
|
|
|
Flush(true); //move to DrawableHitObject
|
|
|
|
|
|
|
|
|
|
Alpha = 0;
|
|
|
|
|
|
2016-11-27 14:36:31 +00:00
|
|
|
|
Delay(HitObject.StartTime - 450 - Time.Current, true);
|
2016-11-17 08:20:51 +00:00
|
|
|
|
|
2016-11-17 12:29:35 +00:00
|
|
|
|
FadeIn(200);
|
2016-11-27 14:36:31 +00:00
|
|
|
|
Delay(450 + HitObject.Duration);
|
2016-11-17 12:29:35 +00:00
|
|
|
|
FadeOut(200);
|
2016-11-17 08:20:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|