mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Add droplet skinning support
This commit is contained in:
@ -10,5 +10,6 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
FruitGrapes,
|
FruitGrapes,
|
||||||
FruitOrange,
|
FruitOrange,
|
||||||
FruitPear,
|
FruitPear,
|
||||||
|
Droplet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,11 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
@ -16,18 +19,35 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
: base(h)
|
: base(h)
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS) / 4;
|
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2) / 4;
|
||||||
Masking = false;
|
Masking = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Container scaleContainer;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
AddInternal(new Pulp
|
AddRangeInternal(new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Size = Size,
|
scaleContainer = new Container
|
||||||
AccentColour = { BindTarget = AccentColour }
|
{
|
||||||
|
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 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|||||||
public DrawableTinyDroplet(TinyDroplet h)
|
public DrawableTinyDroplet(TinyDroplet h)
|
||||||
: base(h)
|
: base(h)
|
||||||
{
|
{
|
||||||
Size = new Vector2(CatchHitObject.OBJECT_RADIUS / 8);
|
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2) / 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,12 @@ namespace osu.Game.Rulesets.Catch.Skinning
|
|||||||
return new LegacyFruitPiece(lookupName);
|
return new LegacyFruitPiece(lookupName);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CatchSkinComponents.Droplet:
|
||||||
|
if (GetTexture("fruit-drop") != null)
|
||||||
|
return new LegacyFruitPiece("fruit-drop");
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Reference in New Issue
Block a user