Wave animation fine tuning

This commit is contained in:
DrabWeb
2017-02-18 11:21:41 -04:00
parent d1af050355
commit a024353574
3 changed files with 39 additions and 33 deletions

View File

@ -54,7 +54,6 @@ namespace osu.Game.Overlays.Mods
else if (value <= -2) else if (value <= -2)
{ {
_selectedMod = Mods.Length - 1; _selectedMod = Mods.Length - 1;
}
} }
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic); iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic);

View File

@ -23,8 +23,8 @@ namespace osu.Game.Overlays.Mods
{ {
public class ModSelectOverlay : WaveOverlayContainer public class ModSelectOverlay : WaveOverlayContainer
{ {
private readonly int button_duration = 800; // 1000 private readonly int button_duration = 700;
private readonly int ranked_multiplier_duration = 800; // 1000 private readonly int ranked_multiplier_duration = 700;
private readonly float content_width = 0.8f; private readonly float content_width = 0.8f;
private Color4 low_multiplier_colour; private Color4 low_multiplier_colour;
@ -124,14 +124,14 @@ namespace osu.Game.Overlays.Mods
protected override void TransitionOut() protected override void TransitionOut()
{ {
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, close_duration, EasingTypes.InSine); rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, content_exit_duration, EasingTypes.InSine);
rankedMultiplerContainer.FadeOut(close_duration, EasingTypes.InSine); rankedMultiplerContainer.FadeOut(content_exit_duration, EasingTypes.InSine);
foreach (ModSection section in sections) foreach (ModSection section in sections)
{ {
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), close_duration, EasingTypes.InSine); section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), content_exit_duration, EasingTypes.InSine);
section.ButtonsContainer.MoveToX(100f, close_duration, EasingTypes.InSine); section.ButtonsContainer.MoveToX(100f, content_exit_duration, EasingTypes.InSine);
section.ButtonsContainer.FadeTo(0.01f, close_duration, EasingTypes.InSine); // TODO: Fix this so 0.01 opacity isn't used section.ButtonsContainer.FadeTo(0.01f, content_exit_duration, EasingTypes.InSine); // TODO: Fix this so 0.01 opacity isn't used
} }
} }
@ -252,8 +252,8 @@ namespace osu.Game.Overlays.Mods
Height = 548; // TODO: Remove when autosize works Height = 548; // TODO: Remove when autosize works
//AutoSizeAxes = Axes.Y; //AutoSizeAxes = Axes.Y;
//Content.RelativeSizeAxes = Axes.X; Content.RelativeSizeAxes = Axes.X;
//Content.AutoSizeAxes = Axes.Y; Content.AutoSizeAxes = Axes.Y;
Children = new Drawable[] Children = new Drawable[]
{ {
new Container new Container

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays
private readonly float second_wave_position = 0; private readonly float second_wave_position = 0;
private readonly float third_wave_position = 70; private readonly float third_wave_position = 70;
private readonly float fourth_wave_position = 100; private readonly float fourth_wave_position = 100;
private readonly float container_position = -150; private readonly float waves_container_position = -150;
private float[] wave_positions private float[] wave_positions
{ {
get get
@ -26,15 +26,15 @@ namespace osu.Game.Overlays
} }
} }
private readonly float first_wave_duration = 700; private readonly float first_wave_duration = 600;
private readonly float second_wave_duration = 800; private readonly float second_wave_duration = 700;
private readonly float third_wave_duration = 900; private readonly float third_wave_duration = 800;
private readonly float fourth_wave_duration = 1000; private readonly float fourth_wave_duration = 900;
private readonly float container_wait = 300; private readonly float container_wait = 200;
private readonly float container_duration = 500; private readonly float waves_container_duration = 400;
private readonly float content_duration = 800; private readonly float content_duration = 700;
internal readonly float close_duration = 500; private readonly float content_transition_wait = 100;
private readonly float content_transition_wait = 150; // 100 internal readonly float content_exit_duration = 600;
private float [] wave_durations private float [] wave_durations
{ {
get get
@ -121,11 +121,13 @@ namespace osu.Game.Overlays
} }
} }
// TODO: Remove when framework updated
public override bool HandleInput => State == Visibility.Visible;
protected override void PopIn() protected override void PopIn()
{ {
base.Show(); base.Show();
FadeIn();
for (int i = 0; i < waves.Length; i++) for (int i = 0; i < waves.Length; i++)
{ {
waves[i].MoveToY(wave_positions[i], wave_durations[i], EasingTypes.OutQuint); waves[i].MoveToY(wave_positions[i], wave_durations[i], EasingTypes.OutQuint);
@ -137,7 +139,7 @@ namespace osu.Game.Overlays
{ {
if (State == Visibility.Visible) if (State == Visibility.Visible)
{ {
wavesContainer.MoveToY(container_position, container_duration, EasingTypes.None); wavesContainer.MoveToY(waves_container_position, waves_container_duration, EasingTypes.None);
contentContainer.FadeIn(content_duration, EasingTypes.OutQuint); contentContainer.FadeIn(content_duration, EasingTypes.OutQuint);
contentContainer.MoveToY(0, content_duration, EasingTypes.OutQuint); contentContainer.MoveToY(0, content_duration, EasingTypes.OutQuint);
@ -151,21 +153,26 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
FadeIn(); base.Hide();
foreach (Container wave in waves)
{
wave.MoveToY(DrawHeight, close_duration, EasingTypes.InSine);
}
wavesContainer.MoveToY(0, close_duration, EasingTypes.InSine);
contentContainer.MoveToY(DrawHeight, close_duration, EasingTypes.InSine);
contentContainer.FadeOut(close_duration, EasingTypes.InSine);
contentContainer.FadeOut(content_exit_duration, EasingTypes.InSine);
contentContainer.MoveToY(DrawHeight, content_exit_duration, EasingTypes.InSine);
TransitionOut(); TransitionOut();
for (int i = 0; i < waves.Length; i++)
{
waves[i].MoveToY(DrawHeight, second_wave_duration, EasingTypes.InSine);
}
DelayReset(); DelayReset();
Delay(close_duration); Delay(container_wait);
Schedule(() => { if (State == Visibility.Hidden) FadeOut(); }); Schedule(() =>
{
if (State == Visibility.Hidden)
{
wavesContainer.MoveToY(0, waves_container_duration, EasingTypes.None);
}
});
} }
protected abstract void TransitionOut(); protected abstract void TransitionOut();