1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-30 13:59:40 +08:00
osu-lazer/osu.Game.Tournament/Screens/TeamIntro/TeamIntroScreen.cs

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

78 lines
2.3 KiB
C#
Raw Normal View History

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.
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;
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;
using osuTK;
namespace osu.Game.Tournament.Screens.TeamIntro
{
public class TeamIntroScreen : TournamentMatchScreen
{
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()
{
RelativeSizeAxes = Axes.Both;
2018-11-07 00:20:32 +08:00
InternalChildren = new Drawable[]
2018-11-06 19:13:04 +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
};
}
protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match)
2018-11-06 19:13:04 +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;
const float y_flag_offset = 292;
const float y_offset = 460;
2018-11-07 00:20:32 +08: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),
},
};
}
}
}