1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Fix metrics not matching between skins and lazer

This commit is contained in:
Dean Herbert 2020-02-17 19:16:40 +09:00
parent 2133ba38e5
commit 89bff32274
5 changed files with 25 additions and 9 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Catch.Objects
{
public abstract class CatchHitObject : HitObject, IHasXPosition, IHasComboInformation
{
public const double OBJECT_RADIUS = 44;
public const float OBJECT_RADIUS = 64;
private float x;

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
: base(h)
{
Origin = Anchor.Centre;
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 4;
Size = new Vector2(CatchHitObject.OBJECT_RADIUS) / 4;
Masking = false;
}

View File

@ -4,6 +4,7 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Utils;
using osu.Game.Skinning;
using osuTK;
@ -13,7 +14,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
public class DrawableFruit : PalpableCatchHitObject<Fruit>
{
public const float DRAWABLE_RADIUS = (float)CatchHitObject.OBJECT_RADIUS * RADIUS_ADJUST;
private Container scaleContainer;
/// <summary>
/// Because we're adding a border around the fruit, we need to scale down some.
@ -25,7 +26,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
Origin = Anchor.Centre;
Size = new Vector2(DRAWABLE_RADIUS);
Size = new Vector2(CatchHitObject.OBJECT_RADIUS * 2);
Masking = false;
Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
@ -34,10 +36,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
[BackgroundDependencyLoader]
private void load()
{
AddInternal(new SkinnableDrawable(
new CatchSkinComponent(getComponent(HitObject.VisualRepresentation)), _ => new FruitPiece()));
AddRangeInternal(new Framework.Graphics.Drawable[]
{
scaleContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Children = new Framework.Graphics.Drawable[]
{
new SkinnableDrawable(
new CatchSkinComponent(getComponent(HitObject.VisualRepresentation)), _ => new FruitPiece())
}
}
});
AccentColour.Value = colourForRepresentation(HitObject.VisualRepresentation);
scaleContainer.Scale = new Vector2(HitObject.Scale);
}
private CatchSkinComponents getComponent(FruitVisualRepresentation hitObjectVisualRepresentation)

View File

@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
public DrawableTinyDroplet(TinyDroplet h)
: base(h)
{
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 8;
Size = new Vector2(CatchHitObject.OBJECT_RADIUS / 8);
}
}
}

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
BorderColour = Color4.White,
BorderThickness = 3f * DrawableFruit.RADIUS_ADJUST,
BorderThickness = 6f * DrawableFruit.RADIUS_ADJUST,
Children = new Framework.Graphics.Drawable[]
{
new Box
@ -82,7 +82,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation representation)
{
const float large_pulp_3 = 8f * DrawableFruit.RADIUS_ADJUST;
const float large_pulp_3 = 16f * DrawableFruit.RADIUS_ADJUST;
const float distance_from_centre_3 = 0.15f;
const float large_pulp_4 = large_pulp_3 * 0.925f;