mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 11:43:01 +08:00
Move dates fill into it's own method
This commit is contained in:
parent
d4b56aac84
commit
3cb1d04667
@ -44,8 +44,16 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
|
||||
if (values?.Length > 1)
|
||||
{
|
||||
// Fill dates with 0 count
|
||||
chart.Values = fillZeroValues(values);
|
||||
Show();
|
||||
return;
|
||||
}
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
private UserHistoryCount[] fillZeroValues(UserHistoryCount[] values)
|
||||
{
|
||||
var newValues = new List<UserHistoryCount> { values[0] };
|
||||
var newLast = values[0];
|
||||
|
||||
@ -63,18 +71,13 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
newValues.Add(newLast = values[i]);
|
||||
}
|
||||
|
||||
return newValues.ToArray();
|
||||
|
||||
static bool hasMissingDates(UserHistoryCount prev, UserHistoryCount current)
|
||||
{
|
||||
var possibleCurrent = prev.Date.AddMonths(1);
|
||||
return possibleCurrent != current.Date;
|
||||
}
|
||||
|
||||
chart.Values = newValues.ToArray();
|
||||
Show();
|
||||
return;
|
||||
}
|
||||
|
||||
Hide();
|
||||
}
|
||||
|
||||
protected abstract UserHistoryCount[] GetValues(User user);
|
||||
|
Loading…
Reference in New Issue
Block a user