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

Merge remote-tracking branch 'origin/master' into fix-taiko-proxy-rewind

# Conflicts:
#	osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableTaikoHitObject.cs
This commit is contained in:
smoogipoo 2019-08-27 17:42:45 +09:00
commit 3723c441d2
9 changed files with 55 additions and 72 deletions

View File

@ -247,10 +247,6 @@ namespace osu.Game.Rulesets.Taiko.Tests
: base(hitObject) : base(hitObject)
{ {
} }
protected override void UpdateState(ArmedState state)
{
}
} }
} }
} }

View File

@ -53,9 +53,5 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Alpha = 0.75f Alpha = 0.75f
}); });
} }
protected override void UpdateState(ArmedState state)
{
}
} }
} }

View File

@ -88,13 +88,13 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
ApplyResult(r => r.Type = HitResult.Miss); ApplyResult(r => r.Type = HitResult.Miss);
} }
protected override void UpdateState(ArmedState state) protected override void UpdateStateTransforms(ArmedState state)
{ {
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
case ArmedState.Miss: case ArmedState.Miss:
this.FadeOut(100).Expire(); this.Delay(HitObject.Duration).FadeOut(100).Expire();
break; break;
} }
} }

View File

@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
ApplyResult(r => r.Type = HitResult.Great); ApplyResult(r => r.Type = HitResult.Great);
} }
protected override void UpdateState(ArmedState state) protected override void UpdateStateTransforms(ArmedState state)
{ {
switch (state) switch (state)
{ {

View File

@ -92,17 +92,9 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Size = BaseSize * Parent.RelativeChildSize; Size = BaseSize * Parent.RelativeChildSize;
} }
protected override void UpdateState(ArmedState state) protected override void UpdateStateTransforms(ArmedState state)
{ {
// TODO: update to use new state management. switch (state)
var circlePiece = MainPiece as CirclePiece;
circlePiece?.FlashBox.FinishTransforms();
var offset = !AllJudged ? 0 : Time.Current - HitObject.StartTime;
using (BeginDelayedSequence(HitObject.StartTime - Time.Current + offset, true))
{
switch (State.Value)
{ {
case ArmedState.Idle: case ArmedState.Idle:
validActionPressed = false; validActionPressed = false;
@ -120,13 +112,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
// 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 outselves in front of it
ProxyContent(); ProxyContent();
var flash = circlePiece?.FlashBox; var flash = (MainPiece as CirclePiece)?.FlashBox;
flash?.FadeTo(0.9f).FadeOut(300);
if (flash != null)
{
flash.FadeTo(0.9f);
flash.FadeOut(300);
}
const float gravity_time = 300; const float gravity_time = 300;
const float gravity_travel_height = 200; const float gravity_travel_height = 200;
@ -143,7 +130,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
break; break;
} }
} }
}
protected override DrawableStrongNestedHit CreateStrongHit(StrongHitObject hitObject) => new StrongNestedHit(hitObject, this); protected override DrawableStrongNestedHit CreateStrongHit(StrongHitObject hitObject) => new StrongNestedHit(hitObject, this);

View File

@ -18,9 +18,5 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
MainObject = mainObject; MainObject = mainObject;
} }
protected override void UpdateState(ArmedState state)
{
}
} }
} }

View File

@ -25,6 +25,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private const float target_ring_scale = 5f; private const float target_ring_scale = 5f;
private const float inner_ring_alpha = 0.65f; private const float inner_ring_alpha = 0.65f;
/// <summary>
/// Offset away from the start time of the swell at which the ring starts appearing.
/// </summary>
private const double ring_appear_offset = 100;
private readonly List<DrawableSwellTick> ticks = new List<DrawableSwellTick>(); private readonly List<DrawableSwellTick> ticks = new List<DrawableSwellTick>();
private readonly Container bodyContainer; private readonly Container bodyContainer;
@ -179,26 +184,34 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
} }
} }
protected override void UpdateState(ArmedState state) protected override void UpdateInitialTransforms()
{ {
const float preempt = 100; base.UpdateInitialTransforms();
const float out_transition_time = 300;
using (BeginAbsoluteSequence(HitObject.StartTime - ring_appear_offset, true))
targetRing.ScaleTo(target_ring_scale, 400, Easing.OutQuint);
}
protected override void UpdateStateTransforms(ArmedState state)
{
const double transition_duration = 300;
switch (state) switch (state)
{ {
case ArmedState.Idle: case ArmedState.Idle:
UnproxyContent();
expandingRing.FadeTo(0); expandingRing.FadeTo(0);
using (BeginAbsoluteSequence(HitObject.StartTime - preempt, true))
targetRing.ScaleTo(target_ring_scale, preempt * 4, Easing.OutQuint);
break; break;
case ArmedState.Miss: case ArmedState.Miss:
case ArmedState.Hit: case ArmedState.Hit:
this.FadeOut(out_transition_time, Easing.Out); using (BeginAbsoluteSequence(Time.Current, true))
bodyContainer.ScaleTo(1.4f, out_transition_time); {
this.FadeOut(transition_duration, Easing.Out);
bodyContainer.ScaleTo(1.4f, transition_duration);
Expire(); Expire();
}
break; break;
} }
} }
@ -212,9 +225,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
// Make the swell stop at the hit target // Make the swell stop at the hit target
X = Math.Max(0, X); X = Math.Max(0, X);
double t = Math.Min(HitObject.StartTime, Time.Current); if (Time.Current >= HitObject.StartTime - ring_appear_offset)
if (t == HitObject.StartTime)
ProxyContent(); ProxyContent();
else
UnproxyContent();
} }
private bool? lastWasCentre; private bool? lastWasCentre;

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.Scoring;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables namespace osu.Game.Rulesets.Taiko.Objects.Drawables
@ -21,10 +20,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
} }
protected override void UpdateState(ArmedState state)
{
}
public override bool OnPressed(TaikoAction action) => false; public override bool OnPressed(TaikoAction action) => false;
} }
} }

View File

@ -78,6 +78,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public abstract bool OnPressed(TaikoAction action); public abstract bool OnPressed(TaikoAction action);
public virtual bool OnReleased(TaikoAction action) => false; public virtual bool OnReleased(TaikoAction action) => false;
protected override void UpdateInitialTransforms() => this.FadeIn();
public override double LifetimeStart public override double LifetimeStart
{ {
get => base.LifetimeStart; get => base.LifetimeStart;
@ -140,8 +142,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
} }
} }
protected override bool UseTransformStateManagement => false;
// Normal and clap samples are handled by the drum // Normal and clap samples are handled by the drum
protected override IEnumerable<HitSampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP); protected override IEnumerable<HitSampleInfo> GetSamples() => HitObject.Samples.Where(s => s.Name != HitSampleInfo.HIT_NORMAL && s.Name != HitSampleInfo.HIT_CLAP);