Fix initial state and shorten disappear animation.

This commit is contained in:
Dean Herbert 2017-02-23 12:47:20 +09:00
parent b33627a750
commit 8d1498a8db
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
2 changed files with 13 additions and 13 deletions

View File

@ -107,14 +107,14 @@ protected override void PopOut()
{
base.PopOut();
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, CONTENT_DURATION, EasingTypes.InSine);
rankedMultiplerContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine);
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, EasingTypes.InSine);
rankedMultiplerContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
foreach (ModSection section in sections)
{
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), CONTENT_DURATION, EasingTypes.InSine);
section.ButtonsContainer.MoveToX(100f, CONTENT_DURATION, EasingTypes.InSine);
section.ButtonsContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine);
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, EasingTypes.InSine);
section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, EasingTypes.InSine);
section.ButtonsContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
}
TriggerFocusLost();

View File

@ -15,7 +15,8 @@ namespace osu.Game.Overlays
{
public abstract class WaveOverlayContainer : OverlayContainer
{
protected const float CONTENT_DURATION = 800;
protected const float APPEAR_DURATION = 800;
protected const float DISAPPEAR_DURATION = 500;
private const EasingTypes easing_show = EasingTypes.OutSine;
private const EasingTypes easing_hide = EasingTypes.InSine;
@ -139,14 +140,14 @@ protected override void PopIn()
foreach (var w in wavesContainer.Children)
w.State = Visibility.Visible;
contentContainer.FadeIn(CONTENT_DURATION, EasingTypes.OutQuint);
contentContainer.MoveToY(0, CONTENT_DURATION, EasingTypes.OutQuint);
contentContainer.FadeIn(APPEAR_DURATION, EasingTypes.OutQuint);
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
}
protected override void PopOut()
{
contentContainer.FadeOut(CONTENT_DURATION, easing_hide);
contentContainer.MoveToY(DrawHeight * 2f, CONTENT_DURATION, easing_hide);
contentContainer.FadeOut(DISAPPEAR_DURATION, EasingTypes.In);
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
foreach (var w in wavesContainer.Children)
w.State = Visibility.Hidden;
@ -183,16 +184,15 @@ public Visibility State
get { return state; }
set
{
if (value == state) return;
state = value;
switch (value)
{
case Visibility.Hidden:
MoveToY(DrawHeight / Height, CONTENT_DURATION, easing_hide);
MoveToY(DrawHeight / Height, DISAPPEAR_DURATION, easing_hide);
break;
case Visibility.Visible:
MoveToY(FinalPosition, CONTENT_DURATION, easing_show);
MoveToY(FinalPosition, APPEAR_DURATION, easing_show);
break;
}
}