1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Update existing implementations

This commit is contained in:
Dean Herbert 2020-11-04 16:19:07 +09:00
parent 68b7efe4d5
commit a3dc1d5730
18 changed files with 58 additions and 90 deletions

View File

@ -6,9 +6,8 @@ using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK;
using osuTK.Graphics;
@ -90,11 +89,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
ApplyResult(r => r.Type = CheckPosition.Invoke(HitObject) ? r.Judgement.MaxResult : r.Judgement.MinResult);
}
protected override void UpdateStateTransforms(ArmedState state)
{
var endTime = HitObject.GetEndTime();
using (BeginAbsoluteSequence(endTime, true))
protected override void UpdateHitStateTransforms(ArmedState state)
{
switch (state)
{
@ -109,4 +104,3 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawables
}
}
}
}

View File

@ -204,10 +204,6 @@ namespace osu.Game.Rulesets.Mania.Edit
protected override void UpdateInitialTransforms()
{
// don't perform any fading we are handling that ourselves.
}
protected override void UpdateStateTransforms(ArmedState state)
{
LifetimeEnd = HitObject.StartTime + visible_range;
}
}

View File

@ -1,10 +1,9 @@
// 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.
using osuTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Rulesets.Objects.Drawables;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
@ -71,6 +70,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
}
protected override void UpdateStateTransforms(ArmedState state) => this.FadeOut(150);
protected override void UpdateStartTimeStateTransforms() => this.FadeOut(150);
}
}

View File

@ -229,12 +229,6 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
}
}
protected override void UpdateStateTransforms(ArmedState state)
{
using (BeginDelayedSequence(HitObject.Duration, true))
base.UpdateStateTransforms(state);
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (Tail.AllJudged)

View File

@ -1,8 +1,6 @@
// 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.
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.Objects.Drawables
{
/// <summary>
@ -19,8 +17,10 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public void UpdateResult() => base.UpdateResult(true);
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateInitialTransforms()
{
base.UpdateInitialTransforms();
// This hitobject should never expire, so this is just a safe maximum.
LifetimeEnd = LifetimeStart + 30000;
}

View File

@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
Anchor = Origin = e.NewValue == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
switch (state)
{

View File

@ -164,19 +164,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
ApproachCircle.Expire(true);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);
Debug.Assert(HitObject.HitWindows != null);
switch (state)
{
case ArmedState.Idle:
this.Delay(HitObject.TimePreempt).FadeOut(500);
Expire(true);
HitArea.HitAction = null;
break;

View File

@ -51,17 +51,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected virtual void Shake(double maximumLength) => shakeContainer.Shake(maximumLength);
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateInitialTransforms()
{
base.UpdateStateTransforms(state);
base.UpdateInitialTransforms();
switch (state)
{
case ArmedState.Idle:
// Manually set to reduce the number of future alive objects to a bare minimum.
LifetimeStart = HitObject.StartTime - HitObject.TimePreempt;
break;
}
}
/// <summary>

View File

@ -253,15 +253,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
base.PlaySamples();
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateStartTimeStateTransforms()
{
base.UpdateStateTransforms(state);
base.UpdateStartTimeStateTransforms();
Ball.FadeIn();
Ball.ScaleTo(HitObject.Scale);
}
using (BeginDelayedSequence(slider.Duration, true))
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateHitStateTransforms(state);
const float fade_out_time = 450;
// intentionally pile on an extra FadeOut to make it happen much faster.
@ -276,7 +279,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
this.FadeOut(fade_out_time, Easing.OutQuint);
}
}
public Drawable ProxiedLayer => HeadCircle.ProxiedLayer;

View File

@ -77,9 +77,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);
base.UpdateHitStateTransforms(state);
switch (state)
{

View File

@ -67,9 +67,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
circlePiece.FadeInFromZero(HitObject.TimeFadeIn);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);
base.UpdateHitStateTransforms(state);
Debug.Assert(HitObject.HitWindows != null);
@ -77,8 +77,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
case ArmedState.Idle:
this.Delay(HitObject.TimePreempt).FadeOut(500);
Expire(true);
break;
case ArmedState.Miss:

View File

@ -72,9 +72,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
this.ScaleTo(0.5f).ScaleTo(1f, ANIM_DURATION * 4, Easing.OutElasticHalf);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);
base.UpdateHitStateTransforms(state);
switch (state)
{

View File

@ -142,11 +142,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
base.UpdateStateTransforms(state);
base.UpdateHitStateTransforms(state);
using (BeginDelayedSequence(Spinner.Duration, true))
this.FadeOut(160);
// skin change does a rewind of transforms, which will stop the spinning sound from playing if it's currently in playback.

View File

@ -58,6 +58,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
});
}
protected override void UpdateStateTransforms(ArmedState state) => this.FadeOut(150);
protected override void UpdateHitStateTransforms(ArmedState state) => this.FadeOut(150);
}
}

View File

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

View File

@ -43,7 +43,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
ApplyResult(r => r.Type = r.Judgement.MaxResult);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
switch (state)
{

View File

@ -193,7 +193,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
pressHandledThisFrame = false;
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
Debug.Assert(HitObject.HitWindows != null);

View File

@ -215,15 +215,15 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
}
}
protected override void UpdateInitialTransforms()
protected override void UpdateStartTimeStateTransforms()
{
base.UpdateInitialTransforms();
base.UpdateStartTimeStateTransforms();
using (BeginAbsoluteSequence(HitObject.StartTime - ring_appear_offset, true))
using (BeginDelayedSequence(-ring_appear_offset, true))
targetRing.ScaleTo(target_ring_scale, 400, Easing.OutQuint);
}
protected override void UpdateStateTransforms(ArmedState state)
protected override void UpdateHitStateTransforms(ArmedState state)
{
const double transition_duration = 300;
@ -235,12 +235,8 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
case ArmedState.Miss:
case ArmedState.Hit:
using (BeginDelayedSequence(HitObject.Duration, true))
{
this.FadeOut(transition_duration, Easing.Out);
bodyContainer.ScaleTo(1.4f, transition_duration);
}
break;
}
}