1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-28 00:23:21 +08:00

Improve animations

This commit is contained in:
Andrei Zavatski 2020-01-09 00:06:28 +03:00
parent 1dbae21f98
commit 6cb763a019

View File

@ -86,9 +86,6 @@ namespace osu.Game.Overlays.Rankings
private void onCountryChanged(ValueChangedEvent<Country> country) private void onCountryChanged(ValueChangedEvent<Country> country)
{ {
content.ClearTransforms();
countryPill.ClearTransforms();
if (country.NewValue == null) if (country.NewValue == null)
{ {
countryPill.Collapse(); countryPill.Collapse();
@ -98,7 +95,8 @@ namespace osu.Game.Overlays.Rankings
} }
this.ResizeHeightTo(height, duration, Easing.OutQuint); this.ResizeHeightTo(height, duration, Easing.OutQuint);
content.FadeIn(duration, Easing.OutQuint).Finally(_ => countryPill.Expand()); content.FadeIn(duration, Easing.OutQuint);
countryPill.Expand();
} }
private class CountryPill : CircularContainer private class CountryPill : CircularContainer
@ -181,12 +179,14 @@ namespace osu.Game.Overlays.Rankings
public void Expand() public void Expand()
{ {
ClearTransforms();
AutoSizeAxes = Axes.X; AutoSizeAxes = Axes.X;
this.FadeIn(duration, Easing.OutQuint); this.FadeIn(duration, Easing.OutQuint);
} }
public void Collapse() public void Collapse()
{ {
ClearTransforms();
AutoSizeAxes = Axes.None; AutoSizeAxes = Axes.None;
this.ResizeWidthTo(0, duration, Easing.OutQuint); this.ResizeWidthTo(0, duration, Easing.OutQuint);
this.FadeOut(duration, Easing.OutQuint); this.FadeOut(duration, Easing.OutQuint);