1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Fix extending spinners in editor causing them to disappear temporarily

This commit is contained in:
Dean Herbert 2020-09-28 17:20:36 +09:00
parent 89c8fca3fa
commit 8692c24dfc
3 changed files with 8 additions and 11 deletions

View File

@ -3,7 +3,6 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -93,7 +92,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
base.LoadComplete();
drawableSpinner.RotationTracker.Complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
drawableSpinner.State.BindValueChanged(updateStateTransforms, true);
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
}
protected override void Update()
@ -123,7 +122,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
mainContainer.Rotation = drawableSpinner.RotationTracker.Rotation;
}
private void updateStateTransforms(ValueChangedEvent<ArmedState> state)
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
centre.ScaleTo(0);
mainContainer.ScaleTo(0);
@ -144,11 +143,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
}
// transforms we have from completing the spinner will be rolled back, so reapply immediately.
updateComplete(state.NewValue == ArmedState.Hit, 0);
updateComplete(state == ArmedState.Hit, 0);
using (BeginDelayedSequence(spinner.Duration, true))
{
switch (state.NewValue)
switch (state)
{
case ArmedState.Hit:
this.ScaleTo(Scale * 1.2f, 320, Easing.Out);

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -72,10 +71,10 @@ namespace osu.Game.Rulesets.Osu.Skinning
base.LoadComplete();
this.FadeOut();
drawableSpinner.State.BindValueChanged(updateStateTransforms, true);
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
}
private void updateStateTransforms(ValueChangedEvent<ArmedState> state)
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
var spinner = (Spinner)drawableSpinner.HitObject;

View File

@ -3,7 +3,6 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -86,10 +85,10 @@ namespace osu.Game.Rulesets.Osu.Skinning
base.LoadComplete();
this.FadeOut();
drawableSpinner.State.BindValueChanged(updateStateTransforms, true);
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
}
private void updateStateTransforms(ValueChangedEvent<ArmedState> state)
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
var spinner = drawableSpinner.HitObject;