mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +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 int Combo { get; set; }
|
||||||
public Mod[] Mods { 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")]
|
[JsonProperty(@"replay_data")]
|
||||||
public Replay Replay;
|
public Replay Replay;
|
||||||
@ -38,10 +55,10 @@ namespace osu.Game.Modes.Scoring
|
|||||||
public long OnlineScoreID;
|
public long OnlineScoreID;
|
||||||
|
|
||||||
[JsonProperty(@"username")]
|
[JsonProperty(@"username")]
|
||||||
public string Username;
|
private string temporaryUsername;
|
||||||
|
|
||||||
[JsonProperty(@"user_id")]
|
[JsonProperty(@"user_id")]
|
||||||
public long UserID;
|
private long temporaryUserID;
|
||||||
|
|
||||||
[JsonProperty(@"date")]
|
[JsonProperty(@"date")]
|
||||||
public DateTime Date;
|
public DateTime Date;
|
||||||
|
@ -142,7 +142,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
avatar = new DelayedLoadWrapper(
|
avatar = new DelayedLoadWrapper(
|
||||||
new Avatar(Score.User ?? new User { Id = Score.UserID })
|
new Avatar(Score.User)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
CornerRadius = corner_radius,
|
CornerRadius = corner_radius,
|
||||||
@ -169,7 +169,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
nameLabel = new OsuSpriteText
|
nameLabel = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Score.User?.Username ?? Score.Username,
|
Text = Score.User.Username,
|
||||||
Font = @"Exo2.0-BoldItalic",
|
Font = @"Exo2.0-BoldItalic",
|
||||||
TextSize = 23,
|
TextSize = 23,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user