1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +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 yield return new Fruit
{ {
StartTime = obj.StartTime, StartTime = obj.StartTime,
Samples = obj.Samples,
NewCombo = comboData?.NewCombo ?? false, NewCombo = comboData?.NewCombo ?? false,
X = positionData.X / CatchPlayfield.BASE_WIDTH X = positionData.X / CatchPlayfield.BASE_WIDTH
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -83,7 +83,11 @@ namespace osu.Game.Rulesets.Catch.UI
if (judgement.IsHit) if (judgement.IsHit)
{ {
Vector2 screenPosition = judgedObject.ScreenSpaceDrawQuad.Centre; 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); catcher.Add(judgedObject, screenPosition);
} }
} }