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

Merge pull request #8650 from peppy/skinnable-test-scene-recompilation

Fix SkinnableTestScene losing test resources on dynamic recompilation
This commit is contained in:
Dean Herbert 2020-04-07 16:20:00 +09:00 committed by GitHub
commit 39fd297d7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,6 +26,9 @@ namespace osu.Game.Tests.Visual
private Skin specialSkin;
private Skin oldSkin;
// Keep a static reference to ensure we don't use a dynamically recompiled DLL as a source (resources will be missing).
private static DllResourceStore dllStore;
protected SkinnableTestScene()
: base(2, 3)
{
@ -34,7 +37,7 @@ namespace osu.Game.Tests.Visual
[BackgroundDependencyLoader]
private void load(AudioManager audio, SkinManager skinManager)
{
var dllStore = new DllResourceStore(GetType().Assembly);
dllStore ??= new DllResourceStore(GetType().Assembly);
metricsSkin = new TestLegacySkin(new SkinInfo { Name = "metrics-skin" }, new NamespacedResourceStore<byte[]>(dllStore, "Resources/metrics_skin"), audio, true);
defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info);