Fix panel depth ordering

This commit is contained in:
smoogipoo 2020-06-19 18:02:54 +09:00
parent ec16b0fc5a
commit 55196efe6e
1 changed files with 16 additions and 0 deletions

View File

@ -211,6 +211,22 @@ private class Flow : FillFlowContainer<ScorePanelTrackingContainer>
private IEnumerable<ScorePanelTrackingContainer> applySorting(IEnumerable<Drawable> drawables) => drawables.OfType<ScorePanelTrackingContainer>()
.OrderByDescending(s => s.Panel.Score.TotalScore)
.ThenBy(s => s.Panel.Score.OnlineScoreID);
protected override int Compare(Drawable x, Drawable y)
{
var tX = (ScorePanelTrackingContainer)x;
var tY = (ScorePanelTrackingContainer)y;
int result = tY.Panel.Score.TotalScore.CompareTo(tX.Panel.Score.TotalScore);
if (result != 0)
return result;
if (tX.Panel.Score.OnlineScoreID == null || tY.Panel.Score.OnlineScoreID == null)
return base.Compare(x, y);
return tX.Panel.Score.OnlineScoreID.Value.CompareTo(tY.Panel.Score.OnlineScoreID.Value);
}
}
private class Scroll : OsuScrollContainer