mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Remove Thread.Sleep and tidy up new method
This commit is contained in:
parent
cc01878f2b
commit
e98bfec644
@ -277,17 +277,7 @@ namespace osu.Game
|
|||||||
private void loadComponentSingleFile<T>(T d, Action<T> add)
|
private void loadComponentSingleFile<T>(T d, Action<T> add)
|
||||||
where T : Drawable
|
where T : Drawable
|
||||||
{
|
{
|
||||||
Schedule(() =>
|
Schedule(() => { asyncLoadStream = asyncLoadStream?.ContinueWith(t => LoadComponentAsync(d, add).Wait()) ?? LoadComponentAsync(d, add); });
|
||||||
{
|
|
||||||
if (asyncLoadStream != null)
|
|
||||||
asyncLoadStream = asyncLoadStream.ContinueWith(t =>
|
|
||||||
{
|
|
||||||
Thread.Sleep(100);
|
|
||||||
LoadComponentAsync(d, add).Wait();
|
|
||||||
});
|
|
||||||
else
|
|
||||||
asyncLoadStream = LoadComponentAsync(d, add);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool OnPressed(GlobalAction action)
|
public bool OnPressed(GlobalAction action)
|
||||||
|
Loading…
Reference in New Issue
Block a user