2018-04-13 17:19:50 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps.Formats;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
|
{
|
|
|
|
|
public class LegacySkinDecoder : LegacyDecoder<SkinConfiguration>
|
|
|
|
|
{
|
|
|
|
|
public LegacySkinDecoder()
|
|
|
|
|
: base(1)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-20 17:32:24 +08:00
|
|
|
|
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-07-16 07:04:41 +08:00
|
|
|
|
line = StripComments(line);
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
switch (section)
|
|
|
|
|
{
|
|
|
|
|
case Section.General:
|
|
|
|
|
var pair = SplitKeyVal(line);
|
|
|
|
|
|
|
|
|
|
switch (pair.Key)
|
|
|
|
|
{
|
|
|
|
|
case @"Name":
|
2018-04-20 17:32:24 +08:00
|
|
|
|
skin.SkinInfo.Name = pair.Value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
break;
|
|
|
|
|
case @"Author":
|
2018-04-20 17:32:24 +08:00
|
|
|
|
skin.SkinInfo.Creator = pair.Value;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-20 17:32:24 +08:00
|
|
|
|
base.ParseLine(skin, section, line);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|