1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Merge pull request #25443 from peppy/fix-argon-custom-skins

Fix customised argon skins no longer loading due to incorrect resource store specification
This commit is contained in:
Bartłomiej Dach 2023-11-14 23:11:39 +09:00 committed by GitHub
commit 711bf14c06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 11 deletions

View File

@ -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<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;
}
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;

View File

@ -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<byte[]>(resources.Resources, "Skins/Argon")
resources
)
{
Resources = resources;

View File

@ -37,7 +37,7 @@
</PackageReference>
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="ppy.osu.Framework" Version="2023.1111.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.1110.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2023.1114.0" />
<PackageReference Include="Sentry" Version="3.40.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.33.0" />