From 549cc08bfe4cbde8180a05650fceb7974ce6bb35 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Tue, 18 Nov 2025 16:12:24 +0900 Subject: [PATCH] Remove add button from playlist popup --- .../TestSceneFooterButtonPlaylistV2.cs | 2 - .../OnlinePlay/FooterButtonPlaylistV2.cs | 51 ++----------------- .../Playlists/PlaylistsSongSelectV2.cs | 5 +- 3 files changed, 6 insertions(+), 52 deletions(-) diff --git a/osu.Game.Tests/Visual/Playlists/TestSceneFooterButtonPlaylistV2.cs b/osu.Game.Tests/Visual/Playlists/TestSceneFooterButtonPlaylistV2.cs index dc84102aef..730696c363 100644 --- a/osu.Game.Tests/Visual/Playlists/TestSceneFooterButtonPlaylistV2.cs +++ b/osu.Game.Tests/Visual/Playlists/TestSceneFooterButtonPlaylistV2.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Cursor; @@ -29,7 +28,6 @@ namespace osu.Game.Tests.Visual.Playlists Anchor = Anchor.Centre, Origin = Anchor.CentreLeft, X = -100, - CreateNewItem = () => room.Playlist = room.Playlist.Append(new PlaylistItem(CreateAPIBeatmap())).ToArray() } }); } diff --git a/osu.Game/Screens/OnlinePlay/FooterButtonPlaylistV2.cs b/osu.Game/Screens/OnlinePlay/FooterButtonPlaylistV2.cs index fdf6c09e69..f5f5024d4f 100644 --- a/osu.Game/Screens/OnlinePlay/FooterButtonPlaylistV2.cs +++ b/osu.Game/Screens/OnlinePlay/FooterButtonPlaylistV2.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. -using System; using System.ComponentModel; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -18,14 +16,11 @@ using osu.Game.Overlays; using osu.Game.Screens.Footer; using osu.Game.Screens.OnlinePlay.Playlists; using osuTK; -using Container = osu.Framework.Graphics.Containers.Container; namespace osu.Game.Screens.OnlinePlay { public partial class FooterButtonPlaylistV2 : ScreenFooterButton, IHasPopover { - public required Action? CreateNewItem { get; init; } - private readonly Room room; public FooterButtonPlaylistV2(Room room) @@ -43,15 +38,10 @@ namespace osu.Game.Screens.OnlinePlay Action = this.ShowPopover; } - public Popover GetPopover() => new PlaylistPopover(room) - { - CreateNewItem = CreateNewItem - }; + public Popover GetPopover() => new PlaylistPopover(room); private partial class PlaylistPopover : OsuPopover { - public required Action? CreateNewItem { get; init; } - private readonly Room room; private PlaylistsRoomSettingsPlaylist playlist = null!; @@ -66,43 +56,12 @@ namespace osu.Game.Screens.OnlinePlay [BackgroundDependencyLoader] private void load() { - Content.Padding = new MarginPadding(5); + Content.Padding = new MarginPadding(10); - Add(new GridContainer + Child = playlist = new PlaylistsRoomSettingsPlaylist { - Size = new Vector2(300, 300), - Padding = new MarginPadding { Vertical = 10 }, - Content = new[] - { - new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Bottom = 10 }, - Child = playlist = new PlaylistsRoomSettingsPlaylist - { - RelativeSizeAxes = Axes.Both - } - } - }, - new Drawable[] - { - new RoundedButton - { - Text = "Add new playlist entry", - RelativeSizeAxes = Axes.Both, - Size = Vector2.One, - Action = () => CreateNewItem?.Invoke() - } - }, - }, - RowDimensions = new[] - { - new Dimension(), - new Dimension(GridSizeMode.Absolute, 50), - } - }); + Size = new Vector2(300) + }; } protected override void LoadComplete() diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs index a301f19ddd..ea5fc1536c 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsSongSelectV2.cs @@ -195,10 +195,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists buttons.Single(i => i is FooterButtonMods).TooltipText = MultiplayerMatchStrings.RequiredModsButtonTooltip; - buttons.Insert(0, new FooterButtonPlaylistV2(room) - { - CreateNewItem = AddNewItem - }); + buttons.Insert(0, new FooterButtonPlaylistV2(room)); buttons.InsertRange(buttons.FindIndex(b => b is FooterButtonMods) + 1, [