mirror of
https://github.com/ppy/osu
synced 2025-01-20 21:10:49 +00:00
Fire initial APIStateChanged on local thread
This commit is contained in:
parent
272ebeb23d
commit
11e5c6a2a0
@ -70,13 +70,15 @@ namespace osu.Game.Online.API
|
||||
|
||||
internal new void Schedule(Action action) => base.Schedule(action);
|
||||
|
||||
/// <summary>
|
||||
/// Register a component to receive API events.
|
||||
/// Fires <see cref="IOnlineComponent.APIStateChanged"/> once immediately to ensure correct .
|
||||
/// </summary>
|
||||
/// <param name="component"></param>
|
||||
public void Register(IOnlineComponent component)
|
||||
{
|
||||
Scheduler.Add(delegate
|
||||
{
|
||||
components.Add(component);
|
||||
component.APIStateChanged(this, state);
|
||||
});
|
||||
Scheduler.Add(delegate { components.Add(component); });
|
||||
component.APIStateChanged(this, state);
|
||||
}
|
||||
|
||||
public void Unregister(IOnlineComponent component)
|
||||
|
Loading…
Reference in New Issue
Block a user