mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 16:27:26 +08:00
Merge pull request #3023 from morguldir/fix_color_parsing
Only read numbers when handling colors.
This commit is contained in:
commit
7f4c6cad8c
@ -62,28 +62,30 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
||||
{
|
||||
var strippedLine = StripComments(line);
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case Section.General:
|
||||
handleGeneral(line);
|
||||
handleGeneral(strippedLine);
|
||||
return;
|
||||
case Section.Editor:
|
||||
handleEditor(line);
|
||||
handleEditor(strippedLine);
|
||||
return;
|
||||
case Section.Metadata:
|
||||
handleMetadata(line);
|
||||
return;
|
||||
case Section.Difficulty:
|
||||
handleDifficulty(line);
|
||||
handleDifficulty(strippedLine);
|
||||
return;
|
||||
case Section.Events:
|
||||
handleEvent(line);
|
||||
handleEvent(strippedLine);
|
||||
return;
|
||||
case Section.TimingPoints:
|
||||
handleTimingPoint(line);
|
||||
handleTimingPoint(strippedLine);
|
||||
return;
|
||||
case Section.HitObjects:
|
||||
handleHitObject(line);
|
||||
handleHitObject(strippedLine);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -57,6 +57,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
protected virtual void ParseLine(T output, Section section, string line)
|
||||
{
|
||||
line = StripComments(line);
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case Section.Colours:
|
||||
@ -65,6 +67,14 @@ namespace osu.Game.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
protected string StripComments(string line)
|
||||
{
|
||||
var index = line.IndexOf("//", StringComparison.Ordinal);
|
||||
if (index > 0)
|
||||
return line.Substring(0, index);
|
||||
return line;
|
||||
}
|
||||
|
||||
private bool hasComboColours;
|
||||
|
||||
private void handleColours(T output, string line)
|
||||
|
@ -42,6 +42,8 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
protected override void ParseLine(Storyboard storyboard, Section section, string line)
|
||||
{
|
||||
line = StripComments(line);
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case Section.Events:
|
||||
|
@ -14,6 +14,8 @@ namespace osu.Game.Skinning
|
||||
|
||||
protected override void ParseLine(SkinConfiguration skin, Section section, string line)
|
||||
{
|
||||
line = StripComments(line);
|
||||
|
||||
switch (section)
|
||||
{
|
||||
case Section.General:
|
||||
|
Loading…
Reference in New Issue
Block a user