Fix indices in beatmap not being transferred to children (and being off by one)

This commit is contained in:
Dean Herbert 2020-02-19 15:37:12 +09:00
parent 69b5d5606a
commit 5261579531
2 changed files with 5 additions and 3 deletions

View File

@ -34,12 +34,14 @@ public override void PostProcess()
foreach (var obj in Beatmap.HitObjects.OfType<CatchHitObject>())
{
obj.IndexInBeatmap = index++;
obj.IndexInBeatmap = index;
foreach (var nested in obj.NestedHitObjects.OfType<CatchHitObject>())
nested.IndexInBeatmap = obj.IndexInBeatmap;
nested.IndexInBeatmap = index;
if (obj.LastInCombo && obj.NestedHitObjects.LastOrDefault() is IHasComboInformation lastNested)
lastNested.LastInCombo = true;
index++;
}
}

View File

@ -51,7 +51,7 @@ private void load()
protected override void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours)
{
// ignore the incoming combo colour as we use a custom lookup
AccentColour.Value = comboColours[HitObject.IndexInBeatmap % comboColours.Count];
AccentColour.Value = comboColours[(HitObject.IndexInBeatmap + 1) % comboColours.Count];
}
}
}