mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #21167 from peppy/fix-storyboard-variables
Fix some issues with storyboard variables
This commit is contained in:
@ -130,14 +130,20 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected KeyValuePair<string, string> SplitKeyVal(string line, char separator = ':')
|
protected KeyValuePair<string, string> SplitKeyVal(string line, char separator = ':', bool shouldTrim = true)
|
||||||
{
|
{
|
||||||
string[] split = line.Split(separator, 2);
|
string[] split = line.Split(separator, 2);
|
||||||
|
|
||||||
|
if (shouldTrim)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < split.Length; i++)
|
||||||
|
split[i] = split[i].Trim();
|
||||||
|
}
|
||||||
|
|
||||||
return new KeyValuePair<string, string>
|
return new KeyValuePair<string, string>
|
||||||
(
|
(
|
||||||
split[0].Trim(),
|
split[0],
|
||||||
split.Length > 1 ? split[1].Trim() : string.Empty
|
split.Length > 1 ? split[1] : string.Empty
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +79,8 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleEvents(string line)
|
private void handleEvents(string line)
|
||||||
{
|
{
|
||||||
|
decodeVariables(ref line);
|
||||||
|
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
|
|
||||||
foreach (char c in line)
|
foreach (char c in line)
|
||||||
@ -91,8 +93,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
line = line.Substring(depth);
|
line = line.Substring(depth);
|
||||||
|
|
||||||
decodeVariables(ref line);
|
|
||||||
|
|
||||||
string[] split = line.Split(',');
|
string[] split = line.Split(',');
|
||||||
|
|
||||||
if (depth == 0)
|
if (depth == 0)
|
||||||
@ -349,7 +349,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void handleVariables(string line)
|
private void handleVariables(string line)
|
||||||
{
|
{
|
||||||
var pair = SplitKeyVal(line, '=');
|
var pair = SplitKeyVal(line, '=', false);
|
||||||
variables[pair.Key] = pair.Value;
|
variables[pair.Key] = pair.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user