1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Make juice streams interactive (and correctly positioned)

This commit is contained in:
Dean Herbert 2017-10-11 18:18:06 +09:00
parent e4f915e5af
commit 1f1bdc6162
7 changed files with 16 additions and 3 deletions

View File

@ -45,6 +45,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
yield return new Fruit
{
StartTime = obj.StartTime,
Samples = obj.Samples,
NewCombo = comboData?.NewCombo ?? false,
X = positionData.X / CatchPlayfield.BASE_WIDTH
};

View File

@ -25,7 +25,6 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
protected DrawableCatchHitObject(CatchBaseHit hitObject)
: base(hitObject)
{
Origin = Anchor.Centre;
RelativePositionAxes = Axes.Both;
X = hitObject.X;
Y = (float)HitObject.StartTime;

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
using OpenTK;
using OpenTK.Graphics;
@ -13,6 +14,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
public DrawableDroplet(Droplet h)
: base(h)
{
Origin = Anchor.Centre;
Size = new Vector2(Pulp.PULP_SIZE);
AccentColour = Color4.Green;

View File

@ -17,6 +17,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
public DrawableFruit(Fruit h)
: base(h)
{
Origin = Anchor.Centre;
Size = new Vector2(pulp_size * 2.2f, pulp_size * 2.8f);
AccentColour = HitObject.ComboColour;
Masking = false;

View File

@ -17,6 +17,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
RelativeSizeAxes = Axes.Both;
Height = (float)HitObject.Duration;
X = 0;
Child = dropletContainer = new Container
{
@ -27,6 +28,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
var start = new DrawableFruit(new Fruit
{
Samples = s.Samples,
ComboColour = Color4.Blue,
StartTime = s.StartTime,
X = s.X,
@ -36,6 +38,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
var end = new DrawableFruit(new Fruit
{
Samples = s.Samples,
ComboColour = Color4.Red,
StartTime = s.EndTime,
X = s.EndX,
@ -52,6 +55,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
protected override void AddNested(DrawableHitObject<CatchBaseHit> h)
{
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
dropletContainer.Add(h);
base.AddNested(h);
}

View File

@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Catch.Objects
var minDistanceFromEnd = Velocity * 0.01;
// temporary
while (tickDistance > 10) tickDistance /= 2;
while (tickDistance > 100) tickDistance /= 2;
for (var repeat = 0; repeat < RepeatCount; repeat++)
{

View File

@ -83,7 +83,11 @@ namespace osu.Game.Rulesets.Catch.UI
if (judgement.IsHit)
{
Vector2 screenPosition = judgedObject.ScreenSpaceDrawQuad.Centre;
Remove(judgedObject);
// todo: don't do this
(judgedObject.Parent as Container<DrawableHitObject>)?.Remove(judgedObject);
(judgedObject.Parent as Container)?.Remove(judgedObject);
catcher.Add(judgedObject, screenPosition);
}
}