Avoid redundant (synchronous) skin change

This commit is contained in:
Dean Herbert 2019-02-27 14:30:04 +09:00
parent a8bc87f5d8
commit 9473b53226
1 changed files with 10 additions and 17 deletions

View File

@ -71,27 +71,20 @@ protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnl
var dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
fallbackSource = dependencies.Get<ISkinSource>();
dependencies.CacheAs<ISkinSource>(this);
return dependencies;
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins);
config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds);
}
protected override void LoadComplete()
{
base.LoadComplete();
if (fallbackSource != null)
fallbackSource.SourceChanged += onSourceChanged;
dependencies.CacheAs<ISkinSource>(this);
var config = dependencies.Get<OsuConfigManager>();
config.BindWith(OsuSetting.BeatmapSkins, beatmapSkins);
config.BindWith(OsuSetting.BeatmapHitsounds, beatmapHitsounds);
beatmapSkins.BindValueChanged(_ => onSourceChanged());
beatmapHitsounds.BindValueChanged(_ => onSourceChanged(), true);
beatmapHitsounds.BindValueChanged(_ => onSourceChanged());
return dependencies;
}
protected override void Dispose(bool isDisposing)