Reorder functions and simplify transform logic

This commit is contained in:
Dean Herbert 2020-12-15 13:02:38 +09:00
parent 0d4ac2f748
commit 10ee8ed8e8

View File

@ -119,6 +119,22 @@ namespace osu.Game.Screens.Import
fileSelector.CurrentPath.BindValueChanged(directoryChanged);
}
public override void OnEntering(IScreen last)
{
base.OnEntering(last);
contentContainer.ScaleTo(0.95f).ScaleTo(1, duration, Easing.OutQuint);
this.FadeInFromZero(duration);
}
public override bool OnExiting(IScreen next)
{
contentContainer.ScaleTo(0.95f, duration, Easing.OutQuint);
this.FadeOut(duration, Easing.OutQuint);
return base.OnExiting(next);
}
private void directoryChanged(ValueChangedEvent<DirectoryInfo> _)
{
// this should probably be done by the selector itself, but let's do it here for now.
@ -131,24 +147,6 @@ namespace osu.Game.Screens.Import
currentFileText.Text = selectedFile.NewValue?.Name ?? "Select a file";
}
public override void OnEntering(IScreen last)
{
base.OnEntering(last);
contentContainer.FadeOut().Then().ScaleTo(0.95f)
.Then()
.ScaleTo(1, duration, Easing.OutQuint)
.FadeIn(duration);
}
public override bool OnExiting(IScreen next)
{
contentContainer.ScaleTo(0.95f, duration, Easing.OutQuint);
this.FadeOut(duration, Easing.OutQuint);
return base.OnExiting(next);
}
private void startImport(string path)
{
if (string.IsNullOrEmpty(path))