mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Resolve inner items early in process and rename variable
This commit is contained in:
parent
41fb3371e5
commit
df85092426
@ -41,25 +41,25 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected override int Compare(Drawable x, Drawable y)
|
protected override int Compare(Drawable x, Drawable y)
|
||||||
{
|
{
|
||||||
var xObj = (SelectionBlueprint<HitObject>)x;
|
var xObj = ((SelectionBlueprint<HitObject>)x).Item;
|
||||||
var yObj = (SelectionBlueprint<HitObject>)y;
|
var yObj = ((SelectionBlueprint<HitObject>)y).Item;
|
||||||
|
|
||||||
// Put earlier blueprints towards the end of the list, so they handle input first
|
// Put earlier blueprints towards the end of the list, so they handle input first
|
||||||
int i = yObj.Item.StartTime.CompareTo(xObj.Item.StartTime);
|
int result = yObj.StartTime.CompareTo(xObj.StartTime);
|
||||||
if (i != 0) return i;
|
if (result != 0) return result;
|
||||||
|
|
||||||
// Fall back to end time if the start time is equal.
|
// Fall back to end time if the start time is equal.
|
||||||
i = yObj.Item.GetEndTime().CompareTo(xObj.Item.GetEndTime());
|
result = yObj.GetEndTime().CompareTo(xObj.GetEndTime());
|
||||||
if (i != 0) return i;
|
if (result != 0) return result;
|
||||||
|
|
||||||
// As a final fallback, use combo information if available.
|
// As a final fallback, use combo information if available.
|
||||||
if (xObj.Item is IHasComboInformation xHasCombo && yObj.Item is IHasComboInformation yHasCombo)
|
if (xObj is IHasComboInformation xHasCombo && yObj is IHasComboInformation yHasCombo)
|
||||||
{
|
{
|
||||||
i = yHasCombo.ComboIndex.CompareTo(xHasCombo.ComboIndex);
|
result = yHasCombo.ComboIndex.CompareTo(xHasCombo.ComboIndex);
|
||||||
if (i != 0) return i;
|
if (result != 0) return result;
|
||||||
|
|
||||||
i = yHasCombo.IndexInCurrentCombo.CompareTo(xHasCombo.IndexInCurrentCombo);
|
result = yHasCombo.IndexInCurrentCombo.CompareTo(xHasCombo.IndexInCurrentCombo);
|
||||||
if (i != 0) return i;
|
if (result != 0) return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CompareReverseChildID(y, x);
|
return CompareReverseChildID(y, x);
|
||||||
|
Loading…
Reference in New Issue
Block a user