1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:52:56 +08:00

improve code quality

This commit is contained in:
mcendu 2019-12-21 22:44:52 +08:00
parent e4eccb86ba
commit 76a895f348
No known key found for this signature in database
GPG Key ID: FBCD5D45163D6364
3 changed files with 19 additions and 14 deletions

View File

@ -6,7 +6,9 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Shapes;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
@ -39,6 +41,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
RelativeSizeAxes = Axes.Both,
Intensity = 0.25f,
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Alpha = 0f,
},
},
new TrianglesPiece
{

View File

@ -10,29 +10,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{
public class KiaiFlash : BeatSyncedContainer
{
public Drawable FlashComponent { get; set; }
public float Intensity { get; set; }
public KiaiFlash()
{
EarlyActivationMilliseconds = 80;
Blending = BlendingParameters.Additive;
Child = FlashComponent = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(1f),
Alpha = 0f,
};
}
protected new double EarlyActivationMilliseconds = 80;
protected override void OnNewBeat(int beatIndex, Game.Beatmaps.ControlPoints.TimingControlPoint timingPoint, Game.Beatmaps.ControlPoints.EffectControlPoint effectPoint, Framework.Audio.Track.TrackAmplitudes amplitudes)
{
if (effectPoint.KiaiMode)
{
FlashComponent
Child
.FadeTo(Intensity, EarlyActivationMilliseconds, Easing.OutQuint)
.Then()
.FadeOut(timingPoint.BeatLength - 80, Easing.OutSine);

View File

@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Objects.Drawables;
@ -50,13 +51,19 @@ namespace osu.Game.Rulesets.Osu.Skinning
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(0.921875f),
Size = new Vector2(OsuLegacySkinTransformer.LEGACY_CIRCLE_RADIUS / 64),
Masking = true,
CornerRadius = Size.X / 2,
CornerExponent = 2,
Intensity = 0.1f
Intensity = 0.1f,
Child = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Alpha = 0f,
}
},
hitCircleText = new SkinnableSpriteText(new OsuSkinComponent(OsuSkinComponents.HitCircleText), _ => new OsuSpriteText
{