1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 20:23:00 +08:00

Parse legacy version of decoded skin to numerical

This commit is contained in:
iiSaLMaN 2019-10-09 23:05:50 +03:00
parent 003af19e3f
commit 7f6541672c

View File

@ -5,14 +5,14 @@ using osu.Game.Beatmaps.Formats;
namespace osu.Game.Skinning namespace osu.Game.Skinning
{ {
public class LegacySkinDecoder : LegacyDecoder<DefaultSkinConfiguration> public class LegacySkinDecoder : LegacyDecoder<LegacySkinConfiguration>
{ {
public LegacySkinDecoder() public LegacySkinDecoder()
: base(1) : base(1)
{ {
} }
protected override void ParseLine(DefaultSkinConfiguration skin, Section section, string line) protected override void ParseLine(LegacySkinConfiguration skin, Section section, string line)
{ {
if (section != Section.Colours) if (section != Section.Colours)
{ {
@ -32,6 +32,14 @@ namespace osu.Game.Skinning
case @"Author": case @"Author":
skin.SkinInfo.Creator = pair.Value; skin.SkinInfo.Creator = pair.Value;
return; return;
case @"Version":
if (pair.Value == "latest" || pair.Value == "User")
skin.LegacyVersion = LegacySkinConfiguration.LATEST_VERSION;
else if (double.TryParse(pair.Value, out var version))
skin.LegacyVersion = version;
return;
} }
break; break;