From e893925417d9b7bd2a453e6ec2e9d5429d0372b2 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 May 2019 15:19:23 +0900 Subject: [PATCH] Move shadow fade logic --- osu.Game/Overlays/BeatmapSetOverlay.cs | 12 +++--------- osu.Game/Overlays/FullscreenOverlay.cs | 17 +++++++++++++++++ osu.Game/Overlays/UserProfileOverlay.cs | 12 ------------ 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index 2cf400f776..3ed398d31a 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -84,16 +84,10 @@ namespace osu.Game.Overlays this.rulesets = rulesets; } - protected override void PopIn() + protected override void PopOutComplete() { - base.PopIn(); - FadeEdgeEffectTo(0.25f, WaveContainer.APPEAR_DURATION, Easing.In); - } - - protected override void PopOut() - { - base.PopOut(); - FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out).OnComplete(_ => beatmapSet.Value = null); + base.PopOutComplete(); + beatmapSet.Value = null; } protected override bool OnClick(ClickEvent e) diff --git a/osu.Game/Overlays/FullscreenOverlay.cs b/osu.Game/Overlays/FullscreenOverlay.cs index 36de40be3e..921dcd316d 100644 --- a/osu.Game/Overlays/FullscreenOverlay.cs +++ b/osu.Game/Overlays/FullscreenOverlay.cs @@ -6,6 +6,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Effects; using osu.Game.Graphics; +using osu.Game.Graphics.Containers; using osu.Game.Online.API; using osuTK.Graphics; @@ -39,6 +40,22 @@ namespace osu.Game.Overlays }; } + protected override void PopIn() + { + base.PopIn(); + FadeEdgeEffectTo(0.4f, WaveContainer.APPEAR_DURATION, Easing.Out); + } + + protected override void PopOut() + { + base.PopOut(); + FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.In).OnComplete(_ => PopOutComplete()); + } + + protected virtual void PopOutComplete() + { + } + protected override void LoadComplete() { base.LoadComplete(); diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 2d2840107d..8a133a1d1e 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -28,18 +28,6 @@ namespace osu.Game.Overlays public const float CONTENT_X_MARGIN = 70; - protected override void PopIn() - { - base.PopIn(); - FadeEdgeEffectTo(0.5f, WaveContainer.APPEAR_DURATION, Easing.In); - } - - protected override void PopOut() - { - base.PopOut(); - FadeEdgeEffectTo(0, WaveContainer.DISAPPEAR_DURATION, Easing.Out); - } - public void ShowUser(long userId) => ShowUser(new User { Id = userId }); public void ShowUser(User user, bool fetchOnline = true)