From 10ee8ed8e86c392015a29ffa81c8798101066fd0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 15 Dec 2020 13:02:38 +0900 Subject: [PATCH] Reorder functions and simplify transform logic --- osu.Game/Screens/Import/FileImportScreen.cs | 34 ++++++++++----------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/osu.Game/Screens/Import/FileImportScreen.cs b/osu.Game/Screens/Import/FileImportScreen.cs index 5f7888d743..329623e03a 100644 --- a/osu.Game/Screens/Import/FileImportScreen.cs +++ b/osu.Game/Screens/Import/FileImportScreen.cs @@ -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 _) { // 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))