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