1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Don't show song select screen when local user doesn't have permission to add an item

This commit is contained in:
Dean Herbert 2023-06-20 18:27:19 +09:00
parent dc1b4a39aa
commit 10ed3787a0

View File

@ -337,11 +337,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
updateCurrentItem();
addItemButton.Alpha = client.IsHost || Room.QueueMode.Value != QueueMode.HostOnly ? 1 : 0;
addItemButton.Alpha = localUserCanAddItem ? 1 : 0;
Scheduler.AddOnce(UpdateMods);
}
private bool localUserCanAddItem => client.IsHost || Room.QueueMode.Value != QueueMode.HostOnly;
private void updateCurrentItem()
{
Debug.Assert(client.Room != null);
@ -406,6 +408,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
if (!this.IsCurrentScreen())
return;
if (!localUserCanAddItem)
return;
// If there's only one playlist item and we are the host, assume we want to change it. Else we're add a new one.
PlaylistItem itemToEdit = client.IsHost && Room.Playlist.Count == 1 ? Room.Playlist.Single() : null;