From f6458aa26d9b7cba848faea8ab1a1e75ad8e88ec Mon Sep 17 00:00:00 2001 From: Jamie Taylor Date: Thu, 7 Oct 2021 17:56:11 +0900 Subject: [PATCH] Add filter effect to collection management dialog --- osu.Game/Collections/ManageCollectionsDialog.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Collections/ManageCollectionsDialog.cs b/osu.Game/Collections/ManageCollectionsDialog.cs index 680fec904f..c239396a41 100644 --- a/osu.Game/Collections/ManageCollectionsDialog.cs +++ b/osu.Game/Collections/ManageCollectionsDialog.cs @@ -2,11 +2,13 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Audio; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; +using osu.Game.Audio.Effects; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; @@ -19,6 +21,7 @@ namespace osu.Game.Collections { private const double enter_duration = 500; private const double exit_duration = 200; + private Filter lpFilter; [Resolved(CanBeNull = true)] private CollectionManager collectionManager { get; set; } @@ -36,7 +39,7 @@ namespace osu.Game.Collections } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, AudioManager audio) { Children = new Drawable[] { @@ -108,7 +111,8 @@ namespace osu.Game.Collections }, } } - } + }, + lpFilter = new Filter(audio.TrackMixer) }; } @@ -116,6 +120,7 @@ namespace osu.Game.Collections { base.PopIn(); + lpFilter.CutoffTo(300, 100, Easing.OutCubic); this.FadeIn(enter_duration, Easing.OutQuint); this.ScaleTo(0.9f).Then().ScaleTo(1f, enter_duration, Easing.OutQuint); } @@ -124,6 +129,7 @@ namespace osu.Game.Collections { base.PopOut(); + lpFilter.CutoffTo(lpFilter.MaxCutoff, 100, Easing.InCubic); this.FadeOut(exit_duration, Easing.OutQuint); this.ScaleTo(0.9f, exit_duration);