mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
Merge branch 'master' into back-to-desktop
This commit is contained in:
commit
31b26e1d0a
@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
{
|
{
|
||||||
Artist = @"Unknown",
|
Artist = @"Unknown",
|
||||||
Title = @"Sample Beatmap",
|
Title = @"Sample Beatmap",
|
||||||
Author = @"peppy",
|
AuthorString = @"peppy",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ControlPointInfo = controlPointInfo
|
ControlPointInfo = controlPointInfo
|
||||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
Assert.AreEqual("Gamu", meta.Author);
|
Assert.AreEqual("Gamu", meta.AuthorString);
|
||||||
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
||||||
Assert.AreEqual(164471, meta.PreviewTime);
|
Assert.AreEqual(164471, meta.PreviewTime);
|
||||||
Assert.AreEqual(string.Empty, meta.Source);
|
Assert.AreEqual(string.Empty, meta.Source);
|
||||||
@ -143,4 +143,4 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
Assert.AreEqual("Soleily", meta.Artist);
|
Assert.AreEqual("Soleily", meta.Artist);
|
||||||
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
Assert.AreEqual("Soleily", meta.ArtistUnicode);
|
||||||
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
Assert.AreEqual("03. Renatus - Soleily 192kbps.mp3", meta.AudioFile);
|
||||||
Assert.AreEqual("Deif", meta.Author);
|
Assert.AreEqual("Deif", meta.AuthorString);
|
||||||
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
Assert.AreEqual("machinetop_background.jpg", meta.BackgroundFile);
|
||||||
Assert.AreEqual(164471, meta.PreviewTime);
|
Assert.AreEqual(164471, meta.PreviewTime);
|
||||||
Assert.AreEqual(string.Empty, meta.Source);
|
Assert.AreEqual(string.Empty, meta.Source);
|
||||||
|
@ -69,7 +69,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
Artist = @"Unknown",
|
Artist = @"Unknown",
|
||||||
Title = @"Unknown",
|
Title = @"Unknown",
|
||||||
Author = @"Unknown Creator",
|
AuthorString = @"Unknown Creator",
|
||||||
},
|
},
|
||||||
Version = @"Normal",
|
Version = @"Normal",
|
||||||
Difficulty = new BeatmapDifficulty()
|
Difficulty = new BeatmapDifficulty()
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using osu.Game.Users;
|
||||||
using SQLite.Net.Attributes;
|
using SQLite.Net.Attributes;
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
@ -19,8 +20,21 @@ namespace osu.Game.Beatmaps
|
|||||||
public string Artist { get; set; }
|
public string Artist { get; set; }
|
||||||
public string ArtistUnicode { get; set; }
|
public string ArtistUnicode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Helper property to deserialize a username to <see cref="User"/>.
|
||||||
|
/// </summary>
|
||||||
[JsonProperty(@"creator")]
|
[JsonProperty(@"creator")]
|
||||||
public string Author { get; set; }
|
[Column("Author")]
|
||||||
|
public string AuthorString
|
||||||
|
{
|
||||||
|
get { return Author?.Username; }
|
||||||
|
set { Author = new User { Username = value }; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The author of the beatmaps in this set.
|
||||||
|
/// </summary>
|
||||||
|
public User Author;
|
||||||
|
|
||||||
public string Source { get; set; }
|
public string Source { get; set; }
|
||||||
|
|
||||||
@ -32,7 +46,7 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public string[] SearchableTerms => new[]
|
public string[] SearchableTerms => new[]
|
||||||
{
|
{
|
||||||
Author,
|
Author?.Username,
|
||||||
Artist,
|
Artist,
|
||||||
ArtistUnicode,
|
ArtistUnicode,
|
||||||
Title,
|
Title,
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Users;
|
|
||||||
|
|
||||||
namespace osu.Game.Beatmaps
|
namespace osu.Game.Beatmaps
|
||||||
{
|
{
|
||||||
@ -12,11 +11,6 @@ namespace osu.Game.Beatmaps
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class BeatmapSetOnlineInfo
|
public class BeatmapSetOnlineInfo
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// The author of the beatmaps in this set.
|
|
||||||
/// </summary>
|
|
||||||
public User Author;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The date this beatmap set was submitted to the online listing.
|
/// The date this beatmap set was submitted to the online listing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
Artist = "please load a beatmap!",
|
Artist = "please load a beatmap!",
|
||||||
Title = "no beatmaps available!",
|
Title = "no beatmaps available!",
|
||||||
Author = "no one",
|
AuthorString = "no one",
|
||||||
},
|
},
|
||||||
BeatmapSet = new BeatmapSetInfo(),
|
BeatmapSet = new BeatmapSetInfo(),
|
||||||
Difficulty = new BeatmapDifficulty
|
Difficulty = new BeatmapDifficulty
|
||||||
|
@ -171,7 +171,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
metadata.ArtistUnicode = pair.Value;
|
metadata.ArtistUnicode = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Creator":
|
case @"Creator":
|
||||||
metadata.Author = pair.Value;
|
metadata.AuthorString = pair.Value;
|
||||||
break;
|
break;
|
||||||
case @"Version":
|
case @"Version":
|
||||||
beatmap.BeatmapInfo.Version = pair.Value;
|
beatmap.BeatmapInfo.Version = pair.Value;
|
||||||
|
@ -6,7 +6,6 @@ using System.Linq;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Users;
|
|
||||||
|
|
||||||
namespace osu.Game.Online.API.Requests
|
namespace osu.Game.Online.API.Requests
|
||||||
{
|
{
|
||||||
@ -27,11 +26,10 @@ namespace osu.Game.Online.API.Requests
|
|||||||
[JsonProperty(@"id")]
|
[JsonProperty(@"id")]
|
||||||
private int onlineId { get; set; }
|
private int onlineId { get; set; }
|
||||||
|
|
||||||
[JsonProperty(@"creator")]
|
|
||||||
private string creatorUsername { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty(@"user_id")]
|
[JsonProperty(@"user_id")]
|
||||||
private long creatorId = 1;
|
private long creatorId {
|
||||||
|
set { Author.Id = value; }
|
||||||
|
}
|
||||||
|
|
||||||
[JsonProperty(@"beatmaps")]
|
[JsonProperty(@"beatmaps")]
|
||||||
private IEnumerable<GetBeatmapSetsBeatmapResponse> beatmaps { get; set; }
|
private IEnumerable<GetBeatmapSetsBeatmapResponse> beatmaps { get; set; }
|
||||||
@ -44,11 +42,6 @@ namespace osu.Game.Online.API.Requests
|
|||||||
Metadata = this,
|
Metadata = this,
|
||||||
OnlineInfo = new BeatmapSetOnlineInfo
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
{
|
{
|
||||||
Author = new User
|
|
||||||
{
|
|
||||||
Id = creatorId,
|
|
||||||
Username = creatorUsername,
|
|
||||||
},
|
|
||||||
Covers = covers,
|
Covers = covers,
|
||||||
Preview = preview,
|
Preview = preview,
|
||||||
PlayCount = playCount,
|
PlayCount = playCount,
|
||||||
|
@ -36,12 +36,12 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
|
|
||||||
var i = BeatmapSet.OnlineInfo;
|
var i = BeatmapSet.OnlineInfo;
|
||||||
|
|
||||||
avatar.User = i.Author;
|
avatar.User = BeatmapSet.Metadata.Author;
|
||||||
clickableArea.Action = () => profile?.ShowUser(avatar.User);
|
clickableArea.Action = () => profile?.ShowUser(avatar.User);
|
||||||
|
|
||||||
fields.Children = new Drawable[]
|
fields.Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Field("made by", i.Author.Username, @"Exo2.0-RegularItalic"),
|
new Field("made by", BeatmapSet.Metadata.Author.Username, @"Exo2.0-RegularItalic"),
|
||||||
new Field("submitted on", i.Submitted.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold")
|
new Field("submitted on", i.Submitted.ToString(@"MMM d, yyyy"), @"Exo2.0-Bold")
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Top = 5 },
|
Margin = new MarginPadding { Top = 5 },
|
||||||
|
@ -130,7 +130,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = SetInfo.Metadata.Author,
|
Text = SetInfo.Metadata.Author.Username,
|
||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
Font = @"Exo2.0-SemiBoldItalic",
|
Font = @"Exo2.0-SemiBoldItalic",
|
||||||
Shadow = false,
|
Shadow = false,
|
||||||
|
@ -128,7 +128,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = SetInfo.Metadata.Author,
|
Text = SetInfo.Metadata.Author.Username,
|
||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
Font = @"Exo2.0-SemiBoldItalic",
|
Font = @"Exo2.0-SemiBoldItalic",
|
||||||
},
|
},
|
||||||
|
@ -248,7 +248,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
},
|
},
|
||||||
new MetadataLine("Mapper", metadata.Author)
|
new MetadataLine("Mapper", metadata.Author.Username)
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
|
@ -210,7 +210,7 @@ namespace osu.Game.Screens.Select
|
|||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = @"Exo2.0-Bold",
|
Font = @"Exo2.0-Bold",
|
||||||
Text = metadata.Author,
|
Text = metadata.Author.Username,
|
||||||
TextSize = 15,
|
TextSize = 15,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Select
|
|||||||
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title, StringComparison.InvariantCultureIgnoreCase));
|
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title, StringComparison.InvariantCultureIgnoreCase));
|
||||||
break;
|
break;
|
||||||
case SortMode.Author:
|
case SortMode.Author:
|
||||||
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author, StringComparison.InvariantCultureIgnoreCase));
|
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author.Username, y.BeatmapSet.Metadata.Author.Username, StringComparison.InvariantCultureIgnoreCase));
|
||||||
break;
|
break;
|
||||||
case SortMode.Difficulty:
|
case SortMode.Difficulty:
|
||||||
groups.Sort((x, y) => x.BeatmapSet.MaxStarDifficulty.CompareTo(y.BeatmapSet.MaxStarDifficulty));
|
groups.Sort((x, y) => x.BeatmapSet.MaxStarDifficulty.CompareTo(y.BeatmapSet.MaxStarDifficulty));
|
||||||
@ -59,4 +59,4 @@ namespace osu.Game.Screens.Select
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
Artist = @"Kaneko Chiharu",
|
Artist = @"Kaneko Chiharu",
|
||||||
Source = @"SOUND VOLTEX III GRAVITY WARS",
|
Source = @"SOUND VOLTEX III GRAVITY WARS",
|
||||||
Tags = @"sdvx grace the 5th kac original song contest konami bemani",
|
Tags = @"sdvx grace the 5th kac original song contest konami bemani",
|
||||||
|
Author = new User
|
||||||
|
{
|
||||||
|
Username = @"Fresh Chicken",
|
||||||
|
Id = 3984370,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
OnlineInfo = new BeatmapSetOnlineInfo
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
{
|
{
|
||||||
@ -48,11 +53,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
Submitted = new DateTime(2016, 2, 10),
|
Submitted = new DateTime(2016, 2, 10),
|
||||||
Ranked = new DateTime(2016, 6, 19),
|
Ranked = new DateTime(2016, 6, 19),
|
||||||
BPM = 236,
|
BPM = 236,
|
||||||
Author = new User
|
|
||||||
{
|
|
||||||
Username = @"Fresh Chicken",
|
|
||||||
Id = 3984370,
|
|
||||||
},
|
|
||||||
Covers = new BeatmapSetOnlineCovers
|
Covers = new BeatmapSetOnlineCovers
|
||||||
{
|
{
|
||||||
Cover = @"https://assets.ppy.sh/beatmaps/415886/covers/cover.jpg?1465651778",
|
Cover = @"https://assets.ppy.sh/beatmaps/415886/covers/cover.jpg?1465651778",
|
||||||
@ -213,6 +213,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
Title = @"Soumatou Labyrinth",
|
Title = @"Soumatou Labyrinth",
|
||||||
Artist = @"Yunomi with Momobako&miko",
|
Artist = @"Yunomi with Momobako&miko",
|
||||||
Tags = @"mmbk.com yuzu__rinrin charlotte",
|
Tags = @"mmbk.com yuzu__rinrin charlotte",
|
||||||
|
Author = new User
|
||||||
|
{
|
||||||
|
Username = @"komasy",
|
||||||
|
Id = 1980256,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
OnlineInfo = new BeatmapSetOnlineInfo
|
OnlineInfo = new BeatmapSetOnlineInfo
|
||||||
{
|
{
|
||||||
@ -222,11 +227,6 @@ namespace osu.Game.Tests.Visual
|
|||||||
Submitted = new DateTime(2016, 6, 11),
|
Submitted = new DateTime(2016, 6, 11),
|
||||||
Ranked = new DateTime(2016, 7, 12),
|
Ranked = new DateTime(2016, 7, 12),
|
||||||
BPM = 160,
|
BPM = 160,
|
||||||
Author = new User
|
|
||||||
{
|
|
||||||
Username = @"komasy",
|
|
||||||
Id = 1980256,
|
|
||||||
},
|
|
||||||
Covers = new BeatmapSetOnlineCovers
|
Covers = new BeatmapSetOnlineCovers
|
||||||
{
|
{
|
||||||
Cover = @"https://assets.ppy.sh/beatmaps/625493/covers/cover.jpg?1499167472",
|
Cover = @"https://assets.ppy.sh/beatmaps/625493/covers/cover.jpg?1499167472",
|
||||||
|
@ -46,7 +46,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"OrVid",
|
Title = @"OrVid",
|
||||||
Artist = @"An",
|
Artist = @"An",
|
||||||
Author = @"RLC",
|
AuthorString = @"RLC",
|
||||||
Source = @"",
|
Source = @"",
|
||||||
Tags = @"acuticnotes an-fillnote revid tear tearvid encrpted encryption axi axivid quad her hervid recoll",
|
Tags = @"acuticnotes an-fillnote revid tear tearvid encrpted encryption axi axivid quad her hervid recoll",
|
||||||
},
|
},
|
||||||
@ -78,7 +78,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"tiny lamp",
|
Title = @"tiny lamp",
|
||||||
Artist = @"fhana",
|
Artist = @"fhana",
|
||||||
Author = @"Sotarks",
|
AuthorString = @"Sotarks",
|
||||||
Source = @"ぎんぎつね",
|
Source = @"ぎんぎつね",
|
||||||
Tags = @"lantis junichi sato yuxuki waga kevin mitsunaga towana gingitsune opening op full ver version kalibe collab collaboration",
|
Tags = @"lantis junichi sato yuxuki waga kevin mitsunaga towana gingitsune opening op full ver version kalibe collab collaboration",
|
||||||
},
|
},
|
||||||
@ -110,7 +110,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"At Gwanghwamun",
|
Title = @"At Gwanghwamun",
|
||||||
Artist = @"KYUHYUN",
|
Artist = @"KYUHYUN",
|
||||||
Author = @"Cerulean Veyron",
|
AuthorString = @"Cerulean Veyron",
|
||||||
Source = @"",
|
Source = @"",
|
||||||
Tags = @"soul ballad kh super junior sj suju 슈퍼주니어 kt뮤직 sm엔터테인먼트 s.m.entertainment kt music 1st mini album ep",
|
Tags = @"soul ballad kh super junior sj suju 슈퍼주니어 kt뮤직 sm엔터테인먼트 s.m.entertainment kt music 1st mini album ep",
|
||||||
},
|
},
|
||||||
@ -157,7 +157,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"RHAPSODY OF BLUE SKY",
|
Title = @"RHAPSODY OF BLUE SKY",
|
||||||
Artist = @"fhana",
|
Artist = @"fhana",
|
||||||
Author = @"[Kamiya]",
|
AuthorString = @"[Kamiya]",
|
||||||
Source = @"小林さんちのメイドラゴン",
|
Source = @"小林さんちのメイドラゴン",
|
||||||
Tags = @"kobayashi san chi no maidragon aozora no opening anime maid dragon oblivion karen dynamix imoutosan pata-mon gxytcgxytc",
|
Tags = @"kobayashi san chi no maidragon aozora no opening anime maid dragon oblivion karen dynamix imoutosan pata-mon gxytcgxytc",
|
||||||
},
|
},
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
// Create random metadata, then we can check if sorting works based on these
|
// Create random metadata, then we can check if sorting works based on these
|
||||||
Artist = "MONACA " + RNG.Next(0, 9),
|
Artist = "MONACA " + RNG.Next(0, 9),
|
||||||
Title = "Black Song " + RNG.Next(0, 9),
|
Title = "Black Song " + RNG.Next(0, 9),
|
||||||
Author = "Some Guy " + RNG.Next(0, 9),
|
AuthorString = "Some Guy " + RNG.Next(0, 9),
|
||||||
},
|
},
|
||||||
Beatmaps = new List<BeatmapInfo>(new[]
|
Beatmaps = new List<BeatmapInfo>(new[]
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"Platina",
|
Title = @"Platina",
|
||||||
Artist = @"Maaya Sakamoto",
|
Artist = @"Maaya Sakamoto",
|
||||||
Author = @"uwutm8",
|
AuthorString = @"uwutm8",
|
||||||
},
|
},
|
||||||
BeatmapSet = new BeatmapSetInfo
|
BeatmapSet = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
@ -104,7 +104,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
{
|
{
|
||||||
Title = @"FREEDOM DIVE",
|
Title = @"FREEDOM DIVE",
|
||||||
Artist = @"xi",
|
Artist = @"xi",
|
||||||
Author = @"Nakagawa-Kanon",
|
AuthorString = @"Nakagawa-Kanon",
|
||||||
},
|
},
|
||||||
BeatmapSet = new BeatmapSetInfo
|
BeatmapSet = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user