Remove remaining usages of AddDelay

This commit is contained in:
Thomas Müller 2017-07-17 18:16:15 +03:00
parent 546efc0181
commit 440878945e
6 changed files with 47 additions and 54 deletions

@ -1 +1 @@
Subproject commit 8463ba949b0a4a54c9aca157b2b24a8b0277608a
Subproject commit 2410eba0d4b0cdcfe8b7e0636d490a258ddebc6c

View File

@ -210,7 +210,7 @@ protected override void UpdateCurrentState(ArmedState state)
break;
}
sequence.Expire();
Expire();
}
}
}

View File

@ -64,8 +64,7 @@ public DrawableBarLine(BarLine barLine)
protected override void LoadComplete()
{
base.LoadComplete();
AddDelay(BarLine.StartTime - Time.Current);
this.FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
this.Delay(BarLine.StartTime - Time.Current).FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
}
private void updateScrollPosition(double time) => this.MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime));

View File

@ -65,45 +65,42 @@ protected override bool HandleKeyPress(Key key)
protected override void UpdateState(ArmedState state)
{
AddDelay(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true);
var circlePiece = MainPiece as CirclePiece;
circlePiece?.FlashBox.Flush();
switch (State)
using (BeginDelayedSequence(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true))
{
case ArmedState.Idle:
AddDelay(HitObject.HitWindowMiss);
break;
case ArmedState.Miss:
this.FadeOut(100);
break;
case ArmedState.Hit:
this.FadeOut(600);
switch (State)
{
case ArmedState.Idle:
this.Delay(HitObject.HitWindowMiss).Expire();
break;
case ArmedState.Miss:
this.FadeOut(100)
.Expire();
break;
case ArmedState.Hit:
var flash = circlePiece?.FlashBox;
if (flash != null)
{
flash.FadeTo(0.9f);
flash.FadeOut(300);
}
var flash = circlePiece?.FlashBox;
if (flash != null)
{
flash.FadeTo(0.9f);
flash.FadeOut(300);
}
const float gravity_time = 300;
const float gravity_travel_height = 200;
Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad);
this.FadeOut(800);
this.FadeOut(800)
.MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out)
.Then()
.MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In);
const float gravity_time = 300;
const float gravity_travel_height = 200;
Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad);
this.MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out);
AddDelay(gravity_time, true);
this.MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In);
break;
Expire();
break;
}
}
Expire();
}
}
}

View File

@ -181,26 +181,21 @@ protected override void CheckJudgement(bool userTriggered)
protected override void UpdateState(ArmedState state)
{
const float preempt = 100;
AddDelay(HitObject.StartTime - Time.Current - preempt, true);
targetRing.ScaleTo(target_ring_scale, preempt * 4, EasingTypes.OutQuint);
AddDelay(preempt, true);
AddDelay(Judgement.TimeOffset + HitObject.Duration, true);
const float out_transition_time = 300;
double untilStartTime = HitObject.StartTime - Time.Current;
double untilJudgement = untilStartTime + Judgement.TimeOffset + HitObject.Duration;
targetRing.Delay(untilStartTime - preempt).ScaleTo(target_ring_scale, preempt * 4, EasingTypes.OutQuint);
this.Delay(untilJudgement).FadeOut(out_transition_time, EasingTypes.Out);
switch (state)
{
case ArmedState.Hit:
bodyContainer.ScaleTo(1.4f, out_transition_time);
bodyContainer.Delay(untilJudgement).ScaleTo(1.4f, out_transition_time);
break;
}
this.FadeOut(out_transition_time, EasingTypes.Out);
Expire();
}

View File

@ -149,15 +149,17 @@ protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
const float down_time = 40;
const float up_time = 1000;
back.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint);
back.AddDelay(down_time);
back.ScaleTo(1, up_time, EasingTypes.OutQuint);
back.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint)
.Then()
.ScaleTo(1, up_time, EasingTypes.OutQuint);
target.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint);
target.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, EasingTypes.OutQuint);
target.AddDelay(down_time);
target.ScaleTo(1, up_time, EasingTypes.OutQuint);
target.FadeOut(up_time, EasingTypes.OutQuint);
target.Animate(
t => t.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint),
t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, EasingTypes.OutQuint)
).Then(
t => t.ScaleTo(1, up_time, EasingTypes.OutQuint),
t => t.FadeOut(up_time, EasingTypes.OutQuint)
);
}
return false;