osukey/osu.Game/Overlays/WaveOverlayContainer.cs
2018-12-14 15:41:05 +09:00

45 lines
1.1 KiB
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays
{
public abstract class WaveOverlayContainer : OsuFocusedOverlayContainer
{
protected readonly WaveContainer Waves;
protected override bool BlockNonPositionalInput => true;
protected override Container<Drawable> Content => Waves;
protected WaveOverlayContainer()
{
AddInternal(Waves = new WaveContainer
{
RelativeSizeAxes = Axes.Both,
});
}
protected override void PopIn()
{
base.PopIn();
Waves.Show();
this.FadeIn();
}
protected override void PopOut()
{
base.PopOut();
Waves.Hide();
// this is required or we will remain present even though our waves are hidden.
this.Delay(WaveContainer.DISAPPEAR_DURATION).FadeOut();
}
}
}