Merge branch 'master' into split-out-pulp-formations

This commit is contained in:
Dan Balasescu
2020-02-21 11:45:06 +09:00
committed by GitHub
85 changed files with 1782 additions and 779 deletions

View File

@ -16,10 +16,10 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
private Color4? colour;
protected override void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours)
protected override Color4 GetComboColour(IReadOnlyList<Color4> comboColours)
{
// override any external colour changes with banananana
AccentColour.Value = (colour ??= getBananaColour());
return colour ??= getBananaColour();
}
private Color4 getBananaColour()

View File

@ -19,7 +19,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
{
public override bool CanBePlated => true;
protected Container ScaleContainer;
protected Container ScaleContainer { get; private set; }
protected PalpableCatchHitObject(TObject hitObject)
: base(hitObject)
@ -45,11 +45,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
ScaleContainer.Scale = new Vector2(HitObject.Scale);
}
protected override void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours)
{
// ignore the incoming combo colour as we use a custom lookup
AccentColour.Value = comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
}
protected override Color4 GetComboColour(IReadOnlyList<Color4> comboColours) =>
comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
}
public abstract class DrawableCatchHitObject<TObject> : DrawableCatchHitObject

View File

@ -2,9 +2,10 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
using osu.Game.Skinning;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawables
{
@ -20,12 +21,22 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
[BackgroundDependencyLoader]
private void load()
{
ScaleContainer.Child = new SkinnableDrawable(
new CatchSkinComponent(CatchSkinComponents.Droplet), _ => new Pulp
{
Size = Size / 4,
AccentColour = { Value = Color4.White }
});
ScaleContainer.Child = new SkinnableDrawable(new CatchSkinComponent(CatchSkinComponents.Droplet), _ => new Pulp
{
Size = Size / 4,
AccentColour = { BindTarget = AccentColour }
});
}
protected override void UpdateInitialTransforms()
{
base.UpdateInitialTransforms();
// roughly matches osu-stable
float startRotation = RNG.NextSingle() * 20;
double duration = HitObject.TimePreempt + 2000;
this.RotateTo(startRotation).RotateTo(startRotation + 720, duration);
}
}
}

View File

@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
((DrawableCatchHitObject)o).CheckPosition = p => CheckPosition?.Invoke(p) ?? false);
}
return null;
throw new ArgumentException($"{nameof(hitObject)} must be of type {nameof(CatchHitObject)}.");
}
}
}

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
[BackgroundDependencyLoader]
private void load()
{
Scale /= 2;
ScaleContainer.Scale /= 2;
}
}
}