mirror of
https://github.com/ppy/osu
synced 2024-12-13 02:17:32 +00:00
0ae4a0f11f
The new limits were chosen by sampling across over 4000 skins. The methodology for doing so is described in the following gist: https://gist.github.com/bdach/6228ba41d128b23d1f89142f404108a3
52 lines
1.6 KiB
C#
52 lines
1.6 KiB
C#
// 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.
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
using osu.Game.Skinning;
|
|
using osuTK;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Skinning.Legacy
|
|
{
|
|
internal partial class LegacyFruitPiece : LegacyCatchHitObjectPiece
|
|
{
|
|
private static readonly Vector2 fruit_max_size = new Vector2(160);
|
|
|
|
protected override void LoadComplete()
|
|
{
|
|
base.LoadComplete();
|
|
|
|
IndexInBeatmap.BindValueChanged(index =>
|
|
{
|
|
setTexture(Fruit.GetVisualRepresentation(index.NewValue));
|
|
}, true);
|
|
}
|
|
|
|
private void setTexture(FruitVisualRepresentation visualRepresentation)
|
|
{
|
|
switch (visualRepresentation)
|
|
{
|
|
case FruitVisualRepresentation.Pear:
|
|
setTextures("pear");
|
|
break;
|
|
|
|
case FruitVisualRepresentation.Grape:
|
|
setTextures("grapes");
|
|
break;
|
|
|
|
case FruitVisualRepresentation.Pineapple:
|
|
setTextures("apple");
|
|
break;
|
|
|
|
case FruitVisualRepresentation.Raspberry:
|
|
setTextures("orange");
|
|
break;
|
|
}
|
|
|
|
void setTextures(string fruitName) => SetTexture(
|
|
Skin.GetTexture($"fruit-{fruitName}")?.WithMaximumSize(fruit_max_size),
|
|
Skin.GetTexture($"fruit-{fruitName}-overlay")?.WithMaximumSize(fruit_max_size)
|
|
);
|
|
}
|
|
}
|
|
}
|