2019-03-04 13:24:19 +09: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-10-14 05:19:50 +09:00
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2018-11-04 21:15:02 +09:00
|
|
|
using osu.Framework.Allocation;
|
2019-03-02 13:40:43 +09:00
|
|
|
using osu.Framework.Bindables;
|
2018-10-14 05:19:50 +09:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Game.Tournament.Components;
|
2019-06-18 14:51:48 +09:00
|
|
|
using osu.Game.Tournament.Models;
|
2018-11-22 10:25:30 +09:00
|
|
|
using osuTK;
|
2018-10-14 05:19:50 +09:00
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Screens.TeamIntro
|
|
|
|
{
|
2021-07-17 00:14:48 +09:00
|
|
|
public class TeamIntroScreen : TournamentMatchScreen, IProvideVideo
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2018-11-07 01:20:32 +09:00
|
|
|
private Container mainContainer;
|
2018-11-04 21:15:02 +09:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-01-15 01:06:39 +01:00
|
|
|
private void load()
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
2018-11-07 01:20:32 +09:00
|
|
|
InternalChildren = new Drawable[]
|
2018-11-06 20:13:04 +09:00
|
|
|
{
|
2020-03-06 18:38:29 +09:00
|
|
|
new TourneyVideo("teamintro")
|
2018-11-07 01:20:32 +09:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
Loop = true,
|
|
|
|
},
|
|
|
|
mainContainer = new Container
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
}
|
2018-11-06 20:13:04 +09:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-07-17 00:14:48 +09:00
|
|
|
protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match)
|
2018-11-06 20:13:04 +09:00
|
|
|
{
|
2021-07-17 00:14:48 +09:00
|
|
|
base.CurrentMatchChanged(match);
|
|
|
|
|
|
|
|
mainContainer.Clear();
|
|
|
|
|
2019-06-18 14:57:05 +09:00
|
|
|
if (match.NewValue == null)
|
2018-11-06 20:13:04 +09:00
|
|
|
return;
|
|
|
|
|
2020-03-08 18:40:13 +09:00
|
|
|
const float y_flag_offset = 292;
|
2020-03-06 16:08:12 +09:00
|
|
|
|
|
|
|
const float y_offset = 460;
|
|
|
|
|
2018-11-07 01:20:32 +09:00
|
|
|
mainContainer.Children = new Drawable[]
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2020-03-06 16:08:12 +09:00
|
|
|
new RoundDisplay(match.NewValue)
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2020-03-06 16:08:12 +09:00
|
|
|
Position = new Vector2(100, 100)
|
2018-10-14 05:19:50 +09:00
|
|
|
},
|
2020-03-06 16:08:12 +09:00
|
|
|
new DrawableTeamFlag(match.NewValue.Team1.Value)
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2020-03-08 18:40:13 +09:00
|
|
|
Position = new Vector2(165, y_flag_offset),
|
2018-10-14 05:19:50 +09:00
|
|
|
},
|
2020-03-06 16:08:12 +09:00
|
|
|
new DrawableTeamWithPlayers(match.NewValue.Team1.Value, TeamColour.Red)
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2020-03-08 18:40:13 +09:00
|
|
|
Position = new Vector2(165, y_offset),
|
2020-03-06 16:08:12 +09:00
|
|
|
},
|
|
|
|
new DrawableTeamFlag(match.NewValue.Team2.Value)
|
2018-10-25 01:29:08 +09:00
|
|
|
{
|
2020-03-06 16:08:12 +09:00
|
|
|
Position = new Vector2(740, y_flag_offset),
|
|
|
|
},
|
|
|
|
new DrawableTeamWithPlayers(match.NewValue.Team2.Value, TeamColour.Blue)
|
2018-10-14 05:19:50 +09:00
|
|
|
{
|
2020-03-06 16:08:12 +09:00
|
|
|
Position = new Vector2(740, y_offset),
|
|
|
|
},
|
|
|
|
};
|
2018-10-14 05:19:50 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|