1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 15:22:56 +08:00

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 @@ namespace osu.Game.Overlays.Mods
{ {
base.PopOut(); base.PopOut();
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, CONTENT_DURATION, EasingTypes.InSine); rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, EasingTypes.InSine);
rankedMultiplerContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine); rankedMultiplerContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
foreach (ModSection section in sections) foreach (ModSection section in sections)
{ {
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), CONTENT_DURATION, EasingTypes.InSine); section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, EasingTypes.InSine);
section.ButtonsContainer.MoveToX(100f, CONTENT_DURATION, EasingTypes.InSine); section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, EasingTypes.InSine);
section.ButtonsContainer.FadeOut(CONTENT_DURATION, EasingTypes.InSine); section.ButtonsContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine);
} }
TriggerFocusLost(); TriggerFocusLost();

View File

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