1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 03:02:56 +08:00

Added osu.ppy.sh/ss (screenshot) URL handling and calculate ID at assignment so it's not on click anymore

This commit is contained in:
FreezyLemon 2017-12-03 23:55:34 +01:00
parent a839d0e91d
commit bf97f8b1b1

View File

@ -107,10 +107,13 @@ namespace osu.Game.Graphics.Sprites
}
url = url.Substring(osuUrlIndex + 11);
var id = getIdFromUrl(url);
if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/"))
content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url));
content.Action = () => beatmapSetOverlay.ShowBeatmapSet(id);
else if (url.StartsWith("b/") || url.StartsWith("beatmaps/"))
content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url));
content.Action = () => beatmapSetOverlay.ShowBeatmap(id);
else if (url.StartsWith("ss/"))
content.Action = () => Process.Start($"https://osu.ppy.sh/{url}");
}
else
content.Action = () => Process.Start(url);