mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:47:26 +08:00
Merge pull request #3424 from Hanamuke/fix_combo
Fruit type now depends on combo (osu!catch)
This commit is contained in:
commit
3bd719072c
@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
|
|
||||||
public int IndexInBeatmap { get; set; }
|
public int IndexInBeatmap { get; set; }
|
||||||
|
|
||||||
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4);
|
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(ComboIndex % 4);
|
||||||
|
|
||||||
public virtual bool NewCombo { get; set; }
|
public virtual bool NewCombo { get; set; }
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
@ -44,6 +45,25 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public virtual void PostProcess()
|
public virtual void PostProcess()
|
||||||
{
|
{
|
||||||
|
void updateNestedCombo(HitObject obj, int comboIndex, int indexInCurrentCombo)
|
||||||
|
{
|
||||||
|
if (obj is IHasComboInformation objectComboInfo)
|
||||||
|
{
|
||||||
|
objectComboInfo.ComboIndex = comboIndex;
|
||||||
|
objectComboInfo.IndexInCurrentCombo = indexInCurrentCombo;
|
||||||
|
foreach (var nestedObject in obj.NestedHitObjects)
|
||||||
|
updateNestedCombo(nestedObject, comboIndex, indexInCurrentCombo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var hitObject in Beatmap.HitObjects)
|
||||||
|
{
|
||||||
|
if (hitObject is IHasComboInformation objectComboInfo)
|
||||||
|
{
|
||||||
|
foreach (var nested in hitObject.NestedHitObjects)
|
||||||
|
updateNestedCombo(nested, objectComboInfo.ComboIndex, objectComboInfo.IndexInCurrentCombo);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user