osu/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.3 KiB
C#
Raw Normal View History

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