mirror of https://github.com/ppy/osu
Add droplet skinning support
This commit is contained in:
parent
0f85e81240
commit
ce1a57550f
|
@ -10,5 +10,6 @@ public enum CatchSkinComponents
|
|||
FruitGrapes,
|
||||
FruitOrange,
|
||||
FruitPear,
|
||||
Droplet
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
{
|
||||
|
@ -16,18 +19,35 @@ public DrawableDroplet(Droplet h)
|
|||
: base(h)
|
||||
{
|
||||
Origin = Anchor.Centre;
|
||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS) / 4;
|
||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2) / 4;
|
||||
Masking = false;
|
||||
}
|
||||
|
||||
private Container scaleContainer;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
AddInternal(new Pulp
|
||||
AddRangeInternal(new Framework.Graphics.Drawable[]
|
||||
{
|
||||
Size = Size,
|
||||
AccentColour = { BindTarget = AccentColour }
|
||||
scaleContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Origin = Anchor.Centre,
|
||||
Anchor = Anchor.Centre,
|
||||
Children = new Framework.Graphics.Drawable[]
|
||||
{
|
||||
new SkinnableDrawable(
|
||||
new CatchSkinComponent(CatchSkinComponents.Droplet), _ => new Pulp
|
||||
{
|
||||
Size = Size,
|
||||
AccentColour = { Value = Color4.White }
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
scaleContainer.Scale = new Vector2(HitObject.Scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ public class DrawableTinyDroplet : DrawableDroplet
|
|||
public DrawableTinyDroplet(TinyDroplet h)
|
||||
: base(h)
|
||||
{
|
||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS / 8);
|
||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2) / 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,12 @@ public Drawable GetDrawableComponent(ISkinComponent component)
|
|||
return new LegacyFruitPiece(lookupName);
|
||||
|
||||
break;
|
||||
|
||||
case CatchSkinComponents.Droplet:
|
||||
if (GetTexture("fruit-drop") != null)
|
||||
return new LegacyFruitPiece("fruit-drop");
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue