mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 19:42:56 +08:00
Merge branch 'master' into fix-player-testcases
This commit is contained in:
commit
3d8432aecf
@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
protected override IEnumerable<CatchBaseHit> ConvertHitObject(HitObject obj, Beatmap beatmap)
|
protected override IEnumerable<CatchBaseHit> ConvertHitObject(HitObject obj, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
var curveData = obj as IHasCurve;
|
var curveData = obj as IHasCurve;
|
||||||
var positionData = obj as IHasPosition;
|
var positionData = obj as IHasXPosition;
|
||||||
var comboData = obj as IHasCombo;
|
var comboData = obj as IHasCombo;
|
||||||
|
|
||||||
if (positionData == null)
|
if (positionData == null)
|
||||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Beatmaps
|
|||||||
public class BeatmapMetrics
|
public class BeatmapMetrics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Total vote counts of user ratings on a scale of 0..length.
|
/// Total vote counts of user ratings on a scale of 0..10 where 0 is unused (probably will be fixed at API?).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IEnumerable<int> Ratings { get; set; }
|
public IEnumerable<int> Ratings { get; set; }
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private const Easing easing = Easing.InOutCubic;
|
private const Easing easing = Easing.InOutCubic;
|
||||||
|
|
||||||
private float length;
|
private float length;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Length of the bar, ranges from 0 to 1
|
/// Length of the bar, ranges from 0 to 1
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -134,4 +135,4 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Vertical = TopToBottom | BottomToTop,
|
Vertical = TopToBottom | BottomToTop,
|
||||||
Horizontal = LeftToRight | RightToLeft,
|
Horizontal = LeftToRight | RightToLeft,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,11 +29,17 @@ namespace osu.Game.Screens.Select.Details
|
|||||||
if (value == metrics) return;
|
if (value == metrics) return;
|
||||||
metrics = value;
|
metrics = value;
|
||||||
|
|
||||||
var ratings = Metrics.Ratings.ToList();
|
const int rating_range = 10;
|
||||||
negativeRatings.Text = ratings.GetRange(0, ratings.Count / 2 + 1).Sum().ToString();
|
|
||||||
positiveRatings.Text = ratings.GetRange(ratings.Count / 2 + 1, ratings.Count / 2).Sum().ToString();
|
var ratings = Metrics.Ratings.ToList().GetRange(1, rating_range); // adjust for API returning weird empty data at 0.
|
||||||
ratingsBar.Length = (float)ratings.GetRange(0, ratings.Count / 2 + 1).Sum() / ratings.Sum();
|
|
||||||
graph.Values = Metrics.Ratings.Select(r => (float)r);
|
var negativeCount = ratings.GetRange(0, rating_range / 2).Sum();
|
||||||
|
var totalCount = ratings.Sum();
|
||||||
|
|
||||||
|
negativeRatings.Text = negativeCount.ToString();
|
||||||
|
positiveRatings.Text = (totalCount - negativeCount).ToString();
|
||||||
|
ratingsBar.Length = totalCount == 0 ? 0 : (float)negativeCount / totalCount;
|
||||||
|
graph.Values = ratings.GetRange(0, rating_range).Select(r => (float)r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user