mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Add combo/colour metadata to CatchBaseHit
This commit is contained in:
@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
yield return new Fruit
|
||||
{
|
||||
StartTime = obj.StartTime,
|
||||
NewCombo = (obj as IHasCombo)?.NewCombo ?? false,
|
||||
Position = ((IHasXPosition)obj).X / OsuPlayfield.BASE_SIZE.X
|
||||
};
|
||||
}
|
||||
|
36
osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
Normal file
36
osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapProcessor.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Beatmaps;
|
||||
using osu.Game.Rulesets.Catch.Objects;
|
||||
|
||||
namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||
{
|
||||
internal class CatchBeatmapProcessor : BeatmapProcessor<CatchBaseHit>
|
||||
{
|
||||
public override void PostProcess(Beatmap<CatchBaseHit> beatmap)
|
||||
{
|
||||
if (beatmap.ComboColors.Count == 0)
|
||||
return;
|
||||
|
||||
int comboIndex = 0;
|
||||
int colourIndex = 0;
|
||||
|
||||
CatchBaseHit lastObj = null;
|
||||
|
||||
foreach (var obj in beatmap.HitObjects)
|
||||
{
|
||||
if (obj.NewCombo)
|
||||
{
|
||||
if (lastObj != null) lastObj.LastInCombo = true;
|
||||
|
||||
comboIndex = 0;
|
||||
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
|
||||
}
|
||||
|
||||
obj.ComboIndex = comboIndex++;
|
||||
obj.ComboColour = beatmap.ComboColors[colourIndex];
|
||||
|
||||
lastObj = obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user