mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:12:57 +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));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
|
|
||||||
|
AddStep("press down", () => InputManager.Key(Key.Down));
|
||||||
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -73,6 +76,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
|
|
||||||
|
AddStep("press down", () => InputManager.Key(Key.Down));
|
||||||
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -91,6 +97,9 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
|
|
||||||
|
AddStep("press down", () => InputManager.Key(Key.Down));
|
||||||
|
AddAssert("no item selected", () => playlist.SelectedItem.Value == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -217,7 +217,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
private void selectNext(int direction)
|
private void selectNext(int direction)
|
||||||
{
|
{
|
||||||
if (SelectedItem.Disabled)
|
if (!AllowSelection)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var visibleItems = ListContainer.AsEnumerable().Where(r => r.IsPresent);
|
var visibleItems = ListContainer.AsEnumerable().Where(r => r.IsPresent);
|
||||||
|
Loading…
Reference in New Issue
Block a user