1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 16:47:46 +08:00

Update drawings design

This commit is contained in:
Dean Herbert 2018-11-04 04:58:35 +09:00
parent 5006dc47a3
commit b610095ff5
2 changed files with 131 additions and 132 deletions

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Graphics;
using osu.Game.Tournament.Components; using osu.Game.Tournament.Components;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
@ -52,6 +53,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components
Origin = Anchor.Centre, Origin = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.33f),
Masking = true, Masking = true,
CornerRadius = 10f, CornerRadius = 10f,
@ -358,6 +360,7 @@ namespace osu.Game.Tournament.Screens.Drawings.Components
outline = new Box outline = new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.33f),
Alpha = 0 Alpha = 0
}, },
Flag Flag

View File

@ -12,13 +12,14 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Video;
using osu.Framework.IO.Stores; using osu.Framework.IO.Stores;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Screens; using osu.Game.Screens;
using osu.Game.Screens.Backgrounds;
using osu.Game.Tournament.Components; using osu.Game.Tournament.Components;
using osu.Game.Tournament.Screens.Drawings.Components; using osu.Game.Tournament.Screens.Drawings.Components;
using OpenTK; using OpenTK;
@ -32,7 +33,7 @@ namespace osu.Game.Tournament.Screens.Drawings
protected override bool HideOverlaysOnEnter => true; protected override bool HideOverlaysOnEnter => true;
protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); protected override BackgroundScreen CreateBackground() => null;
private ScrollingTeamContainer teamsContainer; private ScrollingTeamContainer teamsContainer;
private GroupContainer groupsContainer; private GroupContainer groupsContainer;
@ -56,6 +57,8 @@ namespace osu.Game.Tournament.Screens.Drawings
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textures, Storage storage) private void load(TextureStore textures, Storage storage)
{ {
RelativeSizeAxes = Axes.Both;
this.storage = storage; this.storage = storage;
TextureStore flagStore = new TextureStore(); TextureStore flagStore = new TextureStore();
@ -79,168 +82,161 @@ namespace osu.Game.Tournament.Screens.Drawings
Children = new Drawable[] Children = new Drawable[]
{ {
new Box // Main container
new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = new Color4(77, 77, 77, 255) Children = new Drawable[]
{
new VideoSprite(@"C:\Users\Dean\BG Logoless - OWC.m4v")
{
RelativeSizeAxes = Axes.Both,
Loop = true,
},
new Sprite
{
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
Texture = textures.Get(@"Backgrounds/Drawings/background.png")
},
// Visualiser
new VisualiserContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Size = new Vector2(1, 10),
Colour = new Color4(255, 204, 34, 255),
Lines = 6
},
// Groups
groupsContainer = new GroupContainer(drawingsConfig.Get<int>(DrawingsConfig.Groups), drawingsConfig.Get<int>(DrawingsConfig.TeamsPerGroup))
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Padding = new MarginPadding
{
Top = 35f,
Bottom = 35f
}
},
// Scrolling teams
teamsContainer = new ScrollingTeamContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
},
// Scrolling team name
fullTeamNameText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.TopCentre,
Position = new Vector2(0, 45f),
Colour = OsuColour.Gray(0.33f),
Alpha = 0,
Font = "Exo2.0-Light",
TextSize = 42f
}
}
}, },
new Sprite // Control panel container
new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill, AlwaysPresent = true,
Texture = textures.Get(@"Backgrounds/Drawings/background.png") Width = 0.15f,
}, Anchor = Anchor.TopRight,
new FillFlowContainer
{
RelativeSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Children = new Drawable[] Children = new Drawable[]
{ {
// Main container new Box
new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Width = 0.85f, Colour = new Color4(54, 54, 54, 255)
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "Control Panel",
TextSize = 22f,
Font = "Exo2.0-Bold"
},
new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Width = 0.75f,
Position = new Vector2(0, 35f),
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[] Children = new Drawable[]
{ {
// Visualiser new TriangleButton
new VisualiserContainer
{ {
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Size = new Vector2(1, 10),
Colour = new Color4(255, 204, 34, 255), Text = "Begin random",
Action = teamsContainer.StartScrolling,
Lines = 6
}, },
// Groups new TriangleButton
groupsContainer = new GroupContainer(drawingsConfig.Get<int>(DrawingsConfig.Groups), drawingsConfig.Get<int>(DrawingsConfig.TeamsPerGroup))
{ {
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X,
Padding = new MarginPadding
{
Top = 35f,
Bottom = 35f
}
},
// Scrolling teams
teamsContainer = new ScrollingTeamContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Text = "Stop random",
Action = teamsContainer.StopScrolling,
}, },
// Scrolling team name new TriangleButton
fullTeamNameText = new OsuSpriteText
{ {
Anchor = Anchor.Centre, RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
Position = new Vector2(0, 45f), Text = "Reload",
Action = reloadTeams
Alpha = 0,
Font = "Exo2.0-Light",
TextSize = 42f
} }
} }
}, },
// Control panel container new FillFlowContainer
new Container
{ {
RelativeSizeAxes = Axes.Both, Anchor = Anchor.BottomCentre,
Width = 0.15f, Origin = Anchor.BottomCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Width = 0.75f,
Position = new Vector2(0, -5f),
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[] Children = new Drawable[]
{ {
new Box new TriangleButton
{ {
RelativeSizeAxes = Axes.Both,
Colour = new Color4(54, 54, 54, 255)
},
new OsuSpriteText
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Text = "Control Panel",
TextSize = 22f,
Font = "Exo2.0-Bold"
},
new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Width = 0.75f,
Position = new Vector2(0, 35f), Text = "Reset",
Action = () => reset()
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[]
{
new TriangleButton
{
RelativeSizeAxes = Axes.X,
Text = "Begin random",
Action = teamsContainer.StartScrolling,
},
new TriangleButton
{
RelativeSizeAxes = Axes.X,
Text = "Stop random",
Action = teamsContainer.StopScrolling,
},
new TriangleButton
{
RelativeSizeAxes = Axes.X,
Text = "Reload",
Action = reloadTeams
}
}
},
new FillFlowContainer
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Width = 0.75f,
Position = new Vector2(0, -5f),
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5f),
Children = new Drawable[]
{
new TriangleButton
{
RelativeSizeAxes = Axes.X,
Text = "Reset",
Action = () => reset()
}
}
} }
} }
} }