mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 19:23:21 +08:00
Fix weird fruit not fading out
This commit is contained in:
parent
f03b8206da
commit
7b19353ed8
@ -63,10 +63,7 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||
protected override void UpdateState(ArmedState state)
|
||||
{
|
||||
using (BeginAbsoluteSequence(HitObject.StartTime - preempt))
|
||||
{
|
||||
// animation
|
||||
this.FadeIn(200);
|
||||
}
|
||||
|
||||
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
||||
|
||||
|
@ -44,14 +44,16 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
};
|
||||
}
|
||||
|
||||
private DrawableCatchHitObject lastPlateableFruit;
|
||||
|
||||
public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement)
|
||||
{
|
||||
if (judgement.IsHit && fruit.CanBePlated)
|
||||
{
|
||||
var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject);
|
||||
|
||||
if (caughtFruit != null)
|
||||
{
|
||||
if (caughtFruit == null) return;
|
||||
|
||||
caughtFruit.State.Value = ArmedState.Idle;
|
||||
caughtFruit.AccentColour = fruit.AccentColour;
|
||||
caughtFruit.RelativePositionAxes = Axes.None;
|
||||
@ -61,11 +63,16 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
caughtFruit.Origin = Anchor.Centre;
|
||||
caughtFruit.Scale *= 0.7f;
|
||||
caughtFruit.LifetimeEnd = double.MaxValue;
|
||||
}
|
||||
|
||||
MovableCatcher.Add(caughtFruit);
|
||||
|
||||
lastPlateableFruit = caughtFruit;
|
||||
}
|
||||
|
||||
// this is required to make this run after the last caught fruit runs UpdateState at least once.
|
||||
// TODO: find a better alternative
|
||||
lastPlateableFruit.OnLoadComplete = _ =>
|
||||
{
|
||||
if (fruit.HitObject.LastInCombo)
|
||||
{
|
||||
if (judgement.IsHit)
|
||||
@ -73,6 +80,7 @@ namespace osu.Game.Rulesets.Catch.UI
|
||||
else
|
||||
MovableCatcher.Drop();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public bool OnPressed(CatchAction action)
|
||||
|
Loading…
Reference in New Issue
Block a user