From a745642f764cf28b37800936186399f459cdd47d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 14 Nov 2023 22:01:56 +0900 Subject: [PATCH] Fix customised argon skins no longer loading due to incorrect resource store spec --- .../Screens/Play/HUD/ArgonCounterTextComponent.cs | 14 +++++++------- osu.Game/Skinning/ArgonSkin.cs | 4 +--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs index 56f60deae1..eabac9a3e6 100644 --- a/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs +++ b/osu.Game/Screens/Play/HUD/ArgonCounterTextComponent.cs @@ -9,11 +9,11 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; using osu.Framework.Localisation; using osu.Framework.Text; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osu.Game.Skinning; using osuTK; namespace osu.Game.Screens.Play.HUD @@ -133,30 +133,30 @@ namespace osu.Game.Screens.Play.HUD } [BackgroundDependencyLoader] - private void load(ISkinSource skin) + private void load(TextureStore textures) { Spacing = new Vector2(-2f, 0f); 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); private class GlyphStore : ITexturedGlyphLookupStore { - private readonly ISkin skin; + private readonly TextureStore textures; private readonly Func getLookup; - public GlyphStore(ISkin skin, Func getLookup) + public GlyphStore(TextureStore textures, Func getLookup) { - this.skin = skin; + this.textures = textures; this.getLookup = getLookup; } public ITexturedCharacterGlyph? Get(string fontName, char character) { string lookup = getLookup(character); - var texture = skin.GetTexture($"{fontName}-{lookup}"); + var texture = textures.Get($"Gameplay/Fonts/{fontName}-{lookup}"); if (texture == null) return null; diff --git a/osu.Game/Skinning/ArgonSkin.cs b/osu.Game/Skinning/ArgonSkin.cs index 637467c748..226de4088c 100644 --- a/osu.Game/Skinning/ArgonSkin.cs +++ b/osu.Game/Skinning/ArgonSkin.cs @@ -8,7 +8,6 @@ using osu.Framework.Audio.Sample; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Textures; -using osu.Framework.IO.Stores; using osu.Game.Audio; using osu.Game.Beatmaps.Formats; using osu.Game.Extensions; @@ -44,8 +43,7 @@ namespace osu.Game.Skinning public ArgonSkin(SkinInfo skin, IStorageResourceProvider resources) : base( skin, - resources, - new NamespacedResourceStore(resources.Resources, "Skins/Argon") + resources ) { Resources = resources;