Skip to content

Commit

Permalink
Make the internal skin storage resource provider public.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Oct 10, 2022
1 parent 2f92d07 commit 276c4a9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) andy840119 <[email protected]>. Licensed under the GPL Licence.
// See the LICENCE file in the repository root for full licence text.

#nullable disable

using osu.Framework.Audio;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Rendering.Dummy;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Game.Database;
using osu.Game.IO;

namespace osu.Game.Rulesets.Karaoke.Skinning
{
public class InternalSkinStorageResourceProvider : IStorageResourceProvider
{
public InternalSkinStorageResourceProvider(string skinName)
{
var store = new KaraokeRuleset().CreateResourceStore();
Files = Resources = new NamespacedResourceStore<byte[]>(store, $"Skin/{skinName}");
}

public IRenderer Renderer => new DummyRenderer();

public AudioManager AudioManager => null;
public IResourceStore<byte[]> Files { get; }
public IResourceStore<byte[]> Resources { get; }
public RealmAccess RealmAccess => null;
public IResourceStore<TextureUpload> CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore) => null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@

using System;
using System.ComponentModel;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Rendering.Dummy;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.IO;
using osu.Game.Rulesets.Karaoke.UI.HUD;
using osu.Game.Rulesets.Scoring;
using osu.Game.Skinning;
Expand Down Expand Up @@ -102,26 +95,5 @@ public TempLegacySkin(SkinInfo skin)
{
}
}

#nullable disable

private class InternalSkinStorageResourceProvider : IStorageResourceProvider
{
public InternalSkinStorageResourceProvider(string skinName)
{
var store = new KaraokeRuleset().CreateResourceStore();
Files = Resources = new NamespacedResourceStore<byte[]>(store, $"Skin/{skinName}");
}

public IRenderer Renderer => new DummyRenderer();

public AudioManager AudioManager => null;
public IResourceStore<byte[]> Files { get; }
public IResourceStore<byte[]> Resources { get; }
public RealmAccess RealmAccess => null;
public IResourceStore<TextureUpload> CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore) => null;
}

#nullable enable
}
}

0 comments on commit 276c4a9

Please sign in to comment.