Merge pull request #8004 from peppy/fix-hyperdash-display

Fix hyperdash red glow not being visible
This commit is contained in:
Dan Balasescu 2020-02-26 20:27:46 +09:00 committed by GitHub
commit b11e4f0f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 10 deletions

View File

@ -42,6 +42,9 @@ namespace osu.Game.Rulesets.Catch.Tests
AddStep("show droplet", () => SetContents(createDrawableDroplet));
AddStep("show tiny droplet", () => SetContents(createDrawableTinyDroplet));
foreach (FruitVisualRepresentation rep in Enum.GetValues(typeof(FruitVisualRepresentation)))
AddStep($"show hyperdash {rep}", () => SetContents(() => createDrawable(rep, true)));
}
private Drawable createDrawableTinyDroplet()
@ -82,9 +85,13 @@ namespace osu.Game.Rulesets.Catch.Tests
};
}
private Drawable createDrawable(FruitVisualRepresentation rep)
private Drawable createDrawable(FruitVisualRepresentation rep, bool hyperdash = false)
{
Fruit fruit = new TestCatchFruit(rep) { Scale = 1.5f };
Fruit fruit = new TestCatchFruit(rep)
{
Scale = 1.5f,
HyperDashTarget = hyperdash ? new Banana() : null
};
return new DrawableFruit(fruit)
{

View File

@ -7,9 +7,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Catch.Objects.Drawables.Pieces;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Objects.Drawables
@ -64,15 +62,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
if (hitObject.HyperDash)
{
AddInternal(new Pulp
AddInternal(new Circle
{
RelativePositionAxes = Axes.Both,
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AccentColour = { Value = Color4.Red },
Blending = BlendingParameters.Additive,
Alpha = 0.5f,
Scale = new Vector2(1.333f)
BorderColour = Color4.Red,
BorderThickness = 12f * RADIUS_ADJUST,
Children = new Drawable[]
{
new Box
{
AlwaysPresent = true,
Alpha = 0.3f,
Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both,
Colour = Color4.Red,
}
}
});
}
}

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets.Catch.Objects.Drawables;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Skinning;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Catch.Skinning
@ -49,6 +50,23 @@ namespace osu.Game.Rulesets.Catch.Skinning
Origin = Anchor.Centre,
},
};
if (drawableCatchObject.HitObject.HyperDash)
{
var hyperDash = new Sprite
{
Texture = skin.GetTexture(lookupName),
Colour = Color4.Red,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Blending = BlendingParameters.Additive,
Depth = 1,
Alpha = 0.7f,
Scale = new Vector2(1.2f)
};
AddInternal(hyperDash);
}
}
protected override void LoadComplete()