diff --git a/osu.Game/Graphics/Containers/OsuHoverContainer.cs b/osu.Game/Graphics/Containers/OsuHoverContainer.cs index f94fb2540c..1e0b56dae3 100644 --- a/osu.Game/Graphics/Containers/OsuHoverContainer.cs +++ b/osu.Game/Graphics/Containers/OsuHoverContainer.cs @@ -33,7 +33,7 @@ namespace osu.Game.Graphics.Containers [BackgroundDependencyLoader] private void load(OsuColour colours) { - if(HoverColour == default) + if (HoverColour == default) HoverColour = colours.Yellow; } diff --git a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs index df0409272f..7bb1b8acc2 100644 --- a/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/BottomHeaderContainer.cs @@ -24,13 +24,17 @@ namespace osu.Game.Overlays.Profile.Header private Color4 linkBlue, communityUserGrayGreenLighter; private User user; + public User User { get => user; set { - if (user == value) return; + if (user == value) + return; + user = value; + updateDisplay(); } } @@ -131,9 +135,8 @@ namespace osu.Game.Overlays.Profile.Header }); } else - { bottomLinkContainer.AddText(" " + content, bold); - } + addSpacer(bottomLinkContainer); } diff --git a/osu.Game/Overlays/Profile/Header/CenterHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/CenterHeaderContainer.cs index fc330a03a9..ca615ccf4b 100644 --- a/osu.Game/Overlays/Profile/Header/CenterHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/CenterHeaderContainer.cs @@ -48,13 +48,17 @@ namespace osu.Game.Overlays.Profile.Header private APIAccess apiAccess { get; set; } private User user; + public User User { get => user; set { - if (user == value) return; + if (user == value) + return; + user = value; + updateDisplay(); } } @@ -183,7 +187,7 @@ namespace osu.Game.Overlays.Profile.Header { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium) + Font = OsuFont.GetFont(size: 20) } } }, diff --git a/osu.Game/Overlays/Profile/Header/DetailHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/DetailHeaderContainer.cs index 124299b0ba..a7d21bcdf3 100644 --- a/osu.Game/Overlays/Profile/Header/DetailHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/DetailHeaderContainer.cs @@ -26,13 +26,17 @@ namespace osu.Game.Overlays.Profile.Header private RankGraph rankGraph; private User user; + public User User { get => user; set { - if (user == value) return; + if (user == value) + return; + user = value; + updateDisplay(); } } @@ -181,7 +185,7 @@ namespace osu.Game.Overlays.Profile.Header totalPlayTimeTooltip.TooltipText = (user?.Statistics?.PlayTime ?? 0) / 3600 + " hours"; foreach (var scoreRankInfo in scoreRankInfos) - scoreRankInfo.Value.RankCount = user?.Statistics?.GradesCount.GetForScoreRank(scoreRankInfo.Key) ?? 0; + scoreRankInfo.Value.RankCount = user?.Statistics?.GradesCount[scoreRankInfo.Key] ?? 0; detailGlobalRank.Content = user?.Statistics?.Ranks.Global?.ToString("#,##0") ?? "-"; detailCountryRank.Content = user?.Statistics?.Ranks.Country?.ToString("#,##0") ?? "-"; diff --git a/osu.Game/Overlays/Profile/Header/MedalHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/MedalHeaderContainer.cs index 5a54270b80..45c1e1e208 100644 --- a/osu.Game/Overlays/Profile/Header/MedalHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/MedalHeaderContainer.cs @@ -22,13 +22,17 @@ namespace osu.Game.Overlays.Profile.Header private FillFlowContainer badgeFlowContainer; private User user; + public User User { get => user; set { - if (user == value) return; + if (user == value) + return; + user = value; + updateDisplay(); } } diff --git a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs index 4186d08729..13a7951170 100644 --- a/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs +++ b/osu.Game/Overlays/Profile/Header/TopHeaderContainer.cs @@ -28,13 +28,17 @@ namespace osu.Game.Overlays.Profile.Header private const float avatar_size = 110; private User user; + public User User { get => user; set { - if (user == value) return; + if (user == value) + return; + user = value; + updateDisplay(); } } diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index d8e1ec81b5..314684069a 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -186,10 +186,13 @@ namespace osu.Game.Users { [Description("Keyboard")] Keyboard, + [Description("Mouse")] Mouse, + [Description("Tablet")] Tablet, + [Description("Touch Screen")] Touch, } diff --git a/osu.Game/Users/UserStatistics.cs b/osu.Game/Users/UserStatistics.cs index a69cd794b3..752534a80d 100644 --- a/osu.Game/Users/UserStatistics.cs +++ b/osu.Game/Users/UserStatistics.cs @@ -77,16 +77,25 @@ namespace osu.Game.Users [JsonProperty(@"a")] public int A; - public int GetForScoreRank(ScoreRank rank) + public int this[ScoreRank rank] { - switch (rank) + get { - case ScoreRank.XH: return SSPlus; - case ScoreRank.X: return SS; - case ScoreRank.SH: return SPlus; - case ScoreRank.S: return S; - case ScoreRank.A: return A; - default: throw new ArgumentException($"API does not return {rank.ToString()}"); + switch (rank) + { + case ScoreRank.XH: + return SSPlus; + case ScoreRank.X: + return SS; + case ScoreRank.SH: + return SPlus; + case ScoreRank.S: + return S; + case ScoreRank.A: + return A; + default: + throw new ArgumentException($"API does not return {rank.ToString()}"); + } } } }