mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:43:21 +08:00
Fix customised argon skins no longer loading due to incorrect resource store spec
This commit is contained in:
parent
572ec918d6
commit
a745642f76
@ -9,11 +9,11 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Text;
|
using osu.Framework.Text;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Skinning;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -133,30 +133,30 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ISkinSource skin)
|
private void load(TextureStore textures)
|
||||||
{
|
{
|
||||||
Spacing = new Vector2(-2f, 0f);
|
Spacing = new Vector2(-2f, 0f);
|
||||||
Font = new FontUsage(@"argon-counter", 1);
|
Font = new FontUsage(@"argon-counter", 1);
|
||||||
glyphStore = new GlyphStore(skin, getLookup);
|
glyphStore = new GlyphStore(textures, getLookup);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore);
|
protected override TextBuilder CreateTextBuilder(ITexturedGlyphLookupStore store) => base.CreateTextBuilder(glyphStore);
|
||||||
|
|
||||||
private class GlyphStore : ITexturedGlyphLookupStore
|
private class GlyphStore : ITexturedGlyphLookupStore
|
||||||
{
|
{
|
||||||
private readonly ISkin skin;
|
private readonly TextureStore textures;
|
||||||
private readonly Func<char, string> getLookup;
|
private readonly Func<char, string> getLookup;
|
||||||
|
|
||||||
public GlyphStore(ISkin skin, Func<char, string> getLookup)
|
public GlyphStore(TextureStore textures, Func<char, string> getLookup)
|
||||||
{
|
{
|
||||||
this.skin = skin;
|
this.textures = textures;
|
||||||
this.getLookup = getLookup;
|
this.getLookup = getLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ITexturedCharacterGlyph? Get(string fontName, char character)
|
public ITexturedCharacterGlyph? Get(string fontName, char character)
|
||||||
{
|
{
|
||||||
string lookup = getLookup(character);
|
string lookup = getLookup(character);
|
||||||
var texture = skin.GetTexture($"{fontName}-{lookup}");
|
var texture = textures.Get($"Gameplay/Fonts/{fontName}-{lookup}");
|
||||||
|
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -8,7 +8,6 @@ using osu.Framework.Audio.Sample;
|
|||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.IO.Stores;
|
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps.Formats;
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osu.Game.Extensions;
|
using osu.Game.Extensions;
|
||||||
@ -44,8 +43,7 @@ namespace osu.Game.Skinning
|
|||||||
public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources)
|
public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources)
|
||||||
: base(
|
: base(
|
||||||
skin,
|
skin,
|
||||||
resources,
|
resources
|
||||||
new NamespacedResourceStore<byte[]>(resources.Resources, "Skins/Argon")
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Resources = resources;
|
Resources = resources;
|
||||||
|
Loading…
Reference in New Issue
Block a user