1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 13:33:03 +08:00

Allow variables of variables

Some storyboards like to do tricky stuff
This commit is contained in:
ColdVolcano 2017-05-27 00:13:46 -05:00
parent 0b770d1225
commit a523dfc388

View File

@ -32,7 +32,7 @@ namespace osu.Game.Beatmaps.Formats
private ConvertHitObjectParser parser; private ConvertHitObjectParser parser;
private Dictionary<string, string> variables = new Dictionary<string, string>(); private readonly Dictionary<string, string> variables = new Dictionary<string, string>();
private LegacySampleBank defaultSampleBank; private LegacySampleBank defaultSampleBank;
private int defaultSampleVolume = 100; private int defaultSampleVolume = 100;
@ -415,13 +415,16 @@ namespace osu.Game.Beatmaps.Formats
handleDifficulty(beatmap, key, val); handleDifficulty(beatmap, key, val);
break; break;
case Section.Events: case Section.Events:
string[] valSplit = val.Split(','); do
for (int i = 0; i < valSplit.Length; i++)
{ {
if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i])) string[] valSplit = val.Split(',');
valSplit[i] = variables[valSplit[i]]; for (int i = 0; i < valSplit.Length; i++)
} {
val = string.Join(",", valSplit); if (valSplit[i][0] == '$' && variables.ContainsKey(valSplit[i]))
valSplit[i] = variables[valSplit[i]];
}
val = string.Join(",", valSplit);
} while (val.IndexOf('$') != -1);
handleEvents(beatmap, val); handleEvents(beatmap, val);
break; break;
case Section.TimingPoints: case Section.TimingPoints: