1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Fix searching by clicking title/artist in beatmap overlay not following original language setting

This commit is contained in:
Joseph Madamba 2024-09-17 22:25:18 -07:00
parent ea94f903c1
commit fd6b3b6b36
3 changed files with 15 additions and 6 deletions

View File

@ -340,6 +340,8 @@ namespace osu.Game.Online.Chat
Spectate,
OpenUserProfile,
SearchBeatmapSet,
SearchBeatmapTitle,
SearchBeatmapArtist,
OpenWiki,
Custom,
OpenChangelog,

View File

@ -445,12 +445,19 @@ namespace osu.Game
break;
case LinkAction.SearchBeatmapSet:
if (link.Argument is RomanisableString romanisable)
SearchBeatmapSet(romanisable.GetPreferred(Localisation.CurrentParameters.Value.PreferOriginalScript));
else
SearchBeatmapSet(argString);
break;
case LinkAction.SearchBeatmapTitle:
string title = ((RomanisableString)link.Argument).GetPreferred(Localisation.CurrentParameters.Value.PreferOriginalScript);
SearchBeatmapSet($@"title=""""{title}""""");
break;
case LinkAction.SearchBeatmapArtist:
string artist = ((RomanisableString)link.Argument).GetPreferred(Localisation.CurrentParameters.Value.PreferOriginalScript);
SearchBeatmapSet($@"artist=""""{artist}""""");
break;
case LinkAction.FilterBeatmapSetGenre:
FilterBeatmapSetGenre((SearchGenre)link.Argument);
break;

View File

@ -242,7 +242,7 @@ namespace osu.Game.Overlays.BeatmapSet
title.Clear();
artist.Clear();
title.AddLink(titleText, LinkAction.SearchBeatmapSet, $@"title=""""{titleText}""""");
title.AddLink(titleText, LinkAction.SearchBeatmapTitle, titleText);
title.AddArbitraryDrawable(Empty().With(d => d.Width = 5));
title.AddArbitraryDrawable(externalLink = new ExternalLinkButton());
@ -259,7 +259,7 @@ namespace osu.Game.Overlays.BeatmapSet
title.AddArbitraryDrawable(new SpotlightBeatmapBadge());
}
artist.AddLink(artistText, LinkAction.SearchBeatmapSet, $@"artist=""""{artistText}""""");
artist.AddLink(artistText, LinkAction.SearchBeatmapArtist, artistText);
if (setInfo.NewValue.TrackId != null)
{