mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
ca87b42758
# Conflicts: # osu.Game/Screens/Multi/Multiplayer.cs
113 lines
3.4 KiB
C#
113 lines
3.4 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.Allocation;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.Graphics.Shapes;
|
|
using osu.Framework.Screens;
|
|
using osu.Game.Graphics;
|
|
using osu.Game.Graphics.Backgrounds;
|
|
using osu.Game.Graphics.Containers;
|
|
using osu.Game.Screens.Menu;
|
|
using osu.Game.Screens.Multi.Lounge;
|
|
|
|
namespace osu.Game.Screens.Multi
|
|
{
|
|
[Cached]
|
|
public class Multiplayer : OsuScreen
|
|
{
|
|
private readonly MultiplayerWaveContainer waves;
|
|
|
|
public Multiplayer()
|
|
{
|
|
Child = waves = new MultiplayerWaveContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
};
|
|
|
|
LoungeScreen loungeScreen;
|
|
waves.AddRange(new Drawable[]
|
|
{
|
|
new Container
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Masking = true,
|
|
Children = new Drawable[]
|
|
{
|
|
new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Colour = OsuColour.FromHex(@"3e3a44"),
|
|
},
|
|
new Triangles
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
ColourLight = OsuColour.FromHex(@"3c3842"),
|
|
ColourDark = OsuColour.FromHex(@"393540"),
|
|
TriangleScale = 5,
|
|
},
|
|
},
|
|
},
|
|
new Container
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Padding = new MarginPadding { Top = Header.HEIGHT },
|
|
Child = loungeScreen = new LoungeScreen(),
|
|
},
|
|
new Header(loungeScreen)
|
|
});
|
|
|
|
loungeScreen.Exited += s => Exit();
|
|
}
|
|
|
|
protected override void OnEntering(Screen last)
|
|
{
|
|
base.OnEntering(last);
|
|
waves.Show();
|
|
}
|
|
|
|
protected override bool OnExiting(Screen next)
|
|
{
|
|
waves.Hide();
|
|
return base.OnExiting(next);
|
|
}
|
|
|
|
protected override void OnResuming(Screen last)
|
|
{
|
|
base.OnResuming(last);
|
|
|
|
Content.FadeIn(250);
|
|
Content.ScaleTo(1, 250, Easing.OutSine);
|
|
}
|
|
|
|
protected override void OnSuspending(Screen next)
|
|
{
|
|
Content.ScaleTo(1.1f, 250, Easing.InSine);
|
|
Content.FadeOut(250);
|
|
|
|
base.OnSuspending(next);
|
|
}
|
|
|
|
protected override void LogoExiting(OsuLogo logo)
|
|
{
|
|
// the wave overlay transition takes longer than expected to run.
|
|
logo.Delay(WaveContainer.DISAPPEAR_DURATION / 2).FadeOut();
|
|
base.LogoExiting(logo);
|
|
}
|
|
|
|
private class MultiplayerWaveContainer : WaveContainer
|
|
{
|
|
protected override bool StartHidden => true;
|
|
|
|
public MultiplayerWaveContainer()
|
|
{
|
|
FirstWaveColour = OsuColour.FromHex(@"654d8c");
|
|
SecondWaveColour = OsuColour.FromHex(@"554075");
|
|
ThirdWaveColour = OsuColour.FromHex(@"44325e");
|
|
FourthWaveColour = OsuColour.FromHex(@"392850");
|
|
}
|
|
}
|
|
}
|
|
}
|