Apply fixes

This commit is contained in:
StanR 2019-07-11 17:47:09 +03:00
parent cd7c03c13a
commit 1e04fcc6b5
4 changed files with 57 additions and 49 deletions

View File

@ -1,20 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Beatmaps
{
public enum BeatmapSetOnlineGenre
{
Any = 0,
Unspecified = 1,
VideoGame = 2,
Anime = 3,
Rock = 4,
Pop = 5,
Other = 6,
Novelty = 7,
// genre_id 8 doesnt exist
HipHop = 9,
Electronic = 10
}
}

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.ComponentModel;
using Newtonsoft.Json;
namespace osu.Game.Beatmaps
@ -72,16 +73,67 @@ namespace osu.Game.Beatmaps
public BeatmapSetOnlineAvailability Availability { get; set; }
/// <summary>
/// Beatmap set's song genre.
/// The song genre of this beatmap set.
/// </summary>
public BeatmapSetOnlineGenre Genre { get; set; }
/// <summary>
/// Beatmap set's song language.
/// The song language of this beatmap set.
/// </summary>
public BeatmapSetOnlineLanguage Language { get; set; }
}
public enum BeatmapSetOnlineGenre
{
[Description("Any")]
Any = 0,
[Description("Unspecified")]
Unspecified = 1,
[Description("Video Game")]
VideoGame = 2,
[Description("Anime")]
Anime = 3,
[Description("Rock")]
Rock = 4,
[Description("Pop")]
Pop = 5,
[Description("Other")]
Other = 6,
[Description("Novelty")]
Novelty = 7,
// genre_id 8 doesn't exist
[Description("Hip-Hop")]
HipHop = 9,
[Description("Electronic")]
Electronic = 10
}
public enum BeatmapSetOnlineLanguage
{
Any,
Other,
English,
Japanese,
Chinese,
Instrumental,
Korean,
French,
German,
Swedish,
Spanish,
Italian
}
public class BeatmapSetOnlineCovers
{
public string CoverLowRes { get; set; }

View File

@ -1,21 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
namespace osu.Game.Beatmaps
{
public enum BeatmapSetOnlineLanguage
{
Any = 0,
Other = 1,
English = 2,
Japanese = 3,
Chinese = 4,
Instrumental = 5,
Korean = 6,
French = 7,
German = 8,
Swedish = 9,
Spanish = 10,
Italian = 11
}
}

View File

@ -3,6 +3,7 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
@ -132,12 +133,8 @@ namespace osu.Game.Overlays.BeatmapSet
{
source.Text = b.NewValue?.Metadata.Source ?? string.Empty;
tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty;
var genreId = b.NewValue?.OnlineInfo.Genre ?? BeatmapSetOnlineGenre.Unspecified;
genre.Text = genreId.ToString();
var languageId = b.NewValue?.OnlineInfo.Language ?? BeatmapSetOnlineLanguage.Other;
language.Text = languageId.ToString();
genre.Text = (b.NewValue?.OnlineInfo.Genre ?? BeatmapSetOnlineGenre.Unspecified).GetDescription();
language.Text = (b.NewValue?.OnlineInfo.Language ?? BeatmapSetOnlineLanguage.Other).ToString();
};
}