mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Remove IOnlineComponent and change existing components to use bindable flow
This commit is contained in:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user