1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Merge branch 'master' into update-issue

This commit is contained in:
Dean Herbert 2018-03-12 12:57:03 +09:00 committed by GitHub
commit 78ed8448e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 10 deletions

View File

@ -58,6 +58,12 @@ namespace osu.Game.Tests.Visual
checkSupporterTag(false);
AddStep("Show null dummy", () => profile.ShowUser(new User
{
Username = @"Null",
Id = 1,
}, false));
AddStep("Show ppy", () => profile.ShowUser(new User
{
Username = @"peppy",

View File

@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Profile
{
placeholder.FadeIn(fade_duration, Easing.Out);
if (user == null)
if (user?.Statistics?.Ranks.Global == null)
{
rankText.Text = string.Empty;
performanceText.Text = string.Empty;
@ -105,7 +105,7 @@ namespace osu.Game.Overlays.Profile
return;
}
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global };
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global.Value };
ranks = userRanks.Select((x, index) => new KeyValuePair<int, int>(index, x)).Where(x => x.Value != 0).ToArray();
if (ranks.Length > 1)

View File

@ -169,15 +169,18 @@ namespace osu.Game.Overlays
{
Header.User = user;
foreach (string id in user.ProfileOrder)
if (user.ProfileOrder != null)
{
var sec = sections.FirstOrDefault(s => s.Identifier == id);
if (sec != null)
foreach (string id in user.ProfileOrder)
{
sec.User.Value = user;
var sec = sections.FirstOrDefault(s => s.Identifier == id);
if (sec != null)
{
sec.User.Value = user;
sectionsContainer.Add(sec);
tabs.AddItem(sec);
sectionsContainer.Add(sec);
tabs.AddItem(sec);
}
}
}
}

View File

@ -73,10 +73,10 @@ namespace osu.Game.Users
public struct UserRanks
{
[JsonProperty(@"global")]
public int Global;
public int? Global;
[JsonProperty(@"country")]
public int Country;
public int? Country;
}
}