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

Merge pull request #8170 from peppy/tournament-base-changes

Apply tournament client usability changes
This commit is contained in:
Dan Balasescu 2020-03-09 10:15:10 +09:00 committed by GitHub
commit a04b651fea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 52 additions and 24 deletions

View File

@ -66,6 +66,10 @@ namespace osu.Game.Tournament.Components
} }
} }
public void Expand() => this.FadeIn(300);
public void Contract() => this.FadeOut(200);
protected override ChatLine CreateMessage(Message message) => new MatchMessage(message); protected override ChatLine CreateMessage(Message message) => new MatchMessage(message);
protected class MatchMessage : StandAloneMessage protected class MatchMessage : StandAloneMessage

View File

@ -90,6 +90,8 @@ namespace osu.Game.Tournament.Models
[JsonIgnore] [JsonIgnore]
public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value; public TournamentTeam Loser => !Completed.Value ? null : Team1Score.Value > Team2Score.Value ? Team2.Value : Team1.Value;
public TeamColour WinnerColour => Winner == Team1.Value ? TeamColour.Red : TeamColour.Blue;
public int PointsToWin => Round.Value?.BestOf.Value / 2 + 1 ?? 0; public int PointsToWin => Round.Value?.BestOf.Value / 2 + 1 ?? 0;
/// <summary> /// <summary>

View File

@ -40,7 +40,6 @@ namespace osu.Game.Tournament.Screens.Editors
new OsuScrollContainer new OsuScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Width = 0.9f,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Child = flow = new FillFlowContainer<TDrawable> Child = flow = new FillFlowContainer<TDrawable>

View File

@ -162,7 +162,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
void expand() void expand()
{ {
chat?.Expand(); chat?.Contract();
using (BeginDelayedSequence(300, true)) using (BeginDelayedSequence(300, true))
{ {
@ -176,7 +176,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
SongBar.Expanded = false; SongBar.Expanded = false;
scoreDisplay.FadeOut(100); scoreDisplay.FadeOut(100);
using (chat?.BeginDelayedSequence(500)) using (chat?.BeginDelayedSequence(500))
chat?.Contract(); chat?.Expand();
} }
switch (state.NewValue) switch (state.NewValue)
@ -203,7 +203,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
break; break;
default: default:
chat.Expand(); chat.Contract();
expand(); expand();
break; break;
} }

View File

@ -2,15 +2,25 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Game.Graphics;
using osu.Game.Graphics.Cursor; using osu.Game.Graphics.Cursor;
using osu.Game.Tournament.Models;
using osuTK.Graphics; using osuTK.Graphics;
namespace osu.Game.Tournament namespace osu.Game.Tournament
{ {
public class TournamentGame : TournamentGameBase public class TournamentGame : TournamentGameBase
{ {
public static readonly Color4 COLOUR_RED = new Color4(144, 0, 0, 255); public static ColourInfo GetTeamColour(TeamColour teamColour) => teamColour == TeamColour.Red ? COLOUR_RED : COLOUR_BLUE;
public static readonly Color4 COLOUR_BLUE = new Color4(0, 84, 144, 255);
public static readonly Color4 COLOUR_RED = OsuColour.FromHex("#AA1414");
public static readonly Color4 COLOUR_BLUE = OsuColour.FromHex("#1462AA");
public static readonly Color4 ELEMENT_BACKGROUND_COLOUR = OsuColour.FromHex("#fff");
public static readonly Color4 ELEMENT_FOREGROUND_COLOUR = OsuColour.FromHex("#000");
public static readonly Color4 TEXT_COLOUR = OsuColour.FromHex("#fff");
protected override void LoadComplete() protected override void LoadComplete()
{ {

View File

@ -22,6 +22,7 @@ using osu.Game.Online.API.Requests;
using osu.Game.Tournament.IPC; using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models; using osu.Game.Tournament.Models;
using osu.Game.Users; using osu.Game.Users;
using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Input; using osuTK.Input;
@ -74,17 +75,41 @@ namespace osu.Game.Tournament
AddRange(new[] AddRange(new[]
{ {
new Container
{
CornerRadius = 10,
Depth = float.MinValue,
Position = new Vector2(5),
Masking = true,
AutoSizeAxes = Axes.Both,
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Children = new Drawable[]
{
new Box
{
Colour = OsuColour.Gray(0.2f),
RelativeSizeAxes = Axes.Both,
},
new TourneyButton new TourneyButton
{ {
Text = "Save Changes", Text = "Save Changes",
Width = 140, Width = 140,
Height = 50, Height = 50,
Depth = float.MinValue, Padding = new MarginPadding
Anchor = Anchor.BottomRight, {
Origin = Anchor.BottomRight, Top = 10,
Padding = new MarginPadding(10), Left = 10,
},
Margin = new MarginPadding
{
Right = 10,
Bottom = 10,
},
Action = SaveChanges, Action = SaveChanges,
}, },
}
},
heightWarning = new Container heightWarning = new Container
{ {
Masking = true, Masking = true,

View File

@ -92,18 +92,6 @@ namespace osu.Game.Online.Chat
textbox.Text = string.Empty; textbox.Text = string.Empty;
} }
public void Contract()
{
this.FadeIn(300);
this.MoveToY(0, 500, Easing.OutQuint);
}
public void Expand()
{
this.FadeOut(200);
this.MoveToY(100, 500, Easing.In);
}
protected virtual ChatLine CreateMessage(Message message) => new StandAloneMessage(message); protected virtual ChatLine CreateMessage(Message message) => new StandAloneMessage(message);
private void channelChanged(ValueChangedEvent<Channel> e) private void channelChanged(ValueChangedEvent<Channel> e)