diff --git a/osu.Game.Tests/Visual/Matchmaking/TestSceneBeatmapSelectPanel.cs b/osu.Game.Tests/Visual/Matchmaking/TestSceneBeatmapSelectPanel.cs index 9ac64288ed..d01a0cf2f8 100644 --- a/osu.Game.Tests/Visual/Matchmaking/TestSceneBeatmapSelectPanel.cs +++ b/osu.Game.Tests/Visual/Matchmaking/TestSceneBeatmapSelectPanel.cs @@ -99,7 +99,7 @@ namespace osu.Game.Tests.Visual.Matchmaking AddToggleStep("allow selection", value => panel!.AllowSelection = value); - AddStep("reveal beatmap", () => panel!.RevealBeatmap(CreateAPIBeatmap(), [])); + // AddStep("reveal beatmap", () => panel!.RevealBeatmap(CreateAPIBeatmap(), [])); } [Test] diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs index d27b0e3818..11b9d1bfec 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/BeatmapSelectGrid.cs @@ -46,8 +46,6 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect private readonly Sample?[] spinSamples = new Sample?[5]; private static readonly int[] spin_sample_sequence = [0, 1, 2, 3, 4, 2, 3, 4]; - private Sample? randomRevealSample; - private Sample? resultSample; private Sample? swooshSample; private double? lastSamplePlayback; @@ -81,8 +79,6 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect for (int i = 0; i < spinSamples.Length; i++) spinSamples[i] = audio.Samples.Get($@"Multiplayer/Matchmaking/Selection/roulette-{i}"); - randomRevealSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Selection/random-reveal"); - resultSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Selection/roulette-result"); swooshSample = audio.Samples.Get(@"SongSelect/options-pop-out"); } @@ -150,8 +146,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect Debug.Assert(playlistItem != null); - randomRevealSample?.Play(); - randomPanel.RevealBeatmap(playlistItem.Beatmap, playlistItem.Mods); + // TODO: make this happen via panel.PresentAsChosenBeatmap + // randomPanel.RevealBeatmap(playlistItem.Beatmap, playlistItem.Mods); }); public void RollAndDisplayFinalBeatmap(long[] candidateItemIds, long finalItemId) => whenPanelsLoaded(() => @@ -344,11 +340,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect { rollContainer.ChangeChildDepth(panel, float.MinValue); - panel.ShowChosenBorder(); - panel.MoveTo(Vector2.Zero, 1000, Easing.OutExpo) - .ScaleTo(1.5f, 1000, Easing.OutExpo); + var item = playlistItems[finalItem]; - resultSample?.Play(); + panel.PresentAsChosenBeatmap(item); }); } } diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.cs index ca10133a36..66d8b42492 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.cs @@ -182,6 +182,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect border.FadeOut(500, Easing.OutQuint); } + public abstract void PresentAsChosenBeatmap(MatchmakingPlaylistItem playlistItem); + public void FadeInAndEnterFromBelow(double duration = 500, double delay = 0, float distance = 200) { scaleContainer diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelBeatmap.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelBeatmap.cs index ec00ed3847..0f70c1b2ed 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelBeatmap.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelBeatmap.cs @@ -2,8 +2,12 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; +using osu.Framework.Graphics; using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets.Mods; +using osuTK; namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect { @@ -20,13 +24,25 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect } private CardContent content = null!; + private Sample? resultSample; [BackgroundDependencyLoader] - private void load() + private void load(AudioManager audio) { + resultSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Selection/roulette-result"); + Add(content = new CardContentBeatmap(beatmap, mods)); } + public override void PresentAsChosenBeatmap(MatchmakingPlaylistItem playlistItem) + { + ShowChosenBorder(); + this.MoveTo(Vector2.Zero, 1000, Easing.OutExpo) + .ScaleTo(1.5f, 1000, Easing.OutExpo); + + resultSample?.Play(); + } + public override void AddUser(APIUser user) { content.SelectionOverlay.AddUser(user); diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelRandom.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelRandom.cs index 1c2114ad91..26b0e6610f 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelRandom.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanelRandom.cs @@ -4,13 +4,14 @@ using System; using System.Collections.Generic; using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Transforms; using osu.Framework.Input.Events; using osu.Game.Online.API.Requests.Responses; using osu.Game.Online.Rooms; -using osu.Game.Rulesets.Mods; namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect { @@ -25,15 +26,21 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect private Drawable diceProxy = null!; private readonly List users = new List(); + private Sample? resultSample; + private Sample? swooshSample; + [BackgroundDependencyLoader] - private void load() + private void load(AudioManager audio) { + resultSample = audio.Samples.Get(@"Multiplayer/Matchmaking/Selection/roulette-result"); + swooshSample = audio.Samples.Get(@"SongSelect/options-pop-out"); + Add(content = new CardContentRandom()); AddInternal(diceProxy = content.Dice.CreateProxy()); } - public void RevealBeatmap(APIBeatmap beatmap, Mod[] mods) + public override void PresentAsChosenBeatmap(MatchmakingPlaylistItem playlistItem) { const double duration = 800; @@ -48,6 +55,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect content.Dice.RotateTo(content.Dice.Rotation - 360 * 5, duration * 1.3f, Easing.Out); content.Label.FadeOut(200).Expire(); + swooshSample?.Play(); + Scheduler.AddDelayed(() => { content.Expire(); @@ -56,7 +65,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect AddRange(new Drawable[] { - new CardContentBeatmap(beatmap, mods), + new CardContentBeatmap(playlistItem.Beatmap, playlistItem.Mods), flashLayer, }); @@ -64,6 +73,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect content.SelectionOverlay.AddUser(user); flashLayer.FadeOutFromOne(1000, Easing.In); + + resultSample?.Play(); }, duration); }