diff --git a/osu.Game.Tests/Visual/DailyChallenge/TestSceneDailyChallenge.cs b/osu.Game.Tests/Visual/DailyChallenge/TestSceneDailyChallenge.cs new file mode 100644 index 000000000000..cd09a1d20fdf --- /dev/null +++ b/osu.Game.Tests/Visual/DailyChallenge/TestSceneDailyChallenge.cs @@ -0,0 +1,40 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Linq; +using NUnit.Framework; +using osu.Game.Online.API; +using osu.Game.Online.Rooms; +using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Tests.Resources; +using osu.Game.Tests.Visual.OnlinePlay; + +namespace osu.Game.Tests.Visual.DailyChallenge +{ + public partial class TestSceneDailyChallenge : OnlinePlayTestScene + { + [Test] + public void TestDailyChallenge() + { + var room = new Room + { + RoomID = { Value = 1234 }, + Name = { Value = "Daily Challenge: June 4, 2024" }, + Playlist = + { + new PlaylistItem(TestResources.CreateTestBeatmapSetInfo().Beatmaps.First()) + { + RequiredMods = [new APIMod(new OsuModTraceable())], + AllowedMods = [new APIMod(new OsuModDoubleTime())] + } + }, + EndDate = { Value = DateTimeOffset.Now.AddHours(12) }, + Category = { Value = RoomCategory.DailyChallenge } + }; + + AddStep("add room", () => API.Perform(new CreateRoomRequest(room))); + AddStep("push screen", () => LoadScreen(new Screens.OnlinePlay.DailyChallenge.DailyChallenge(room))); + } + } +} diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs index 8c7576ff5247..3306b6624e05 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs @@ -644,7 +644,7 @@ public void TestLeaveNavigation() } }); - AddStep("open mod overlay", () => this.ChildrenOfType().Single().TriggerClick()); + AddStep("open mod overlay", () => this.ChildrenOfType().Single().TriggerClick()); AddStep("invoke on back button", () => multiplayerComponents.OnBackButton()); diff --git a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs index bdfe01ba097a..f9ef08583838 100644 --- a/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs +++ b/osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayerMatchSubScreen.cs @@ -197,7 +197,7 @@ public void TestFreeModSelectionHasAllowedMods() AddUntilStep("wait for join", () => RoomJoined); - ClickButtonWhenEnabled(); + ClickButtonWhenEnabled(); AddUntilStep("mod select contents loaded", () => this.ChildrenOfType().Any() && this.ChildrenOfType().All(col => col.IsLoaded && col.ItemsLoaded)); @@ -311,7 +311,7 @@ public void TestModSelectOverlay() AddUntilStep("wait for join", () => RoomJoined); - ClickButtonWhenEnabled(); + ClickButtonWhenEnabled(); AddAssert("mod select shows unranked", () => screen.UserModsSelectOverlay.ChildrenOfType().Single().Ranked.Value == false); AddAssert("score multiplier = 1.20", () => screen.UserModsSelectOverlay.ChildrenOfType().Single().ModMultiplier.Value, () => Is.EqualTo(1.2).Within(0.01)); diff --git a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs index ceb8e5377806..45f52f3cd802 100644 --- a/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs +++ b/osu.Game/Online/Rooms/OnlinePlayBeatmapAvailabilityTracker.cs @@ -29,7 +29,7 @@ namespace osu.Game.Online.Rooms /// public partial class OnlinePlayBeatmapAvailabilityTracker : CompositeComponent { - public readonly IBindable SelectedItem = new Bindable(); + public readonly Bindable SelectedItem = new Bindable(); [Resolved] private RealmAccess realm { get; set; } = null!; diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 722e776e3d19..00b9d909a10a 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -31,6 +31,7 @@ using osu.Game.Rulesets; using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Edit; +using osu.Game.Screens.OnlinePlay.DailyChallenge; using osu.Game.Screens.OnlinePlay.Multiplayer; using osu.Game.Screens.OnlinePlay.Playlists; using osu.Game.Screens.Select; @@ -149,9 +150,7 @@ private void load(BeatmapListingOverlay beatmapListing, SettingsOverlay settings OnPlaylists = () => this.Push(new Playlists()), OnDailyChallenge = room => { - Playlists playlistsScreen; - this.Push(playlistsScreen = new Playlists()); - playlistsScreen.Join(room); + this.Push(new DailyChallenge(room)); }, OnExit = () => { diff --git a/osu.Game/Screens/OnlinePlay/Components/ListingPollingComponent.cs b/osu.Game/Screens/OnlinePlay/Components/ListingPollingComponent.cs index c296e2a86b28..4b38ea68b35e 100644 --- a/osu.Game/Screens/OnlinePlay/Components/ListingPollingComponent.cs +++ b/osu.Game/Screens/OnlinePlay/Components/ListingPollingComponent.cs @@ -53,6 +53,8 @@ protected override Task Poll() req.Success += result => { + result = result.Where(r => r.Category.Value != RoomCategory.DailyChallenge).ToList(); + foreach (var existing in RoomManager.Rooms.ToArray()) { if (result.All(r => r.RoomID.Value != existing.RoomID.Value)) diff --git a/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs new file mode 100644 index 000000000000..5740825ca252 --- /dev/null +++ b/osu.Game/Screens/OnlinePlay/DailyChallenge/DailyChallenge.cs @@ -0,0 +1,376 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Audio; +using osu.Framework.Audio.Sample; +using osu.Framework.Bindables; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Extensions.LocalisationExtensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Screens; +using osu.Game.Beatmaps; +using osu.Game.Graphics.Containers; +using osu.Game.Localisation; +using osu.Game.Online.Rooms; +using osu.Game.Overlays; +using osu.Game.Rulesets; +using osu.Game.Rulesets.Mods; +using osu.Game.Screens.OnlinePlay.Components; +using osu.Game.Screens.OnlinePlay.Match; +using osu.Game.Screens.OnlinePlay.Match.Components; +using osu.Game.Screens.OnlinePlay.Playlists; +using osu.Game.Screens.Play; +using osuTK; + +namespace osu.Game.Screens.OnlinePlay.DailyChallenge +{ + public partial class DailyChallenge : OsuScreen + { + private readonly Room room; + private readonly PlaylistItem playlistItem; + + /// + /// Any mods applied by/to the local user. + /// + private readonly Bindable> userMods = new Bindable>(Array.Empty()); + + private OnlinePlayScreenWaveContainer waves = null!; + private MatchLeaderboard leaderboard = null!; + private RoomModSelectOverlay userModsSelectOverlay = null!; + private Sample? sampleStart; + private IDisposable? userModsSelectOverlayRegistration; + + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Plum); + + [Cached(Type = typeof(IRoomManager))] + private RoomManager roomManager { get; set; } + + [Cached] + private readonly OnlinePlayBeatmapAvailabilityTracker beatmapAvailabilityTracker = new OnlinePlayBeatmapAvailabilityTracker(); + + [Resolved] + private BeatmapManager beatmapManager { get; set; } = null!; + + [Resolved] + private RulesetStore rulesets { get; set; } = null!; + + [Resolved] + private MusicController musicController { get; set; } = null!; + + [Resolved] + private IOverlayManager? overlayManager { get; set; } + + public override bool DisallowExternalBeatmapRulesetChanges => true; + + public DailyChallenge(Room room) + { + this.room = room; + playlistItem = room.Playlist.Single(); + roomManager = new RoomManager(); + } + + protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) + { + return new CachedModelDependencyContainer(base.CreateChildDependencies(parent)) + { + Model = { Value = room } + }; + } + + [BackgroundDependencyLoader] + private void load(AudioManager audio) + { + sampleStart = audio.Samples.Get(@"SongSelect/confirm-selection"); + + FillFlowContainer footerButtons; + + InternalChild = waves = new OnlinePlayScreenWaveContainer + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + roomManager, + beatmapAvailabilityTracker, + new ScreenStack(new RoomBackgroundScreen(playlistItem)) + { + RelativeSizeAxes = Axes.Both, + }, + new Header(ButtonSystemStrings.DailyChallenge.ToSentence(), null), + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding + { + Horizontal = WaveOverlayContainer.WIDTH_PADDING, + Top = Header.HEIGHT, + }, + RowDimensions = + [ + new Dimension(GridSizeMode.AutoSize), + new Dimension(GridSizeMode.Absolute, 10), + new Dimension(), + new Dimension(GridSizeMode.Absolute, 30), + new Dimension(GridSizeMode.Absolute, 50) + ], + Content = new[] + { + new Drawable[] + { + new DrawableRoomPlaylistItem(playlistItem) + { + RelativeSizeAxes = Axes.X, + AllowReordering = false, + Scale = new Vector2(1.4f), + Width = 1 / 1.4f, + } + }, + null, + [ + new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true, + CornerRadius = 10, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4Extensions.FromHex(@"3e3a44") // Temporary. + }, + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding(10), + ColumnDimensions = + [ + new Dimension(), + new Dimension(GridSizeMode.Absolute, 10), + new Dimension(), + new Dimension(GridSizeMode.Absolute, 10), + new Dimension() + ], + Content = new[] + { + new Drawable?[] + { + null, + null, + // Middle column (leaderboard) + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] + { + new OverlinedHeader("Leaderboard") + }, + [leaderboard = new MatchLeaderboard { RelativeSizeAxes = Axes.Both }], + }, + RowDimensions = new[] + { + new Dimension(GridSizeMode.AutoSize), + new Dimension(), + } + }, + // Spacer + null, + // Main right column + new GridContainer + { + RelativeSizeAxes = Axes.Both, + Content = new[] + { + new Drawable[] + { + new OverlinedHeader("Chat") + }, + [new MatchChatDisplay(room) { RelativeSizeAxes = Axes.Both }] + }, + RowDimensions = + [ + new Dimension(GridSizeMode.AutoSize), + new Dimension() + ] + }, + } + } + } + } + } + ], + null, + [ + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding + { + Horizontal = -WaveOverlayContainer.WIDTH_PADDING, + }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4Extensions.FromHex(@"28242d") // Temporary. + }, + footerButtons = new FillFlowContainer + { + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Padding = new MarginPadding(5), + Spacing = new Vector2(10), + Children = new Drawable[] + { + new PlaylistsReadyButton + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Y, + Size = new Vector2(250, 1), + Action = startPlay + } + } + }, + } + } + ], + } + } + } + }; + + LoadComponent(userModsSelectOverlay = new RoomModSelectOverlay + { + SelectedMods = { BindTarget = userMods }, + IsValidMod = _ => false + }); + + if (playlistItem.AllowedMods.Any()) + { + footerButtons.Insert(-1, new UserModSelectButton + { + Text = "Free mods", + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Y, + Size = new Vector2(250, 1), + Action = () => userModsSelectOverlay.Show(), + }); + + var rulesetInstance = rulesets.GetRuleset(playlistItem.RulesetID)!.CreateInstance(); + var allowedMods = playlistItem.AllowedMods.Select(m => m.ToMod(rulesetInstance)); + userModsSelectOverlay.IsValidMod = m => allowedMods.Any(a => a.GetType() == m.GetType()); + } + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + beatmapAvailabilityTracker.SelectedItem.Value = playlistItem; + beatmapAvailabilityTracker.Availability.BindValueChanged(_ => trySetDailyChallengeBeatmap(), true); + + userModsSelectOverlayRegistration = overlayManager?.RegisterBlockingOverlay(userModsSelectOverlay); + userModsSelectOverlay.SelectedItem.Value = playlistItem; + userMods.BindValueChanged(_ => Scheduler.AddOnce(updateMods), true); + } + + private void trySetDailyChallengeBeatmap() + { + var beatmap = beatmapManager.QueryBeatmap(b => b.OnlineID == playlistItem.Beatmap.OnlineID); + Beatmap.Value = beatmapManager.GetWorkingBeatmap(beatmap); // this will gracefully fall back to dummy beatmap if missing locally. + Ruleset.Value = rulesets.GetRuleset(playlistItem.RulesetID); + } + + public override void OnEntering(ScreenTransitionEvent e) + { + base.OnEntering(e); + + waves.Show(); + roomManager.JoinRoom(room); + applyLoopingToTrack(); + } + + public override void OnResuming(ScreenTransitionEvent e) + { + base.OnResuming(e); + applyLoopingToTrack(); + } + + public override void OnSuspending(ScreenTransitionEvent e) + { + base.OnSuspending(e); + + userModsSelectOverlay.Hide(); + cancelTrackLooping(); + } + + public override bool OnExiting(ScreenExitEvent e) + { + waves.Hide(); + userModsSelectOverlay.Hide(); + cancelTrackLooping(); + this.Delay(WaveContainer.DISAPPEAR_DURATION).FadeOut(); + + roomManager.PartRoom(); + + return base.OnExiting(e); + } + + private void applyLoopingToTrack() + { + if (!this.IsCurrentScreen()) + return; + + var track = Beatmap.Value?.Track; + + if (track != null) + { + Beatmap.Value?.PrepareTrackForPreview(true); + musicController.EnsurePlayingSomething(); + } + } + + private void cancelTrackLooping() + { + var track = Beatmap.Value?.Track; + + if (track != null) + track.Looping = false; + } + + private void updateMods() + { + if (!this.IsCurrentScreen()) + return; + + Mods.Value = userMods.Value.Concat(playlistItem.RequiredMods.Select(m => m.ToMod(Ruleset.Value.CreateInstance()))).ToList(); + } + + private void startPlay() + { + sampleStart?.Play(); + this.Push(new PlayerLoader(() => new PlaylistsPlayer(room, playlistItem) + { + Exited = () => leaderboard.RefetchScores() + })); + } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + userModsSelectOverlayRegistration?.Dispose(); + } + } +} diff --git a/osu.Game/Screens/OnlinePlay/Header.cs b/osu.Game/Screens/OnlinePlay/Header.cs index 4c4851c3ac05..860042fd373c 100644 --- a/osu.Game/Screens/OnlinePlay/Header.cs +++ b/osu.Game/Screens/OnlinePlay/Header.cs @@ -1,13 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using Humanizer; -using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; using osu.Framework.Screens; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -20,10 +18,10 @@ public partial class Header : Container { public const float HEIGHT = 80; - private readonly ScreenStack stack; + private readonly ScreenStack? stack; private readonly MultiHeaderTitle title; - public Header(string mainTitle, ScreenStack stack) + public Header(LocalisableString mainTitle, ScreenStack? stack) { this.stack = stack; @@ -37,12 +35,15 @@ public Header(string mainTitle, ScreenStack stack) Origin = Anchor.CentreLeft, }; - // unnecessary to unbind these as this header has the same lifetime as the screen stack we are attaching to. - stack.ScreenPushed += (_, _) => updateSubScreenTitle(); - stack.ScreenExited += (_, _) => updateSubScreenTitle(); + if (stack != null) + { + // unnecessary to unbind these as this header has the same lifetime as the screen stack we are attaching to. + stack.ScreenPushed += (_, _) => updateSubScreenTitle(); + stack.ScreenExited += (_, _) => updateSubScreenTitle(); + } } - private void updateSubScreenTitle() => title.Screen = stack.CurrentScreen as IOnlinePlaySubScreen; + private void updateSubScreenTitle() => title.Screen = stack?.CurrentScreen as IOnlinePlaySubScreen; private partial class MultiHeaderTitle : CompositeDrawable { @@ -51,13 +52,16 @@ private partial class MultiHeaderTitle : CompositeDrawable private readonly OsuSpriteText dot; private readonly OsuSpriteText pageTitle; - [CanBeNull] - public IOnlinePlaySubScreen Screen + public IOnlinePlaySubScreen? Screen { - set => pageTitle.Text = value?.ShortTitle.Titleize() ?? string.Empty; + set + { + pageTitle.Text = value?.ShortTitle.Titleize() ?? default(LocalisableString); + dot.Alpha = pageTitle.Text == default ? 0 : 1; + } } - public MultiHeaderTitle(string mainTitle) + public MultiHeaderTitle(LocalisableString mainTitle) { AutoSizeAxes = Axes.Both; @@ -82,14 +86,14 @@ public MultiHeaderTitle(string mainTitle) Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.TorusAlternate.With(size: 24), - Text = "·" + Text = "·", + Alpha = 0, }, pageTitle = new OsuSpriteText { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Font = OsuFont.TorusAlternate.With(size: 24), - Text = "Lounge" } } }, diff --git a/osu.Game/Screens/OnlinePlay/Match/RoomModSelectOverlay.cs b/osu.Game/Screens/OnlinePlay/Match/RoomModSelectOverlay.cs index 55e077df0f1c..6a856d8d7268 100644 --- a/osu.Game/Screens/OnlinePlay/Match/RoomModSelectOverlay.cs +++ b/osu.Game/Screens/OnlinePlay/Match/RoomModSelectOverlay.cs @@ -16,8 +16,7 @@ namespace osu.Game.Screens.OnlinePlay.Match { public partial class RoomModSelectOverlay : UserModSelectOverlay { - [Resolved] - private IBindable selectedItem { get; set; } = null!; + public Bindable SelectedItem { get; } = new Bindable(); [Resolved] private RulesetStore rulesets { get; set; } = null!; @@ -33,7 +32,7 @@ protected override void LoadComplete() { base.LoadComplete(); - selectedItem.BindValueChanged(v => + SelectedItem.BindValueChanged(v => { roomRequiredMods.Clear(); diff --git a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs index 97fbb8399254..4eb092d08b50 100644 --- a/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Match/RoomSubScreen.cs @@ -17,12 +17,9 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input.Bindings; -using osu.Framework.Input.Events; using osu.Framework.Screens; using osu.Game.Audio; using osu.Game.Beatmaps; -using osu.Game.Input.Bindings; using osu.Game.Online.API; using osu.Game.Online.Rooms; using osu.Game.Overlays; @@ -243,6 +240,7 @@ private void load(AudioManager audio) LoadComponent(UserModsSelectOverlay = new RoomModSelectOverlay { + SelectedItem = { BindTarget = SelectedItem }, SelectedMods = { BindTarget = UserMods }, IsValidMod = _ => false }); @@ -531,22 +529,6 @@ private void cancelTrackLooping() /// The room to change the settings of. protected abstract RoomSettingsOverlay CreateRoomSettingsOverlay(Room room); - public partial class UserModSelectButton : PurpleRoundedButton, IKeyBindingHandler - { - public bool OnPressed(KeyBindingPressEvent e) - { - if (e.Action == GlobalAction.ToggleModSelection && !e.Repeat) - { - TriggerClick(); - return true; - } - - return false; - } - - public void OnReleased(KeyBindingReleaseEvent e) { } - } - protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); diff --git a/osu.Game/Screens/OnlinePlay/Match/UserModSelectButton.cs b/osu.Game/Screens/OnlinePlay/Match/UserModSelectButton.cs new file mode 100644 index 000000000000..f3ea82be997f --- /dev/null +++ b/osu.Game/Screens/OnlinePlay/Match/UserModSelectButton.cs @@ -0,0 +1,27 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable disable +using osu.Framework.Input.Bindings; +using osu.Framework.Input.Events; +using osu.Game.Input.Bindings; +using osu.Game.Screens.OnlinePlay.Match.Components; + +namespace osu.Game.Screens.OnlinePlay.Match +{ + public partial class UserModSelectButton : PurpleRoundedButton, IKeyBindingHandler + { + public bool OnPressed(KeyBindingPressEvent e) + { + if (e.Action == GlobalAction.ToggleModSelection && !e.Repeat) + { + TriggerClick(); + return true; + } + + return false; + } + + public void OnReleased(KeyBindingReleaseEvent e) { } + } +} diff --git a/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs b/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs index 9de458b5c6ab..9b6284fb8914 100644 --- a/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs +++ b/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs @@ -6,7 +6,6 @@ using System.Diagnostics; using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Logging; using osu.Framework.Screens; @@ -36,7 +35,7 @@ public abstract partial class OnlinePlayScreen : OsuScreen, IHasSubScreenStack protected LoungeSubScreen Lounge { get; private set; } - private MultiplayerWaveContainer waves; + private OnlinePlayScreenWaveContainer waves; private ScreenStack screenStack; [Cached(Type = typeof(IRoomManager))] @@ -63,7 +62,7 @@ protected OnlinePlayScreen() [BackgroundDependencyLoader] private void load() { - InternalChild = waves = new MultiplayerWaveContainer + InternalChild = waves = new OnlinePlayScreenWaveContainer { RelativeSizeAxes = Axes.Both, Children = new Drawable[] @@ -230,19 +229,6 @@ private void subScreenChanged(IScreen lastScreen, IScreen newScreen) protected abstract LoungeSubScreen CreateLounge(); - private partial class MultiplayerWaveContainer : WaveContainer - { - protected override bool StartHidden => true; - - public MultiplayerWaveContainer() - { - FirstWaveColour = Color4Extensions.FromHex(@"654d8c"); - SecondWaveColour = Color4Extensions.FromHex(@"554075"); - ThirdWaveColour = Color4Extensions.FromHex(@"44325e"); - FourthWaveColour = Color4Extensions.FromHex(@"392850"); - } - } - ScreenStack IHasSubScreenStack.SubScreenStack => screenStack; } } diff --git a/osu.Game/Screens/OnlinePlay/OnlinePlayScreenWaveContainer.cs b/osu.Game/Screens/OnlinePlay/OnlinePlayScreenWaveContainer.cs new file mode 100644 index 000000000000..bfa68d82cd4f --- /dev/null +++ b/osu.Game/Screens/OnlinePlay/OnlinePlayScreenWaveContainer.cs @@ -0,0 +1,22 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +#nullable disable +using osu.Framework.Extensions.Color4Extensions; +using osu.Game.Graphics.Containers; + +namespace osu.Game.Screens.OnlinePlay +{ + public partial class OnlinePlayScreenWaveContainer : WaveContainer + { + protected override bool StartHidden => true; + + public OnlinePlayScreenWaveContainer() + { + FirstWaveColour = Color4Extensions.FromHex(@"654d8c"); + SecondWaveColour = Color4Extensions.FromHex(@"554075"); + ThirdWaveColour = Color4Extensions.FromHex(@"44325e"); + FourthWaveColour = Color4Extensions.FromHex(@"392850"); + } + } +}