1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 06:45:37 +08:00
osu-lazer/osu.Game/Skinning/LegacySkinDecoder.cs

64 lines
1.8 KiB
C#
Raw Normal View History

2019-05-12 21:53:12 +08:00
// 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.
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps.Formats;
namespace osu.Game.Skinning
{
public class LegacySkinDecoder : LegacyDecoder<SkinConfiguration>
{
public LegacySkinDecoder()
: base(1)
{
}
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
2018-04-13 17:19:50 +08:00
{
line = StripComments(line);
var pair = SplitKeyVal(line);
2018-04-13 17:19:50 +08:00
switch (section)
{
case Section.General:
switch (pair.Key)
{
case @"Name":
skin.SkinInfo.Name = pair.Value;
2018-04-13 17:19:50 +08:00
break;
2019-04-01 11:44:46 +08:00
2018-04-13 17:19:50 +08:00
case @"Author":
skin.SkinInfo.Creator = pair.Value;
2018-04-13 17:19:50 +08:00
break;
2019-04-01 11:44:46 +08:00
2018-12-08 05:22:40 +08:00
case @"CursorExpand":
2018-12-09 20:29:14 +08:00
skin.CursorExpand = pair.Value != "0";
2018-12-08 05:22:40 +08:00
break;
2019-05-12 21:53:12 +08:00
2019-03-15 03:57:39 +08:00
case @"SliderBorderSize":
2019-05-12 21:53:03 +08:00
skin.SliderBorderSize = Parsing.ParseFloat(pair.Value);
2019-03-15 03:57:39 +08:00
break;
2018-04-13 17:19:50 +08:00
}
break;
case Section.Fonts:
switch (pair.Key)
{
case "HitCirclePrefix":
skin.HitCircleFont = pair.Value;
break;
2019-04-01 11:44:46 +08:00
case "HitCircleOverlap":
skin.HitCircleOverlap = int.Parse(pair.Value);
break;
}
break;
2018-04-13 17:19:50 +08:00
}
base.ParseLine(skin, section, line);
2018-04-13 17:19:50 +08:00
}
}
}