mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
apply suggestions
This commit is contained in:
parent
0d3ccae1c2
commit
2274d70dac
@ -279,8 +279,8 @@ namespace osu.Game.Online.Chat
|
||||
JoinMultiplayerMatch,
|
||||
Spectate,
|
||||
OpenUserProfile,
|
||||
SearchBeatmapSet,
|
||||
Custom,
|
||||
OpenDirectWithSearch
|
||||
}
|
||||
|
||||
public class Link : IComparable<Link>
|
||||
|
@ -244,8 +244,8 @@ namespace osu.Game
|
||||
ShowChannel(link.Argument);
|
||||
break;
|
||||
|
||||
case LinkAction.OpenDirectWithSearch:
|
||||
ShowDirectWithSearch(link.Argument);
|
||||
case LinkAction.SearchBeatmapSet:
|
||||
SearchBeatmapSet(link.Argument);
|
||||
break;
|
||||
|
||||
case LinkAction.OpenEditorTimestamp:
|
||||
@ -317,8 +317,8 @@ namespace osu.Game
|
||||
/// <summary>
|
||||
/// Show Direct with a query.
|
||||
/// </summary>
|
||||
/// <param name="query">The query to search for.null</param>
|
||||
public void ShowDirectWithSearch(string query) => waitForReady(() => direct, _ => direct.ShowWithSearch(query));
|
||||
/// <param name="query">The query to search for.</param>
|
||||
public void SearchBeatmapSet(string query) => waitForReady(() => direct, _ => direct.ShowWithSearch(query));
|
||||
|
||||
/// <summary>
|
||||
/// Present a beatmap at song select immediately.
|
||||
|
@ -158,12 +158,18 @@ namespace osu.Game.Overlays.BeatmapSet
|
||||
switch(type)
|
||||
{
|
||||
case MetadataType.Tags:
|
||||
foreach (string tag in value.Split(" "))
|
||||
textFlow.AddLink(tag + " ", LinkAction.OpenDirectWithSearch, tag, null, format);
|
||||
string[] tags = value.Split(" ");
|
||||
for (int i = 0; i <= tags.Length - 1; i++)
|
||||
{
|
||||
textFlow.AddLink(tags[i], LinkAction.SearchBeatmapSet, tags[i], null, format);
|
||||
|
||||
if (i != tags.Length - 1)
|
||||
textFlow.AddText(" ", format);
|
||||
}
|
||||
break;
|
||||
|
||||
case MetadataType.Source:
|
||||
textFlow.AddLink(value, LinkAction.OpenDirectWithSearch, value, null, format);
|
||||
textFlow.AddLink(value, LinkAction.SearchBeatmapSet, value, null, format);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -361,11 +361,17 @@ namespace osu.Game.Screens.Select
|
||||
switch(type)
|
||||
{
|
||||
case MetadataType.Tags:
|
||||
foreach (string tag in text.Split(" "))
|
||||
loaded.AddLink(tag + " ", LinkAction.OpenDirectWithSearch, tag);
|
||||
string[] tags = text.Split(" ");
|
||||
for (int i = 0; i <= tags.Length - 1; i++)
|
||||
{
|
||||
loaded.AddLink(tags[i], LinkAction.SearchBeatmapSet, tags[i]);
|
||||
|
||||
if (i != tags.Length - 1)
|
||||
loaded.AddText(" ");
|
||||
}
|
||||
break;
|
||||
case MetadataType.Source:
|
||||
loaded.AddLink(text, LinkAction.OpenDirectWithSearch, text);
|
||||
loaded.AddLink(text, LinkAction.SearchBeatmapSet, text);
|
||||
break;
|
||||
default:
|
||||
loaded.AddText(text);
|
||||
|
Loading…
Reference in New Issue
Block a user