Remove IOnlineComponent and change existing components to use bindable flow

This commit is contained in:
Dean Herbert
2020-10-22 14:19:12 +09:00
parent e664d04be2
commit 9753dab93b
17 changed files with 140 additions and 219 deletions

View File

@ -33,6 +33,15 @@ namespace osu.Game.Overlays
{
}
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
[BackgroundDependencyLoader]
private void load(IAPIProvider api)
{
apiState.BindTo(api.State);
apiState.BindValueChanged(onlineStateChanged, true);
}
[BackgroundDependencyLoader]
private void load()
{
@ -130,13 +139,13 @@ namespace osu.Game.Overlays
}
}
public override void APIStateChanged(IAPIProvider api, APIState state)
private void onlineStateChanged(ValueChangedEvent<APIState> state) => Schedule(() =>
{
if (State.Value == Visibility.Hidden)
return;
Header.Current.TriggerChange();
}
});
protected override void Dispose(bool isDisposing)
{