mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 23:22:55 +08:00
Hide deprecated API storage variables and populate Score.User automatically.
This commit is contained in:
parent
24fea2809b
commit
ecfe68d6fb
@ -27,7 +27,24 @@ namespace osu.Game.Modes.Scoring
|
||||
public int Combo { get; set; }
|
||||
public Mod[] Mods { get; set; }
|
||||
|
||||
public User User { get; set; }
|
||||
private User user;
|
||||
|
||||
public User User
|
||||
{
|
||||
get
|
||||
{
|
||||
return user ?? new User
|
||||
{
|
||||
Username = temporaryUsername,
|
||||
Id = temporaryUserID
|
||||
};
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
user = value;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(@"replay_data")]
|
||||
public Replay Replay;
|
||||
@ -38,10 +55,10 @@ namespace osu.Game.Modes.Scoring
|
||||
public long OnlineScoreID;
|
||||
|
||||
[JsonProperty(@"username")]
|
||||
public string Username;
|
||||
private string temporaryUsername;
|
||||
|
||||
[JsonProperty(@"user_id")]
|
||||
public long UserID;
|
||||
private long temporaryUserID;
|
||||
|
||||
[JsonProperty(@"date")]
|
||||
public DateTime Date;
|
||||
|
@ -142,7 +142,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Children = new Drawable[]
|
||||
{
|
||||
avatar = new DelayedLoadWrapper(
|
||||
new Avatar(Score.User ?? new User { Id = Score.UserID })
|
||||
new Avatar(Score.User)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CornerRadius = corner_radius,
|
||||
@ -169,7 +169,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
nameLabel = new OsuSpriteText
|
||||
{
|
||||
Text = Score.User?.Username ?? Score.Username,
|
||||
Text = Score.User.Username,
|
||||
Font = @"Exo2.0-BoldItalic",
|
||||
TextSize = 23,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user