Recreate panels only while loading/loaded

This commit is contained in:
smoogipoo
2019-12-19 02:21:33 +09:00
parent 007e2e80c1
commit dd68106d90

View File

@ -17,6 +17,7 @@ using osu.Game.Overlays.SearchableList;
using osu.Game.Overlays.Social; using osu.Game.Overlays.Social;
using osu.Game.Users; using osu.Game.Users;
using System.Threading; using System.Threading;
using osu.Framework.Allocation;
using osu.Framework.Threading; using osu.Framework.Threading;
namespace osu.Game.Overlays namespace osu.Game.Overlays
@ -44,7 +45,9 @@ namespace osu.Game.Overlays
return; return;
users = value ?? Array.Empty<User>(); users = value ?? Array.Empty<User>();
recreatePanels();
if (LoadState >= LoadState.Ready)
recreatePanels();
} }
} }
@ -70,7 +73,6 @@ namespace osu.Game.Overlays
}; };
Header.Tabs.Current.ValueChanged += _ => queueUpdate(); Header.Tabs.Current.ValueChanged += _ => queueUpdate();
Filter.Tabs.Current.ValueChanged += _ => onFilterUpdate(); Filter.Tabs.Current.ValueChanged += _ => onFilterUpdate();
Filter.DisplayStyleControl.DisplayStyle.ValueChanged += _ => recreatePanels(); Filter.DisplayStyleControl.DisplayStyle.ValueChanged += _ => recreatePanels();
@ -88,6 +90,12 @@ namespace osu.Game.Overlays
}; };
} }
[BackgroundDependencyLoader]
private void load()
{
recreatePanels();
}
private APIRequest getUsersRequest; private APIRequest getUsersRequest;
private readonly Bindable<string> currentQuery = new Bindable<string>(); private readonly Bindable<string> currentQuery = new Bindable<string>();