mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:52:53 +08:00
Fix current selection not updating visually after creating a new playlist
This commit is contained in:
parent
335af04764
commit
31a5cdd8ac
@ -69,8 +69,16 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
rooms.BindTo(roomManager.Rooms);
|
||||
|
||||
filter?.BindValueChanged(criteria => Filter(criteria.NewValue));
|
||||
|
||||
selectedRoom.BindValueChanged(selection =>
|
||||
{
|
||||
updateSelection();
|
||||
}, true);
|
||||
}
|
||||
|
||||
private void updateSelection() =>
|
||||
roomFlow.Children.ForEach(r => r.State = r.Room == selectedRoom.Value ? SelectionState.Selected : SelectionState.NotSelected);
|
||||
|
||||
public void Filter(FilterCriteria criteria)
|
||||
{
|
||||
roomFlow.Children.ForEach(r =>
|
||||
@ -125,6 +133,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
}
|
||||
|
||||
Filter(filter?.Value);
|
||||
|
||||
updateSelection();
|
||||
}
|
||||
|
||||
private void removeRooms(IEnumerable<Room> rooms)
|
||||
@ -146,11 +156,7 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
|
||||
roomFlow.SetLayoutPosition(room, room.Room.Position.Value);
|
||||
}
|
||||
|
||||
private void selectRoom(Room room)
|
||||
{
|
||||
roomFlow.Children.ForEach(r => r.State = r.Room == room ? SelectionState.Selected : SelectionState.NotSelected);
|
||||
selectedRoom.Value = room;
|
||||
}
|
||||
private void selectRoom(Room room) => selectedRoom.Value = room;
|
||||
|
||||
private void joinSelected()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user