1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Use order of new combo flags instead of StartTime

This commit is contained in:
Arthur Araujo 2024-03-26 04:59:47 -03:00
parent 78037fa477
commit 10683de578
2 changed files with 16 additions and 28 deletions

View File

@ -81,12 +81,13 @@ namespace osu.Game.Rulesets.Catch.Edit
double selectionStartTime = SelectedItems.Min(h => h.StartTime); double selectionStartTime = SelectedItems.Min(h => h.StartTime);
double selectionEndTime = SelectedItems.Max(h => h.GetEndTime()); double selectionEndTime = SelectedItems.Max(h => h.GetEndTime());
var newComboPlaces = hitObjects var newComboOrder = hitObjects
.OfType<CatchHitObject>() .OfType<CatchHitObject>()
.Where(h => h.NewCombo) .Select(obj => obj.NewCombo)
.Select(obj => obj.StartTime)
.ToList(); .ToList();
newComboOrder.Reverse();
foreach (var h in hitObjects) foreach (var h in hitObjects)
{ {
h.StartTime = selectionEndTime - (h.GetEndTime() - selectionStartTime); h.StartTime = selectionEndTime - (h.GetEndTime() - selectionStartTime);
@ -100,18 +101,11 @@ namespace osu.Game.Rulesets.Catch.Edit
} }
} }
foreach (var h in hitObjects) int i = 0;
foreach (bool newCombo in newComboOrder)
{ {
if (h is CatchHitObject obj) obj.NewCombo = false; hitObjects.OfType<CatchHitObject>().ToList()[i].NewCombo = newCombo;
} i++;
foreach (double place in newComboPlaces)
{
hitObjects
.OfType<CatchHitObject>()
.Where(obj => obj.StartTime == place)
.ToList()
.ForEach(obj => obj.NewCombo = true);
} }
return true; return true;

View File

@ -85,12 +85,13 @@ namespace osu.Game.Rulesets.Osu.Edit
bool moreThanOneObject = hitObjects.Count > 1; bool moreThanOneObject = hitObjects.Count > 1;
var newComboPlaces = hitObjects var newComboOrder = hitObjects
.OfType<OsuHitObject>() .OfType<OsuHitObject>()
.Where(h => h.NewCombo) .Select(obj => obj.NewCombo)
.Select(obj => obj.StartTime)
.ToList(); .ToList();
newComboOrder.Reverse();
foreach (var h in hitObjects) foreach (var h in hitObjects)
{ {
if (moreThanOneObject) if (moreThanOneObject)
@ -103,18 +104,11 @@ namespace osu.Game.Rulesets.Osu.Edit
} }
} }
foreach (var h in hitObjects) int i = 0;
foreach (bool newCombo in newComboOrder)
{ {
if (h is OsuHitObject obj) obj.NewCombo = false; hitObjects.OfType<OsuHitObject>().ToList()[i].NewCombo = newCombo;
} i++;
foreach (double place in newComboPlaces)
{
hitObjects
.OfType<OsuHitObject>()
.Where(obj => obj.StartTime == place)
.ToList()
.ForEach(obj => obj.NewCombo = true);
} }
return true; return true;