1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:17:23 +08:00

Simple implementation

This commit is contained in:
Andrei Zavatski 2019-07-21 21:41:07 +03:00
parent 38d39be678
commit de8ac9a428
3 changed files with 11 additions and 0 deletions

View File

@ -66,6 +66,11 @@ namespace osu.Game.Beatmaps
/// </summary>
public int FavouriteCount { get; set; }
/// <summary>
/// Whether this beatmap set has been favourited by the current user.
/// </summary>
public bool HasFavourited { get; set; }
/// <summary>
/// The availability of this beatmap set.
/// </summary>

View File

@ -30,6 +30,9 @@ namespace osu.Game.Online.API.Requests.Responses
[JsonProperty(@"preview_url")]
private string preview { get; set; }
[JsonProperty(@"has_favourited")]
private bool hasFavourited { get; set; }
[JsonProperty(@"play_count")]
private int playCount { get; set; }
@ -91,6 +94,7 @@ namespace osu.Game.Online.API.Requests.Responses
Ranked = ranked,
LastUpdated = lastUpdated,
Availability = availability,
HasFavourited = hasFavourited,
},
Beatmaps = beatmaps?.Select(b => b.ToBeatmap(rulesets)).ToList(),
};

View File

@ -246,6 +246,8 @@ namespace osu.Game.Overlays.BeatmapSet
onlineStatusPill.Status = setInfo.NewValue.OnlineInfo.Status;
downloadButtonsContainer.FadeIn(transition_duration);
favouriteButton.Favourited.Value = setInfo.NewValue.OnlineInfo.HasFavourited;
favouriteButton.FadeIn(transition_duration);
updateDownloadButtons();