From f4fd15ad405dd7add87f7358d6a9e6b4f7b0e150 Mon Sep 17 00:00:00 2001 From: "Mr. HeliX" Date: Mon, 8 Apr 2024 13:44:30 +0200 Subject: [PATCH] Final updates PNK 2023 --- osu.Game.Tournament/Components/SongBar.cs | 24 +-------------- .../Components/TournamentBeatmapPanel.cs | 30 +++++++++---------- .../Gameplay/Components/MatchRoundDisplay.cs | 2 +- .../Screens/MapPool/MapPoolScreen.cs | 14 ++++++--- .../Screens/Schedule/ScheduleScreen.cs | 2 +- osu.Game/Graphics/UserInterface/OsuTextBox.cs | 7 +---- 6 files changed, 28 insertions(+), 51 deletions(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index d27e36404b06..123c65a9aaaa 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -198,29 +198,7 @@ private void refreshContent() new DiffPiece(("Length", length.ToFormattedDuration().ToString())), new DiffPiece(("BPM", $"{bpm:0.#}")), } - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Children = new Drawable[] - { - new Box - { - Colour = Color4.Black, - RelativeSizeAxes = Axes.Both, - Alpha = 0.1f, - }, - new OsuLogo - { - Triangles = false, - Scale = new Vector2(0.08f), - Margin = new MarginPadding(50), - X = -10, - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - }, - } - }, + } }, } } diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 4e0adb30ac12..950cd0871eb4 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -24,18 +24,21 @@ public partial class TournamentBeatmapPanel : CompositeDrawable private readonly string mod; + private readonly int modIndex; + public const float HEIGHT = 50; private readonly Bindable currentMatch = new Bindable(); private Box flash = null!; - public TournamentBeatmapPanel(IBeatmapInfo? beatmap, string mod = "") + public TournamentBeatmapPanel(IBeatmapInfo? beatmap, string mod = "", int modIndex = 0) { Beatmap = beatmap; this.mod = mod; + this.modIndex = modIndex; - Width = 400; + Width = 300; Height = HEIGHT; } @@ -71,14 +74,21 @@ private void load(LadderInfo ladder) { new TournamentSpriteText { - Text = Beatmap?.GetDisplayTitleRomanisable(false, false) ?? (LocalisableString)@"unknown", + Text = !string.IsNullOrEmpty(mod) ? $"{mod}{modIndex}" : Beatmap?.GetDisplayTitleRomanisable(false, false) ?? (LocalisableString)@"unknown", Font = OsuFont.Torus.With(weight: FontWeight.Bold), }, new FillFlowContainer { AutoSizeAxes = Axes.Both, Direction = FillDirection.Horizontal, - Children = new Drawable[] + Children = !string.IsNullOrEmpty(mod) ? new Drawable[] + { + new TournamentSpriteText + { + Text = Beatmap?.GetDisplayTitleRomanisable(false, false) ?? (LocalisableString)@"unknown", + Font = OsuFont.Torus.With(weight: FontWeight.Regular, size: 14) + }, + } : new Drawable[] { new TournamentSpriteText { @@ -115,18 +125,6 @@ private void load(LadderInfo ladder) Alpha = 0, }, }); - - if (!string.IsNullOrEmpty(mod)) - { - AddInternal(new TournamentModIcon(mod) - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - Margin = new MarginPadding(10), - Width = 60, - RelativeSizeAxes = Axes.Y, - }); - } } private void matchChanged(ValueChangedEvent match) diff --git a/osu.Game.Tournament/Screens/Gameplay/Components/MatchRoundDisplay.cs b/osu.Game.Tournament/Screens/Gameplay/Components/MatchRoundDisplay.cs index bd23317e1fc0..aba6f716eca1 100644 --- a/osu.Game.Tournament/Screens/Gameplay/Components/MatchRoundDisplay.cs +++ b/osu.Game.Tournament/Screens/Gameplay/Components/MatchRoundDisplay.cs @@ -20,6 +20,6 @@ private void load(LadderInfo ladder) } private void matchChanged(ValueChangedEvent match) => - Text.Text = match.NewValue?.Round.Value?.Name.Value ?? "Unknown Round"; + Text.Text = $"{match.NewValue?.Round.Value?.Name.Value}{(match.NewValue?.Losers.Value ?? false ? " (Loser Bracket)" : " (Winner Bracket)")}" ?? "Unknown Round"; } } diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 435be7eb37bd..7fcbd4f90e71 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -53,6 +53,7 @@ private void load(MatchIPCInfo ipc) }, mapFlows = new FillFlowContainer> { + X = 120, Y = 160, Spacing = new Vector2(10, 10), Direction = FillDirection.Vertical, @@ -249,6 +250,7 @@ private void updateDisplay() FillFlowContainer? currentFlow = null; string? currentMods = null; int flowCount = 0; + int modIndex = 0; foreach (var b in CurrentMatch.Value.Round.Value.Beatmaps) { @@ -259,9 +261,11 @@ private void updateDisplay() Spacing = new Vector2(10, 5), Direction = FillDirection.Full, RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y + AutoSizeAxes = Axes.Y, }); + modIndex = 1; + currentMods = b.Mods; totalRows++; @@ -274,12 +278,14 @@ private void updateDisplay() flowCount = 1; } - currentFlow.Add(new TournamentBeatmapPanel(b.Beatmap, b.Mods) + currentFlow.Add(new TournamentBeatmapPanel(b.Beatmap, b.Mods, modIndex) { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, Height = 42, }); + + modIndex++; } } diff --git a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs index 7a5718db6129..156e0536d3ed 100644 --- a/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs +++ b/osu.Game.Tournament/Screens/Schedule/ScheduleScreen.cs @@ -251,7 +251,7 @@ public ScheduleMatch(TournamentMatch match, bool showTimestamp = true) Colour = OsuColour.Gray(0.7f), Alpha = conditional ? 0.6f : 1, Margin = new MarginPadding { Horizontal = 10, Vertical = 5 }, - Text = match.Date.Value.ToLocalTime().ToString("HH:mm UTC") + (conditional ? " (conditional)" : "") + Text = match.Date.Value.ToLocalTime().ToString("HH:mm") + (conditional ? " (conditional)" : "") }); } } diff --git a/osu.Game/Graphics/UserInterface/OsuTextBox.cs b/osu.Game/Graphics/UserInterface/OsuTextBox.cs index 9e28d14c79fa..9cada56038df 100644 --- a/osu.Game/Graphics/UserInterface/OsuTextBox.cs +++ b/osu.Game/Graphics/UserInterface/OsuTextBox.cs @@ -269,12 +269,7 @@ protected override void OnFocusLost(FocusLostEvent e) private SampleChannel? getSampleChannel(FeedbackSampleType feedbackSampleType) { - var samples = sampleMap[feedbackSampleType]; - - if (samples.Length == 0) - return null; - - return samples[RNG.Next(0, samples.Length)]?.GetChannel(); + return null; } protected void PlayFeedbackSample(FeedbackSampleType feedbackSample) => Schedule(() =>