1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-12 04:12:56 +08:00

Add filter effect to collection management dialog

This commit is contained in:
Jamie Taylor 2021-10-07 17:56:11 +09:00
parent cc209f0f2d
commit f6458aa26d
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -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);