1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:07:38 +08:00

Handle against playlists which disallow selection

`SelectedItem.Disabled` is also not checked against in the select-via-click flow inside `DrawableRoomPlaylistItem` (only `AllowSelection` is checked).
This commit is contained in:
Salman Ahmed 2022-05-05 05:42:49 +03:00
parent 464b3af5f3
commit f28978b856
2 changed files with 10 additions and 1 deletions

View File

@ -56,6 +56,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
AddStep("press down", () => InputManager.Key(Key.Down));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
}
[Test]
@ -73,6 +76,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
AddStep("press down", () => InputManager.Key(Key.Down));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
}
[Test]
@ -91,6 +97,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("click", () => InputManager.Click(MouseButton.Left));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
AddStep("press down", () => InputManager.Key(Key.Down));
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
}
[Test]

View File

@ -217,7 +217,7 @@ namespace osu.Game.Screens.OnlinePlay
private void selectNext(int direction)
{
if (SelectedItem.Disabled)
if (!AllowSelection)
return;
var visibleItems = ListContainer.AsEnumerable().Where(r => r.IsPresent);