mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add juicy streams
This commit is contained in:
@ -0,0 +1,59 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
{
|
||||
public class DrawableJuiceStream : DrawableCatchHitObject<JuiceStream>
|
||||
{
|
||||
private readonly Container dropletContainer;
|
||||
|
||||
public DrawableJuiceStream(JuiceStream s) : base(s)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Height = (float)HitObject.Duration;
|
||||
|
||||
Child = dropletContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
RelativeChildOffset = new Vector2(0, (float)HitObject.StartTime),
|
||||
RelativeChildSize = new Vector2(1, (float)HitObject.Duration)
|
||||
};
|
||||
|
||||
var start = new DrawableFruit(new Fruit
|
||||
{
|
||||
ComboColour = Color4.Blue,
|
||||
StartTime = s.StartTime,
|
||||
X = s.X,
|
||||
});
|
||||
|
||||
AddNested(start);
|
||||
|
||||
var end = new DrawableFruit(new Fruit
|
||||
{
|
||||
ComboColour = Color4.Red,
|
||||
StartTime = s.EndTime,
|
||||
X = s.EndX,
|
||||
});
|
||||
|
||||
AddNested(end);
|
||||
|
||||
foreach (var tick in s.Ticks)
|
||||
{
|
||||
var droplet = new DrawableDroplet(tick);
|
||||
AddNested(droplet);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void AddNested(DrawableHitObject<CatchBaseHit> h)
|
||||
{
|
||||
dropletContainer.Add(h);
|
||||
base.AddNested(h);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user