2020-02-17 09:47:22 +00:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2020-11-27 01:10:05 +00:00
|
|
|
using osu.Framework.Bindables;
|
2020-02-17 09:47:22 +00:00
|
|
|
using osu.Framework.Graphics;
|
2021-06-07 04:59:17 +00:00
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
2020-02-17 09:47:22 +00:00
|
|
|
|
2020-12-07 03:35:24 +00:00
|
|
|
namespace osu.Game.Rulesets.Catch.Skinning.Default
|
2020-02-17 09:47:22 +00:00
|
|
|
{
|
2020-12-07 04:14:00 +00:00
|
|
|
internal partial class FruitPiece : CatchHitObjectPiece
|
2020-02-17 09:47:22 +00:00
|
|
|
{
|
2020-02-19 00:39:56 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Because we're adding a border around the fruit, we need to scale down some.
|
|
|
|
/// </summary>
|
2020-02-19 14:32:56 +00:00
|
|
|
public const float RADIUS_ADJUST = 1.1f;
|
2020-02-19 00:39:56 +00:00
|
|
|
|
2020-11-27 01:10:05 +00:00
|
|
|
public readonly Bindable<FruitVisualRepresentation> VisualRepresentation = new Bindable<FruitVisualRepresentation>();
|
2020-02-17 09:47:22 +00:00
|
|
|
|
2022-10-28 09:29:55 +00:00
|
|
|
protected override Drawable BorderPiece { get; }
|
2022-10-26 07:08:01 +00:00
|
|
|
protected override Drawable HyperBorderPiece { get; }
|
2020-12-08 08:15:40 +00:00
|
|
|
|
2020-02-17 09:47:22 +00:00
|
|
|
public FruitPiece()
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
2020-12-07 04:56:22 +00:00
|
|
|
|
2022-10-26 07:08:01 +00:00
|
|
|
InternalChildren = new[]
|
2020-12-07 04:56:22 +00:00
|
|
|
{
|
|
|
|
new FruitPulpFormation
|
|
|
|
{
|
|
|
|
AccentColour = { BindTarget = AccentColour },
|
|
|
|
VisualRepresentation = { BindTarget = VisualRepresentation }
|
|
|
|
},
|
|
|
|
BorderPiece = new BorderPiece(),
|
|
|
|
HyperBorderPiece = new HyperBorderPiece()
|
|
|
|
};
|
2020-02-17 09:47:22 +00:00
|
|
|
}
|
|
|
|
|
2020-12-07 04:14:00 +00:00
|
|
|
protected override void LoadComplete()
|
2020-02-17 09:47:22 +00:00
|
|
|
{
|
2020-12-07 04:14:00 +00:00
|
|
|
base.LoadComplete();
|
2020-11-30 04:46:02 +00:00
|
|
|
|
2021-06-07 05:49:37 +00:00
|
|
|
IndexInBeatmap.BindValueChanged(index =>
|
|
|
|
{
|
|
|
|
VisualRepresentation.Value = Fruit.GetVisualRepresentation(index.NewValue);
|
|
|
|
}, true);
|
2020-02-17 09:47:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|