mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 00:53:22 +08:00
Merge branch 'master' into beat-caret
This commit is contained in:
commit
3865090fff
@ -78,7 +78,7 @@ namespace osu.Game.Configuration
|
||||
Set(OsuSetting.MenuParallax, true);
|
||||
|
||||
// Gameplay
|
||||
Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01);
|
||||
Set(OsuSetting.DimLevel, 0.8, 0, 1, 0.01);
|
||||
Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01);
|
||||
Set(OsuSetting.LightenDuringBreaks, true);
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Game.Utils;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -29,10 +30,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours) => AccentColour = colours.BlueLighter;
|
||||
|
||||
protected override string FormatCount(double count)
|
||||
{
|
||||
return $@"{count:P2}";
|
||||
}
|
||||
protected override string FormatCount(double count) => count.FormatAccuracy();
|
||||
|
||||
protected override double GetProportionalDuration(double currentValue, double newValue)
|
||||
{
|
||||
|
@ -82,7 +82,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 90))
|
||||
};
|
||||
|
||||
foreach (var statistic in score.Statistics)
|
||||
foreach (var statistic in score.SortedStatistics)
|
||||
columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 50, maxSize: 70)));
|
||||
|
||||
columns.AddRange(new[]
|
||||
@ -150,7 +150,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
}
|
||||
});
|
||||
|
||||
foreach (var kvp in score.Statistics)
|
||||
foreach (var kvp in score.SortedStatistics)
|
||||
{
|
||||
content.Add(new OsuSpriteText
|
||||
{
|
||||
|
@ -99,9 +99,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
|
||||
ppColumn.Text = $@"{value.PP:N0}";
|
||||
|
||||
statisticsColumns.ChildrenEnumerable = value.Statistics
|
||||
.OrderByDescending(pair => pair.Key)
|
||||
.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
|
||||
statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
|
||||
modsColumn.Mods = value.Mods;
|
||||
}
|
||||
}
|
||||
|
@ -151,6 +151,8 @@ namespace osu.Game.Scoring
|
||||
[JsonProperty("statistics")]
|
||||
public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>();
|
||||
|
||||
public IOrderedEnumerable<KeyValuePair<HitResult, int>> SortedStatistics => Statistics.OrderByDescending(pair => pair.Key);
|
||||
|
||||
[JsonIgnore]
|
||||
[Column("Statistics")]
|
||||
public string StatisticsJson
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Utils;
|
||||
|
||||
namespace osu.Game.Screens.Play.Break
|
||||
{
|
||||
@ -85,6 +86,6 @@ namespace osu.Game.Screens.Play.Break
|
||||
{
|
||||
}
|
||||
|
||||
protected override string Format(double count) => $@"{count:P2}";
|
||||
protected override string Format(double count) => count.FormatAccuracy();
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ namespace osu.Game.Screens.Ranking.Pages
|
||||
},
|
||||
};
|
||||
|
||||
statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s));
|
||||
statisticsContainer.ChildrenEnumerable = Score.SortedStatistics.Select(s => new DrawableScoreStatistic(s));
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
|
@ -203,6 +203,21 @@ namespace osu.Game.Users
|
||||
public int ID;
|
||||
}
|
||||
|
||||
[JsonProperty("monthly_playcounts")]
|
||||
public UserHistoryCount[] MonthlyPlaycounts;
|
||||
|
||||
[JsonProperty("replays_watched_counts")]
|
||||
public UserHistoryCount[] ReplaysWatchedCounts;
|
||||
|
||||
public class UserHistoryCount
|
||||
{
|
||||
[JsonProperty("start_date")]
|
||||
public DateTime Date;
|
||||
|
||||
[JsonProperty("count")]
|
||||
public long Count;
|
||||
}
|
||||
|
||||
public override string ToString() => Username;
|
||||
|
||||
/// <summary>
|
||||
|
@ -7,18 +7,16 @@ namespace osu.Game.Utils
|
||||
{
|
||||
/// <summary>
|
||||
/// Turns the provided accuracy into a percentage with 2 decimal places.
|
||||
/// Omits all decimal places when <paramref name="accuracy"/> equals 1d.
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy to be formatted</param>
|
||||
/// <returns>formatted accuracy in percentage</returns>
|
||||
public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}";
|
||||
public static string FormatAccuracy(this double accuracy) => $"{accuracy:0.00%}";
|
||||
|
||||
/// <summary>
|
||||
/// Turns the provided accuracy into a percentage with 2 decimal places.
|
||||
/// Omits all decimal places when <paramref name="accuracy"/> equals 100m.
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy to be formatted</param>
|
||||
/// <returns>formatted accuracy in percentage</returns>
|
||||
public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%";
|
||||
public static string FormatAccuracy(this decimal accuracy) => $"{accuracy:0.00}%";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user