mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
Move beatmap skin info creation to static method at IBeatmapSkin
This commit is contained in:
parent
87833bfb61
commit
9806d94b74
16
osu.Game/Skinning/BeatmapSkinExtensions.cs
Normal file
16
osu.Game/Skinning/BeatmapSkinExtensions.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// 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.
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
public static class BeatmapSkinExtensions
|
||||
{
|
||||
public static SkinInfo CreateSkinInfo(BeatmapInfo beatmap) => new SkinInfo
|
||||
{
|
||||
Name = beatmap.ToString(),
|
||||
Creator = beatmap.Metadata?.AuthorString,
|
||||
};
|
||||
}
|
||||
}
|
@ -17,7 +17,7 @@ namespace osu.Game.Skinning
|
||||
protected override bool UseCustomSampleBanks => true;
|
||||
|
||||
public LegacyBeatmapSkin(BeatmapInfo beatmap, IResourceStore<byte[]> storage, IStorageResourceProvider resources)
|
||||
: base(createSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), resources, beatmap.Path)
|
||||
: base(BeatmapSkinExtensions.CreateSkinInfo(beatmap), new LegacySkinResourceStore<BeatmapSetFileInfo>(beatmap.BeatmapSet, storage), resources, beatmap.Path)
|
||||
{
|
||||
// Disallow default colours fallback on beatmap skins to allow using parent skin combo colours. (via SkinProvidingContainer)
|
||||
Configuration.AllowDefaultComboColoursFallback = false;
|
||||
@ -49,8 +49,5 @@ namespace osu.Game.Skinning
|
||||
|
||||
return base.GetSample(sampleInfo);
|
||||
}
|
||||
|
||||
private static SkinInfo createSkinInfo(BeatmapInfo beatmap) =>
|
||||
new SkinInfo { Name = beatmap.ToString(), Creator = beatmap.Metadata.Author.ToString() };
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user