Make team editor prettier

This commit is contained in:
Dean Herbert 2019-06-17 20:59:17 +09:00
parent ba884162b2
commit 5911105298
1 changed files with 35 additions and 31 deletions

View File

@ -16,6 +16,7 @@
using osu.Game.Tournament.Components;
using osu.Game.Users;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Tournament.Screens.Teams
{
@ -45,6 +46,7 @@ public TeamsEditorScreen()
AutoSizeAxes = Axes.Y,
LayoutDuration = 200,
LayoutEasing = Easing.OutQuint,
Spacing = new Vector2(20)
},
},
new ControlPanel
@ -88,12 +90,16 @@ public class TeamRow : CompositeDrawable
public TeamRow(TournamentTeam team)
{
PlayerEditor playerEditor;
Margin = new MarginPadding(10);
Team = team;
Masking = true;
CornerRadius = 10;
PlayerEditor playerEditor = new PlayerEditor(Team)
{
Width = 0.95f
};
InternalChildren = new Drawable[]
{
new Box
@ -101,10 +107,16 @@ public TeamRow(TournamentTeam team)
Colour = OsuColour.Gray(0.1f),
RelativeSizeAxes = Axes.Both,
},
drawableContainer = new Container
{
Size = new Vector2(100, 50),
Margin = new MarginPadding(10),
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
},
new FillFlowContainer
{
Margin = new MarginPadding(5),
Padding = new MarginPadding { Right = 160 },
Spacing = new Vector2(5),
Direction = FillDirection.Full,
RelativeSizeAxes = Axes.X,
@ -114,56 +126,40 @@ public TeamRow(TournamentTeam team)
new SettingsTextBox
{
LabelText = "Name",
Width = 0.25f,
Width = 0.2f,
Bindable = Team.FullName
},
new SettingsTextBox
{
LabelText = "Acronym",
Width = 0.25f,
Width = 0.2f,
Bindable = Team.Acronym
},
new SettingsTextBox
{
LabelText = "Flag",
Width = 0.25f,
Width = 0.2f,
Bindable = Team.FlagName
},
drawableContainer = new Container
{
Width = 0.22f,
RelativeSizeAxes = Axes.X,
Height = 50,
},
playerEditor = new PlayerEditor(Team)
}
},
new FillFlowContainer
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
RelativeSizeAxes = Axes.None,
Width = 150,
Spacing = new Vector2(10),
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new SettingsButton
{
RelativeSizeAxes = Axes.X,
Width = 0.11f,
Margin = new MarginPadding(10),
Text = "Add player",
Action = () => playerEditor.AddUser()
},
new DangerousSettingsButton
{
Width = 0.11f,
Text = "Delete Team",
Margin = new MarginPadding(10),
Action = () =>
{
Expire();
ladderInfo.Teams.Remove(Team);
},
}
},
playerEditor
}
},
};
@ -242,8 +238,16 @@ public PlayerRow(TournamentTeam team, User user)
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Masking = true;
CornerRadius = 5;
InternalChildren = new Drawable[]
{
new Box
{
Colour = OsuColour.Gray(0.2f),
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
{
Margin = new MarginPadding(5),
@ -262,7 +266,7 @@ public PlayerRow(TournamentTeam team, User user)
},
drawableContainer = new Container
{
Size = new Vector2(100, 50),
Size = new Vector2(100, 70),
},
}
},