mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 06:53:21 +08:00
Directly resolve the filter bindable
This commit is contained in:
parent
990bd44ca2
commit
7f13e3c5f7
@ -130,8 +130,6 @@ namespace osu.Game.Screens.Multi
|
|||||||
roomManager = new RoomManager()
|
roomManager = new RoomManager()
|
||||||
});
|
});
|
||||||
|
|
||||||
roomManager.Filter.BindTo(filter);
|
|
||||||
|
|
||||||
screenStack.ScreenPushed += screenPushed;
|
screenStack.ScreenPushed += screenPushed;
|
||||||
screenStack.ScreenExited += screenExited;
|
screenStack.ScreenExited += screenExited;
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,13 @@ namespace osu.Game.Screens.Multi
|
|||||||
private readonly BindableList<Room> rooms = new BindableList<Room>();
|
private readonly BindableList<Room> rooms = new BindableList<Room>();
|
||||||
public IBindableList<Room> Rooms => rooms;
|
public IBindableList<Room> Rooms => rooms;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The <see cref="FilterCriteria"/> to use when polling for <see cref="Room"/>s.
|
|
||||||
/// </summary>
|
|
||||||
public readonly Bindable<FilterCriteria> Filter = new Bindable<FilterCriteria>();
|
|
||||||
|
|
||||||
public Bindable<Room> CurrentRoom { get; } = new Bindable<Room>();
|
public Bindable<Room> CurrentRoom { get; } = new Bindable<Room>();
|
||||||
|
|
||||||
private Room joinedRoom;
|
private Room joinedRoom;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Bindable<FilterCriteria> filter { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private APIAccess api { get; set; }
|
private APIAccess api { get; set; }
|
||||||
|
|
||||||
@ -44,14 +42,13 @@ namespace osu.Game.Screens.Multi
|
|||||||
|
|
||||||
public RoomManager()
|
public RoomManager()
|
||||||
{
|
{
|
||||||
Filter.BindValueChanged(_ =>
|
filter.BindValueChanged(_ =>
|
||||||
{
|
{
|
||||||
if (IsLoaded)
|
if (IsLoaded)
|
||||||
PollImmediately();
|
PollImmediately();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
@ -137,7 +134,7 @@ namespace osu.Game.Screens.Multi
|
|||||||
var tcs = new TaskCompletionSource<bool>();
|
var tcs = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
pollReq?.Cancel();
|
pollReq?.Cancel();
|
||||||
pollReq = new GetRoomsRequest(Filter.Value.PrimaryFilter);
|
pollReq = new GetRoomsRequest(filter.Value.PrimaryFilter);
|
||||||
|
|
||||||
pollReq.Success += result =>
|
pollReq.Success += result =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user