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:
parent
464b3af5f3
commit
f28978b856
@ -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]
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user