1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 19:32:55 +08:00

Merge pull request #21171 from peppy/unpollute-taiko-drawable-hit

Remove triangles skin specific implementation from base osu!taiko `DrawableHit`
This commit is contained in:
Dan Balasescu 2022-11-10 12:47:36 +09:00 committed by GitHub
commit 20520e7290
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 7 deletions

View File

@ -201,12 +201,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
break;
case ArmedState.Hit:
// If we're far enough away from the left stage, we should bring outselves in front of it
// If we're far enough away from the left stage, we should bring ourselves in front of it
ProxyContent();
var flash = (MainPiece.Drawable as CirclePiece)?.FlashBox;
flash?.FadeTo(0.9f).FadeOut(300);
const float gravity_time = 300;
const float gravity_travel_height = 200;

View File

@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
private readonly Container background;
public Box FlashBox;
private readonly Box flashBox;
protected CirclePiece()
{
@ -123,7 +123,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
Masking = true,
Children = new[]
{
FlashBox = new Box
flashBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
@ -145,6 +145,25 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
});
}
protected override void LoadComplete()
{
base.LoadComplete();
drawableHitObject.ApplyCustomUpdateState += updateStateTransforms;
updateStateTransforms(drawableHitObject, drawableHitObject.State.Value);
}
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
switch (state)
{
case ArmedState.Hit:
using (BeginAbsoluteSequence(drawableHitObject.HitStateUpdateTime))
flashBox?.FadeTo(0.9f).FadeOut(300);
break;
}
}
private const float edge_alpha_kiai = 0.5f;
private void resetEdgeEffects()
@ -164,7 +183,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
if (drawableHitObject.State.Value == ArmedState.Idle)
{
FlashBox
flashBox
.FadeTo(flash_opacity)
.Then()
.FadeOut(timingPoint.BeatLength * 0.75, Easing.OutSine);