1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 00:52:59 +08:00
osu-lazer/osu.Game/Screens/OnlinePlay/OnlinePlaySubScreen.cs

60 lines
1.7 KiB
C#
Raw Normal View History

// 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
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Screens;
namespace osu.Game.Screens.OnlinePlay
2019-01-25 18:32:37 +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 override bool? AllowTrackAdjustments => true;
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
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;
}
public const double APPEAR_DURATION = 800;
public const double DISAPPEAR_DURATION = 500;
2019-02-11 18:11:34 +08:00
public override void OnEntering(IScreen last)
2019-01-25 18:32:37 +08:00
{
base.OnEntering(last);
this.FadeInFromZero(APPEAR_DURATION, Easing.OutQuint);
2019-01-25 18:32:37 +08:00
}
2019-02-11 18:11:34 +08:00
public override bool OnExiting(IScreen next)
2019-01-25 18:32:37 +08:00
{
base.OnExiting(next);
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
2019-01-25 18:32:37 +08:00
return false;
}
2019-02-11 18:11:34 +08:00
public override void OnResuming(IScreen last)
2019-01-25 18:32:37 +08:00
{
base.OnResuming(last);
this.FadeIn(APPEAR_DURATION, Easing.OutQuint);
2019-01-25 18:32:37 +08:00
}
2019-02-11 18:11:34 +08:00
public override void OnSuspending(IScreen next)
2019-01-25 18:32:37 +08:00
{
base.OnSuspending(next);
this.FadeOut(DISAPPEAR_DURATION, Easing.OutQuint);
2019-01-25 18:32:37 +08:00
}
public override string ToString() => Title;
}
}