mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
ResourcesSkin -> ResourceStoreBackedSkin
This commit is contained in:
@ -19,12 +19,12 @@ namespace osu.Game.Skinning
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An <see cref="ISkin"/> that uses an underlying <see cref="IResourceStore{T}"/> with namespaces for resources retrieval.
|
/// An <see cref="ISkin"/> that uses an underlying <see cref="IResourceStore{T}"/> with namespaces for resources retrieval.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ResourcesSkin : ISkin, IDisposable
|
public class ResourceStoreBackedSkin : ISkin, IDisposable
|
||||||
{
|
{
|
||||||
private readonly TextureStore textures;
|
private readonly TextureStore textures;
|
||||||
private readonly ISampleStore samples;
|
private readonly ISampleStore samples;
|
||||||
|
|
||||||
public ResourcesSkin(IResourceStore<byte[]> resources, GameHost host, AudioManager audio)
|
public ResourceStoreBackedSkin(IResourceStore<byte[]> resources, GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
textures = new TextureStore(host.CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
|
textures = new TextureStore(host.CreateTextureLoaderStore(new NamespacedResourceStore<byte[]>(resources, @"Textures")));
|
||||||
samples = audio.GetSampleStore(new NamespacedResourceStore<byte[]>(resources, @"Samples"));
|
samples = audio.GetSampleStore(new NamespacedResourceStore<byte[]>(resources, @"Samples"));
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Audio;
|
using osu.Framework.Audio;
|
||||||
@ -52,13 +51,13 @@ namespace osu.Game.Skinning
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private ISkinSource skinSource { get; set; }
|
private ISkinSource skinSource { get; set; }
|
||||||
|
|
||||||
private ResourcesSkin rulesetResourcesSkin;
|
private ResourceStoreBackedSkin rulesetResourcesSkin;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(GameHost host, AudioManager audio)
|
private void load(GameHost host, AudioManager audio)
|
||||||
{
|
{
|
||||||
if (Ruleset.CreateResourceStore() is IResourceStore<byte[]> resources)
|
if (Ruleset.CreateResourceStore() is IResourceStore<byte[]> resources)
|
||||||
rulesetResourcesSkin = new ResourcesSkin(resources, host, audio);
|
rulesetResourcesSkin = new ResourceStoreBackedSkin(resources, host, audio);
|
||||||
|
|
||||||
UpdateSkins();
|
UpdateSkins();
|
||||||
skinSource.SourceChanged += OnSourceChanged;
|
skinSource.SourceChanged += OnSourceChanged;
|
||||||
|
Reference in New Issue
Block a user