1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 10:42:54 +08:00

Fix typos and missing fields in JSON mappings.

This commit is contained in:
naoey 2018-02-26 11:46:16 +05:30
parent 5724618b2a
commit a20e4bc2c3
No known key found for this signature in database
GPG Key ID: 3908EC682A3E19C7
2 changed files with 31 additions and 11 deletions

View File

@ -28,7 +28,7 @@ namespace osu.Game.Online.API.Requests
[JsonProperty("id")] [JsonProperty("id")]
public int ID; public int ID;
[JsonProperty("created_at")] [JsonProperty("createdAt")]
public DateTimeOffset CreatedAt; public DateTimeOffset CreatedAt;
[JsonProperty] [JsonProperty]
@ -50,6 +50,9 @@ namespace osu.Game.Online.API.Requests
[JsonProperty("rank")] [JsonProperty("rank")]
public int Rank; public int Rank;
[JsonProperty("approval")]
public BeatmapApproval Approval;
[JsonProperty("count")] [JsonProperty("count")]
public int Count; public int Count;
@ -59,10 +62,13 @@ namespace osu.Game.Online.API.Requests
[JsonProperty("beatmap")] [JsonProperty("beatmap")]
public RecentActivityBeatmap Beatmap; public RecentActivityBeatmap Beatmap;
[JsonProperty("beatmapset")]
public RecentActivityBeatmap Beatmapset;
[JsonProperty("user")] [JsonProperty("user")]
public RecentActivityUser User; public RecentActivityUser User;
[JsonProperty("achivementName")] [JsonProperty("achievementName")]
public string AchivementName; public string AchivementName;
public class RecentActivityBeatmap public class RecentActivityBeatmap
@ -104,4 +110,11 @@ namespace osu.Game.Online.API.Requests
UserSupportGift, UserSupportGift,
UsernameChange, UsernameChange,
} }
public enum BeatmapApproval
{
Ranked,
Approved,
Qualified,
}
} }

View File

@ -21,6 +21,7 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
private readonly RecentActivity activity; private readonly RecentActivity activity;
private readonly string userLinkTemplate; private readonly string userLinkTemplate;
private readonly string beatmapLinkTemplate; private readonly string beatmapLinkTemplate;
private readonly string beatmapsetLinkTemplate;
private LinkFlowContainer content; private LinkFlowContainer content;
@ -30,6 +31,7 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
userLinkTemplate = $"[{urlToAbsolute(activity.User?.Url)} {activity.User?.Username}]"; userLinkTemplate = $"[{urlToAbsolute(activity.User?.Url)} {activity.User?.Username}]";
beatmapLinkTemplate = $"[{urlToAbsolute(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]"; beatmapLinkTemplate = $"[{urlToAbsolute(activity.Beatmap?.Url)} {activity.Beatmap?.Title}]";
beatmapsetLinkTemplate = $"[{urlToAbsolute(activity.Beatmapset?.Url)} {activity.Beatmapset?.Title}]";
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -70,6 +72,8 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
FillMode = FillMode.Fit, FillMode = FillMode.Fit,
}; };
case RecentActivityType.Medal:
// TODO: add medal visual
default: default:
return new Container return new Container
{ {
@ -92,26 +96,29 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
case RecentActivityType.BeatmapPlaycount: case RecentActivityType.BeatmapPlaycount:
return $"{beatmapLinkTemplate} has been played {activity.Count} times!"; return $"{beatmapLinkTemplate} has been played {activity.Count} times!";
case RecentActivityType.BeatmapsetApprove:
return $"{beatmapsetLinkTemplate} has been {activity.Approval.ToString().ToLowerInvariant()}!";
case RecentActivityType.BeatmapsetDelete: case RecentActivityType.BeatmapsetDelete:
return $"{beatmapLinkTemplate} has been deleted."; return $"{beatmapsetLinkTemplate} has been deleted.";
case RecentActivityType.BeatmapsetRevive: case RecentActivityType.BeatmapsetRevive:
return $"{beatmapLinkTemplate} has been revived from eternal slumber by ${userLinkTemplate}"; return $"{beatmapsetLinkTemplate} has been revived from eternal slumber by {userLinkTemplate}.";
case RecentActivityType.BeatmapsetUpdate: case RecentActivityType.BeatmapsetUpdate:
return $"{userLinkTemplate} has updated the beatmap ${beatmapLinkTemplate}"; return $"{userLinkTemplate} has updated the beatmap {beatmapsetLinkTemplate}!";
case RecentActivityType.BeatmapsetUpload: case RecentActivityType.BeatmapsetUpload:
return $"{userLinkTemplate} has submitted a new beatmap ${beatmapLinkTemplate}"; return $"{userLinkTemplate} has submitted a new beatmap {beatmapsetLinkTemplate}!";
case RecentActivityType.Medal: case RecentActivityType.Medal:
return $"{userLinkTemplate} has unlocked the {activity.AchivementName} medal!"; return $"{userLinkTemplate} has unlocked the {activity.AchivementName} medal!";
case RecentActivityType.Rank: case RecentActivityType.Rank:
return $"{userLinkTemplate} achieved rank #{activity.Rank} on {beatmapLinkTemplate}"; return $"{userLinkTemplate} achieved rank #{activity.Rank} on {beatmapLinkTemplate} ({activity.Mode}!)";
case RecentActivityType.RankLost: case RecentActivityType.RankLost:
return $"{userLinkTemplate} has lost first place on {beatmapLinkTemplate}!"; return $"{userLinkTemplate} has lost first place on {beatmapLinkTemplate} ({activity.Mode}!)";
case RecentActivityType.UserSupportAgain: case RecentActivityType.UserSupportAgain:
return $"{userLinkTemplate} has once again chosen to support osu! - thanks for your generosity!"; return $"{userLinkTemplate} has once again chosen to support osu! - thanks for your generosity!";
@ -119,12 +126,12 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
case RecentActivityType.UserSupportFirst: case RecentActivityType.UserSupportFirst:
return $"{userLinkTemplate} has become an osu! supporter - thanks for your generosity!"; return $"{userLinkTemplate} has become an osu! supporter - thanks for your generosity!";
case RecentActivityType.UsernameChange:
return $"{activity.User.PreviousUsername} has changed their username to {userLinkTemplate}";
case RecentActivityType.UserSupportGift: case RecentActivityType.UserSupportGift:
return $"{userLinkTemplate} has received the gift of osu! supporter!"; return $"{userLinkTemplate} has received the gift of osu! supporter!";
case RecentActivityType.UsernameChange:
return $"{activity.User.PreviousUsername} has changed their username to {userLinkTemplate}!";
default: default:
return string.Empty; return string.Empty;
} }