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.
|
2019-01-25 18:32:37 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-01-25 18:32:37 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Screens;
|
|
|
|
|
|
2020-12-25 23:50:00 +08:00
|
|
|
|
namespace osu.Game.Screens.OnlinePlay
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2020-12-26 00:05:29 +08:00
|
|
|
|
public abstract class OnlinePlaySubScreen : OsuScreen, IOnlinePlaySubScreen
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2019-02-11 18:11:34 +08:00
|
|
|
|
public override bool DisallowExternalBeatmapRulesetChanges => false;
|
2019-01-25 18:32:37 +08:00
|
|
|
|
|
|
|
|
|
public virtual string ShortTitle => Title;
|
|
|
|
|
|
|
|
|
|
[Resolved(CanBeNull = true)]
|
2019-02-11 18:11:34 +08:00
|
|
|
|
protected IRoomManager RoomManager { get; private set; }
|
2019-01-25 18:32:37 +08:00
|
|
|
|
|
2020-12-26 00:02:35 +08:00
|
|
|
|
protected OnlinePlaySubScreen()
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2019-01-25 19:47:31 +08:00
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Origin = Anchor.Centre;
|
2019-01-25 18:32:37 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-20 17:03:53 +08:00
|
|
|
|
public const double APPEAR_DURATION = 800;
|
|
|
|
|
|
|
|
|
|
public const double DISAPPEAR_DURATION = 500;
|
|
|
|
|
|
2022-04-21 23:52:44 +08:00
|
|
|
|
public override void OnEntering(ScreenTransitionEvent e)
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2022-04-21 23:52:44 +08:00
|
|
|
|
base.OnEntering(e);
|
2020-02-20 17:03:53 +08:00
|
|
|
|
this.FadeInFromZero(APPEAR_DURATION, Easing.OutQuint);
|
2019-01-25 18:32:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-21 23:52:44 +08:00
|
|
|
|
public override bool OnExiting(ScreenExitEvent e)
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2022-04-21 23:52:44 +08:00
|
|
|
|
base.OnExiting(e);
|
2020-02-20 17:03:53 +08:00
|
|
|
|
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
|
2019-01-25 18:32:37 +08:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-21 23:52:44 +08:00
|
|
|
|
public override void OnResuming(ScreenTransitionEvent e)
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2022-04-21 23:52:44 +08:00
|
|
|
|
base.OnResuming(e);
|
2021-08-19 17:25:40 +08:00
|
|
|
|
this.FadeIn(APPEAR_DURATION, Easing.OutQuint);
|
2019-01-25 18:32:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-04-21 23:52:44 +08:00
|
|
|
|
public override void OnSuspending(ScreenTransitionEvent e)
|
2019-01-25 18:32:37 +08:00
|
|
|
|
{
|
2022-04-21 23:52:44 +08:00
|
|
|
|
base.OnSuspending(e);
|
2020-02-20 17:03:53 +08:00
|
|
|
|
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
|
2019-01-25 18:32:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() => Title;
|
|
|
|
|
}
|
|
|
|
|
}
|