mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 08:52:55 +08:00
Add menu items to open beatmap info & discussion pages in browser from editor
This commit is contained in:
parent
3294450dc9
commit
38e2f793ca
@ -184,6 +184,16 @@ namespace osu.Game.Localisation
|
||||
/// </summary>
|
||||
public static LocalisableString ResetBookmarks => new TranslatableString(getKey(@"reset_bookmarks"), @"Reset bookmarks");
|
||||
|
||||
/// <summary>
|
||||
/// "Open beatmap info page in browser"
|
||||
/// </summary>
|
||||
public static LocalisableString OpenInfoPageInBrowser => new TranslatableString(getKey(@"open_info_page_in_browser"), @"Open beatmap info page in browser");
|
||||
|
||||
/// <summary>
|
||||
/// "Open beatmap discussion page in browser"
|
||||
/// </summary>
|
||||
public static LocalisableString OpenDiscussionPageInBrowser => new TranslatableString(getKey(@"open_discussion_page_in_browser"), @"Open beatmap discussion page in browser");
|
||||
|
||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1256,6 +1256,15 @@ namespace osu.Game.Screens.Edit
|
||||
yield return externalEdit;
|
||||
}
|
||||
|
||||
if (editorBeatmap.BeatmapInfo.OnlineID > 0)
|
||||
{
|
||||
yield return new OsuMenuItemSpacer();
|
||||
yield return new EditorMenuItem(EditorStrings.OpenInfoPageInBrowser, MenuItemType.Standard,
|
||||
() => (Game as OsuGame)?.OpenUrlExternally(editorBeatmap.BeatmapInfo.GetOnlineURL(api, editorBeatmap.BeatmapInfo.Ruleset)));
|
||||
yield return new EditorMenuItem(EditorStrings.OpenDiscussionPageInBrowser, MenuItemType.Standard,
|
||||
() => (Game as OsuGame)?.OpenUrlExternally($@"{api.Endpoints.WebsiteUrl}/beatmapsets/{editorBeatmap.BeatmapInfo.BeatmapSet!.OnlineID}/discussion/{editorBeatmap.BeatmapInfo.OnlineID}"));
|
||||
}
|
||||
|
||||
yield return new OsuMenuItemSpacer();
|
||||
yield return new EditorMenuItem(CommonStrings.Exit, MenuItemType.Standard, this.Exit);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user