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-05-22 10:00:02 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Screens;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
|
2018-12-10 18:20:41 +08:00
|
|
|
|
namespace osu.Game.Screens.Multi
|
2018-05-22 10:00:02 +08:00
|
|
|
|
{
|
2018-12-26 19:05:57 +08:00
|
|
|
|
public abstract class MultiplayerSubScreen : OsuScreen, IMultiplayerSubScreen
|
2018-05-22 10:00:02 +08:00
|
|
|
|
{
|
2018-12-07 15:20:05 +08:00
|
|
|
|
protected virtual Drawable TransitionContent => Content;
|
2018-05-22 10:00:02 +08:00
|
|
|
|
|
2018-12-04 16:43:44 +08:00
|
|
|
|
public virtual string ShortTitle => Title;
|
2018-05-29 15:23:29 +08:00
|
|
|
|
|
2018-05-22 10:00:02 +08:00
|
|
|
|
protected override void OnEntering(Screen last)
|
|
|
|
|
{
|
|
|
|
|
base.OnEntering(last);
|
|
|
|
|
|
2018-06-20 16:25:22 +08:00
|
|
|
|
Content.FadeInFromZero(WaveContainer.APPEAR_DURATION, Easing.OutQuint);
|
|
|
|
|
TransitionContent.FadeInFromZero(WaveContainer.APPEAR_DURATION, Easing.OutQuint);
|
|
|
|
|
TransitionContent.MoveToX(200).MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint);
|
2018-05-22 10:00:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override bool OnExiting(Screen next)
|
|
|
|
|
{
|
2018-06-20 16:25:22 +08:00
|
|
|
|
Content.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
|
|
|
|
|
TransitionContent.MoveToX(200, WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
|
2018-05-22 10:00:02 +08:00
|
|
|
|
|
|
|
|
|
return base.OnExiting(next);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnResuming(Screen last)
|
|
|
|
|
{
|
|
|
|
|
base.OnResuming(last);
|
|
|
|
|
|
2018-06-20 16:25:22 +08:00
|
|
|
|
Content.FadeIn(WaveContainer.APPEAR_DURATION, Easing.OutQuint);
|
|
|
|
|
TransitionContent.MoveToX(0, WaveContainer.APPEAR_DURATION, Easing.OutQuint);
|
2018-05-22 10:00:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnSuspending(Screen next)
|
|
|
|
|
{
|
|
|
|
|
base.OnSuspending(next);
|
|
|
|
|
|
2018-06-20 16:25:22 +08:00
|
|
|
|
Content.FadeOut(WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
|
|
|
|
|
TransitionContent.MoveToX(-200, WaveContainer.DISAPPEAR_DURATION, Easing.OutQuint);
|
2018-05-22 10:00:02 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|