1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 03:12:57 +08:00

Merge branch 'master' into start-match-on-gameplay

This commit is contained in:
Dan Balasescu 2020-03-17 18:21:55 +09:00 committed by GitHub
commit c6e4bf35de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 8 deletions

View File

@ -0,0 +1,40 @@
// 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.
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Game.Tournament.Components;
using osu.Game.Tournament.Models;
namespace osu.Game.Tournament.Tests.Components
{
public class TestSceneRoundDisplay : TournamentTestScene
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(DrawableTournamentHeaderText),
typeof(DrawableTournamentHeaderLogo),
};
public TestSceneRoundDisplay()
{
Children = new Drawable[]
{
new RoundDisplay(new TournamentMatch
{
Round =
{
Value = new TournamentRound
{
Name = { Value = "Test Round" }
}
}
})
{
Margin = new MarginPadding(20)
}
};
}
}
}

View File

@ -11,9 +11,13 @@ namespace osu.Game.Tournament.Components
{ {
public class DrawableTournamentHeaderText : CompositeDrawable public class DrawableTournamentHeaderText : CompositeDrawable
{ {
public DrawableTournamentHeaderText() public DrawableTournamentHeaderText(bool center = true)
{ {
InternalChild = new TextSprite(); InternalChild = new TextSprite
{
Anchor = center ? Anchor.Centre : Anchor.TopLeft,
Origin = center ? Anchor.Centre : Anchor.TopLeft,
};
Height = 22; Height = 22;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -27,9 +31,6 @@ namespace osu.Game.Tournament.Components
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
FillMode = FillMode.Fit; FillMode = FillMode.Fit;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Texture = textures.Get("header-text"); Texture = textures.Get("header-text");
} }
} }

View File

@ -12,19 +12,27 @@ namespace osu.Game.Tournament.Components
{ {
public RoundDisplay(TournamentMatch match) public RoundDisplay(TournamentMatch match)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
new DrawableTournamentHeaderText(), new DrawableTournamentHeaderText(false)
{
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
},
new TournamentSpriteText new TournamentSpriteText
{ {
Anchor = Anchor.TopLeft,
Origin = Anchor.TopLeft,
Text = match.Round.Value?.Name.Value ?? "Unknown Round", Text = match.Round.Value?.Name.Value ?? "Unknown Round",
Font = OsuFont.Torus.With(size: 26, weight: FontWeight.SemiBold) Font = OsuFont.Torus.With(size: 26, weight: FontWeight.SemiBold)
}, },

View File

@ -136,5 +136,10 @@ namespace osu.Game.Graphics
/// Equivalent to weight 700. /// Equivalent to weight 700.
/// </summary> /// </summary>
Bold = 700, Bold = 700,
/// <summary>
/// Equivalent to weight 900.
/// </summary>
Black = 900
} }
} }