1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 03:03:21 +08:00

Avoid redundant (synchronous) skin change

This commit is contained in:
Dean Herbert 2019-02-27 14:30:04 +09:00
parent a8bc87f5d8
commit 9473b53226

View File

@ -71,27 +71,20 @@ namespace osu.Game.Skinning
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)