2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-23 10:16:23 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2017-02-18 19:28:22 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-06-29 01:18:12 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-23 10:16:23 +08:00
|
|
|
|
namespace osu.Game.Overlays
|
|
|
|
|
{
|
2017-06-29 01:18:12 +08:00
|
|
|
|
public abstract partial class WaveOverlayContainer : OsuFocusedOverlayContainer
|
2017-02-23 10:16:23 +08:00
|
|
|
|
{
|
2018-04-15 15:44:40 +08:00
|
|
|
|
protected readonly WaveContainer Waves;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-09-26 13:01:15 +08:00
|
|
|
|
protected override bool BlockNonPositionalInput => true;
|
2018-04-15 15:44:40 +08:00
|
|
|
|
protected override Container<Drawable> Content => Waves;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-09-03 15:28:14 +08:00
|
|
|
|
public const float WIDTH_PADDING = 80;
|
|
|
|
|
|
2019-07-02 14:21:57 +08:00
|
|
|
|
protected override bool StartHidden => true;
|
|
|
|
|
|
2023-08-24 17:13:23 +08:00
|
|
|
|
// `WaveContainer` plays PopIn/PopOut samples, so we disable the overlay-level one as to not double-up sample playback.
|
2023-08-25 00:07:07 +08:00
|
|
|
|
protected override string PopInSampleName => string.Empty;
|
|
|
|
|
protected override string PopOutSampleName => string.Empty;
|
2021-01-15 13:57:46 +08:00
|
|
|
|
|
2023-04-03 08:11:19 +08:00
|
|
|
|
public const float HORIZONTAL_PADDING = 50;
|
|
|
|
|
|
2017-02-23 11:48:24 +08:00
|
|
|
|
protected WaveOverlayContainer()
|
2017-02-23 10:16:23 +08:00
|
|
|
|
{
|
2018-04-15 15:44:40 +08:00
|
|
|
|
AddInternal(Waves = new WaveContainer
|
2017-02-23 10:16:23 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
});
|
2017-02-23 10:22:01 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-23 11:42:31 +08:00
|
|
|
|
protected override void PopIn()
|
|
|
|
|
{
|
2018-04-15 15:44:40 +08:00
|
|
|
|
Waves.Show();
|
2019-07-02 14:17:35 +08:00
|
|
|
|
this.FadeIn(100, Easing.OutQuint);
|
2017-02-23 11:42:31 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-02-23 11:42:31 +08:00
|
|
|
|
protected override void PopOut()
|
|
|
|
|
{
|
2017-03-04 06:05:43 +08:00
|
|
|
|
base.PopOut();
|
2019-07-02 14:17:35 +08:00
|
|
|
|
|
2018-04-15 15:44:40 +08:00
|
|
|
|
Waves.Hide();
|
2019-07-02 14:17:35 +08:00
|
|
|
|
this.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.InQuint);
|
2017-02-23 10:16:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|