From 5911105298b007c83d5d38446ea5cc90965a21ef Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 17 Jun 2019 20:59:17 +0900 Subject: [PATCH] Make team editor prettier --- .../Screens/Teams/TeamsEditorScreen.cs | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs index b6110d6816..c20073907d 100644 --- a/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs +++ b/osu.Game.Tournament/Screens/Teams/TeamsEditorScreen.cs @@ -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), }, } },