mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 09:02:57 +08:00
Merge pull request #8170 from peppy/tournament-base-changes
Apply tournament client usability changes
This commit is contained in:
commit
a04b651fea
@ -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
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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()
|
||||||
{
|
{
|
||||||
|
@ -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,16 +75,40 @@ namespace osu.Game.Tournament
|
|||||||
|
|
||||||
AddRange(new[]
|
AddRange(new[]
|
||||||
{
|
{
|
||||||
new TourneyButton
|
new Container
|
||||||
{
|
{
|
||||||
Text = "Save Changes",
|
CornerRadius = 10,
|
||||||
Width = 140,
|
|
||||||
Height = 50,
|
|
||||||
Depth = float.MinValue,
|
Depth = float.MinValue,
|
||||||
|
Position = new Vector2(5),
|
||||||
|
Masking = true,
|
||||||
|
AutoSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.BottomRight,
|
Anchor = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Padding = new MarginPadding(10),
|
Children = new Drawable[]
|
||||||
Action = SaveChanges,
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = OsuColour.Gray(0.2f),
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new TourneyButton
|
||||||
|
{
|
||||||
|
Text = "Save Changes",
|
||||||
|
Width = 140,
|
||||||
|
Height = 50,
|
||||||
|
Padding = new MarginPadding
|
||||||
|
{
|
||||||
|
Top = 10,
|
||||||
|
Left = 10,
|
||||||
|
},
|
||||||
|
Margin = new MarginPadding
|
||||||
|
{
|
||||||
|
Right = 10,
|
||||||
|
Bottom = 10,
|
||||||
|
},
|
||||||
|
Action = SaveChanges,
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
heightWarning = new Container
|
heightWarning = new Container
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user