2019-05-12 13:53:12 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 08:43:03 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
using osu.Game.Beatmaps.Formats;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Skinning
|
|
|
|
|
{
|
|
|
|
|
public class LegacySkinDecoder : LegacyDecoder<SkinConfiguration>
|
|
|
|
|
{
|
|
|
|
|
public LegacySkinDecoder()
|
|
|
|
|
: base(1)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-20 09:32:24 +00:00
|
|
|
|
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-07-15 23:04:41 +00:00
|
|
|
|
line = StripComments(line);
|
|
|
|
|
|
2019-04-01 02:39:02 +00:00
|
|
|
|
var pair = SplitKeyVal(line);
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
switch (section)
|
|
|
|
|
{
|
|
|
|
|
case Section.General:
|
|
|
|
|
switch (pair.Key)
|
|
|
|
|
{
|
|
|
|
|
case @"Name":
|
2018-04-20 09:32:24 +00:00
|
|
|
|
skin.SkinInfo.Name = pair.Value;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
break;
|
2019-04-01 03:44:46 +00:00
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
case @"Author":
|
2018-04-20 09:32:24 +00:00
|
|
|
|
skin.SkinInfo.Creator = pair.Value;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
break;
|
2019-04-01 03:44:46 +00:00
|
|
|
|
|
2018-12-07 21:22:40 +00:00
|
|
|
|
case @"CursorExpand":
|
2018-12-09 12:29:14 +00:00
|
|
|
|
skin.CursorExpand = pair.Value != "0";
|
2018-12-07 21:22:40 +00:00
|
|
|
|
break;
|
2019-05-12 13:53:12 +00:00
|
|
|
|
|
2019-03-14 19:57:39 +00:00
|
|
|
|
case @"SliderBorderSize":
|
2019-05-12 13:53:03 +00:00
|
|
|
|
skin.SliderBorderSize = Parsing.ParseFloat(pair.Value);
|
2019-03-14 19:57:39 +00:00
|
|
|
|
break;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
2018-09-27 08:27:24 +00:00
|
|
|
|
|
2019-04-01 02:39:02 +00:00
|
|
|
|
case Section.Fonts:
|
2018-09-27 08:27:24 +00:00
|
|
|
|
switch (pair.Key)
|
|
|
|
|
{
|
|
|
|
|
case "HitCirclePrefix":
|
|
|
|
|
skin.HitCircleFont = pair.Value;
|
|
|
|
|
break;
|
2019-04-01 03:44:46 +00:00
|
|
|
|
|
2019-02-15 12:03:06 +00:00
|
|
|
|
case "HitCircleOverlap":
|
|
|
|
|
skin.HitCircleOverlap = int.Parse(pair.Value);
|
|
|
|
|
break;
|
2018-09-27 08:27:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-04-20 09:32:24 +00:00
|
|
|
|
base.ParseLine(skin, section, line);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|