2018-11-06 13:49:09 +08:00
|
|
|
// 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.Graphics.Video;
|
|
|
|
using osu.Framework.Platform;
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
using osu.Game.Screens;
|
|
|
|
using osu.Game.Tournament.Screens.Drawings;
|
2018-11-06 18:23:03 +08:00
|
|
|
using osu.Game.Tournament.Screens.Gameplay;
|
2018-11-06 13:49:09 +08:00
|
|
|
using osu.Game.Tournament.Screens.Ladder;
|
|
|
|
using osu.Game.Tournament.Screens.MapPool;
|
|
|
|
using osu.Game.Tournament.Screens.Showcase;
|
|
|
|
using osu.Game.Tournament.Screens.TeamIntro;
|
|
|
|
using OpenTK;
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Screens
|
|
|
|
{
|
|
|
|
public class TournamentSceneManager : OsuScreen
|
|
|
|
{
|
|
|
|
private LadderManager bracket;
|
|
|
|
private MapPoolScreen mapPool;
|
2018-11-06 18:23:03 +08:00
|
|
|
private GameplayScreen gameplay;
|
2018-11-06 13:49:09 +08:00
|
|
|
private TeamIntroScreen teamIntro;
|
|
|
|
private DrawingsScreen drawings;
|
|
|
|
private Container screens;
|
|
|
|
private ShowcaseScreen showcase;
|
2018-11-11 00:39:02 +08:00
|
|
|
private VideoSprite video;
|
2018-11-06 13:49:09 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(LadderInfo ladder, Storage storage)
|
|
|
|
{
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Y,
|
|
|
|
Width = 200,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new Box
|
|
|
|
{
|
|
|
|
Colour = Color4.Black,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
|
|
|
new FillFlowContainer
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Drawings", Action = () => setScreen(drawings) },
|
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Showcase", Action = () => setScreen(showcase) },
|
2018-11-06 18:23:03 +08:00
|
|
|
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Bracket", Action = () => setScreen(bracket) },
|
2018-11-06 19:13:09 +08:00
|
|
|
new Container { RelativeSizeAxes = Axes.X, Height = 50 },
|
2018-11-06 13:49:09 +08:00
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "TeamIntro", Action = () => setScreen(teamIntro) },
|
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "MapPool", Action = () => setScreen(mapPool) },
|
2018-11-06 18:23:03 +08:00
|
|
|
new OsuButton { RelativeSizeAxes = Axes.X, Text = "Gameplay", Action = () => setScreen(gameplay) },
|
2018-11-06 13:49:09 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
X = 200,
|
|
|
|
FillMode = FillMode.Fit,
|
|
|
|
FillAspectRatio = 16/9f,
|
|
|
|
Anchor = Anchor.TopLeft,
|
|
|
|
Origin = Anchor.TopLeft,
|
|
|
|
Size = new Vector2(0.8f, 1),
|
|
|
|
//Masking = true,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2018-11-11 00:39:02 +08:00
|
|
|
video = new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v"))
|
2018-11-06 13:49:09 +08:00
|
|
|
{
|
|
|
|
Loop = true,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
FillMode = FillMode.Fit,
|
|
|
|
},
|
|
|
|
screens = new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2018-11-08 05:29:04 +08:00
|
|
|
bracket = new LadderManager(),
|
2018-11-06 13:49:09 +08:00
|
|
|
showcase = new ShowcaseScreen(),
|
2018-11-08 05:29:04 +08:00
|
|
|
mapPool = new MapPoolScreen(),
|
2018-11-06 19:13:09 +08:00
|
|
|
teamIntro = new TeamIntroScreen(),
|
2018-11-06 18:23:03 +08:00
|
|
|
drawings = new DrawingsScreen(),
|
|
|
|
gameplay = new GameplayScreen()
|
2018-11-06 13:49:09 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
setScreen(teamIntro);
|
|
|
|
}
|
|
|
|
|
|
|
|
private void setScreen(Drawable screen)
|
|
|
|
{
|
|
|
|
foreach (var s in screens.Children)
|
|
|
|
{
|
|
|
|
if (s == screen)
|
2018-11-11 00:39:02 +08:00
|
|
|
{
|
|
|
|
s.Show();
|
|
|
|
if (s is IProvideVideo)
|
|
|
|
video.FadeOut(200);
|
|
|
|
else
|
|
|
|
video.Show();
|
|
|
|
}
|
2018-11-06 13:49:09 +08:00
|
|
|
else
|
2018-11-11 00:39:02 +08:00
|
|
|
s.Hide();
|
2018-11-06 13:49:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|