Rename realm-backed resource store in preparation for non-legacy usage

This commit is contained in:
Dean Herbert 2022-03-22 18:30:54 +09:00
parent 056e568ffb
commit 09ec49e6fa
3 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,7 @@ namespace osu.Game.Skinning
resources,
// A default legacy skin may still have a skin.ini if it is modified by the user.
// We must specify the stream directly as we are redirecting storage to the osu-resources location for other files.
new LegacyDatabasedSkinResourceStore(skin, resources.Files).GetStream("skin.ini")
new RealmBackedResourceStore(skin, resources.Files).GetStream("skin.ini")
)
{
Configuration.CustomColours["SliderBall"] = new Color4(2, 170, 255, 255);

View File

@ -51,7 +51,7 @@ namespace osu.Game.Skinning
[UsedImplicitly(ImplicitUseKindFlags.InstantiatedWithFixedConstructorSignature)]
public LegacySkin(SkinInfo skin, IStorageResourceProvider resources)
: this(skin, new LegacyDatabasedSkinResourceStore(skin, resources.Files), resources, "skin.ini")
: this(skin, new RealmBackedResourceStore(skin, resources.Files), resources, "skin.ini")
{
}

View File

@ -4,21 +4,22 @@
using System.Collections.Generic;
using osu.Framework.Extensions;
using osu.Framework.IO.Stores;
using osu.Game.Database;
using osu.Game.Extensions;
namespace osu.Game.Skinning
{
public class LegacyDatabasedSkinResourceStore : ResourceStore<byte[]>
public class RealmBackedResourceStore : ResourceStore<byte[]>
{
private readonly Dictionary<string, string> fileToStoragePathMapping = new Dictionary<string, string>();
public LegacyDatabasedSkinResourceStore(SkinInfo source, IResourceStore<byte[]> underlyingStore)
public RealmBackedResourceStore(IHasRealmFiles source, IResourceStore<byte[]> underlyingStore)
: base(underlyingStore)
{
initialiseFileCache(source);
}
private void initialiseFileCache(SkinInfo source)
private void initialiseFileCache(IHasRealmFiles source)
{
fileToStoragePathMapping.Clear();
foreach (var f in source.Files)