mirror of
https://github.com/ppy/osu.git
synced 2025-03-25 18:57:18 +08:00
Fix transforms from swell progress being cleared on completion by not using transforms
This commit is contained in:
parent
96db6964df
commit
0ac08158e3
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
/// </summary>
|
||||
public bool MustAlternate { get; internal set; } = true;
|
||||
|
||||
public event Action<int, int> UpdateHitProgress;
|
||||
public event Action<int> UpdateHitProgress;
|
||||
|
||||
public DrawableSwell()
|
||||
: this(null)
|
||||
@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
|
||||
|
||||
int numHits = ticks.Count(r => r.IsHit);
|
||||
|
||||
UpdateHitProgress?.Invoke(numHits, HitObject.RequiredHits);
|
||||
UpdateHitProgress?.Invoke(numHits);
|
||||
|
||||
if (numHits == HitObject.RequiredHits)
|
||||
ApplyMaxResult();
|
||||
|
@ -8,10 +8,12 @@ using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Taiko.Objects;
|
||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
||||
@ -29,6 +31,7 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
||||
private readonly CircularContainer targetRing;
|
||||
private readonly CircularContainer expandingRing;
|
||||
private readonly Drawable centreCircle;
|
||||
private int numHits;
|
||||
|
||||
public DefaultSwell()
|
||||
{
|
||||
@ -125,18 +128,25 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Default
|
||||
};
|
||||
}
|
||||
|
||||
private void animateSwellProgress(int numHits, int requiredHits)
|
||||
private void animateSwellProgress(int numHits)
|
||||
{
|
||||
float completion = (float)numHits / requiredHits;
|
||||
this.numHits = numHits;
|
||||
|
||||
centreCircle.RotateTo((float)(completion * drawableSwell.HitObject.Duration / 8), 4000, Easing.OutQuint);
|
||||
float completion = (float)numHits / drawableSwell.HitObject.RequiredHits;
|
||||
expandingRing.Alpha += Math.Clamp(completion / 16, 0.1f, 0.6f);
|
||||
}
|
||||
|
||||
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint);
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
expandingRing
|
||||
.FadeTo(expandingRing.Alpha + Math.Clamp(completion / 16, 0.1f, 0.6f), 50)
|
||||
.Then()
|
||||
.FadeTo(completion / 8, 2000, Easing.OutQuint);
|
||||
float completion = (float)numHits / drawableSwell.HitObject.RequiredHits;
|
||||
|
||||
centreCircle.Rotation = (float)Interpolation.DampContinuously(centreCircle.Rotation,
|
||||
(float)(completion * drawableSwell.HitObject.Duration / 8), 500, Math.Abs(Time.Elapsed));
|
||||
expandingRing.Scale = new Vector2((float)Interpolation.DampContinuously(expandingRing.Scale.X,
|
||||
1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 35, Math.Abs(Time.Elapsed)));
|
||||
expandingRing.Alpha = (float)Interpolation.DampContinuously(expandingRing.Alpha, completion / 16, 250, Math.Abs(Time.Elapsed));
|
||||
}
|
||||
|
||||
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||
|
@ -35,6 +35,8 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
||||
|
||||
private bool samplePlayed;
|
||||
|
||||
private int numHits;
|
||||
|
||||
public LegacySwell()
|
||||
{
|
||||
Anchor = Anchor.Centre;
|
||||
@ -112,17 +114,25 @@ namespace osu.Game.Rulesets.Taiko.Skinning.Legacy
|
||||
clearSample = skin.GetSample(new SampleInfo("spinner-osu"));
|
||||
}
|
||||
|
||||
private void animateSwellProgress(int numHits, int requiredHits)
|
||||
private void animateSwellProgress(int numHits)
|
||||
{
|
||||
int remainingHits = requiredHits - numHits;
|
||||
remainingHitsText.Text = remainingHits.ToString(CultureInfo.InvariantCulture);
|
||||
remainingHitsText.ScaleTo(1.6f - (0.6f * ((float)remainingHits / requiredHits)), 60, Easing.Out);
|
||||
this.numHits = numHits;
|
||||
remainingHitsText.Text = (drawableSwell.HitObject.RequiredHits - numHits).ToString(CultureInfo.InvariantCulture);
|
||||
spinnerCircle.Scale = new Vector2(Math.Min(0.94f, spinnerCircle.Scale.X + 0.02f));
|
||||
}
|
||||
|
||||
spinnerCircle.ClearTransforms();
|
||||
spinnerCircle
|
||||
.RotateTo(180f * numHits, 1000, Easing.OutQuint)
|
||||
.ScaleTo(Math.Min(0.94f, spinnerCircle.Scale.X + 0.02f))
|
||||
.ScaleTo(0.8f, 400, Easing.Out);
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
int requiredHits = drawableSwell.HitObject.RequiredHits;
|
||||
int remainingHits = requiredHits - numHits;
|
||||
remainingHitsText.Scale = new Vector2((float)Interpolation.DampContinuously(
|
||||
remainingHitsText.Scale.X, 1.6f - (0.6f * ((float)remainingHits / requiredHits)), 17.5, Math.Abs(Time.Elapsed)));
|
||||
|
||||
spinnerCircle.Rotation = (float)Interpolation.DampContinuously(spinnerCircle.Rotation, 180f * numHits, 130, Math.Abs(Time.Elapsed));
|
||||
spinnerCircle.Scale = new Vector2((float)Interpolation.DampContinuously(
|
||||
spinnerCircle.Scale.X, 0.8f, 120, Math.Abs(Time.Elapsed)));
|
||||
}
|
||||
|
||||
private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user