Skip to content

Commit c0cc6cd

Browse files
authored
Add editor hotkeys for beatmap submit and edit externally (ppy#37782)
Addresses ppy#37777. Note: please don't merge until after the imminent release. Would rather not add new features at this point.
1 parent fda10bd commit c0cc6cd

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

osu.Game/Input/Bindings/GlobalActionContainer.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ public static IEnumerable<GlobalAction> GetGlobalActionsFor(GlobalActionCategory
155155
new KeyBinding(new[] { InputKey.Alt, InputKey.Left }, GlobalAction.EditorSeekToPreviousBookmark),
156156
new KeyBinding(new[] { InputKey.Alt, InputKey.Right }, GlobalAction.EditorSeekToNextBookmark),
157157
new KeyBinding(new[] { InputKey.Control, InputKey.L }, GlobalAction.EditorDiscardUnsavedChanges),
158+
new KeyBinding(new[] { InputKey.Control, InputKey.Shift, InputKey.U }, GlobalAction.EditorSubmitBeatmap),
159+
new KeyBinding(new[] { InputKey.Control, InputKey.Shift, InputKey.O }, GlobalAction.EditorEditExternally),
158160
};
159161

160162
private static IEnumerable<KeyBinding> editorTestPlayKeyBindings => new[]
@@ -528,6 +530,12 @@ public enum GlobalAction
528530

529531
[LocalisableDescription(typeof(GlobalActionKeyBindingStrings), nameof(GlobalActionKeyBindingStrings.NextSkin))]
530532
NextSkin,
533+
534+
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.SubmitBeatmap))]
535+
EditorSubmitBeatmap,
536+
537+
[LocalisableDescription(typeof(EditorStrings), nameof(EditorStrings.EditExternally))]
538+
EditorEditExternally
531539
}
532540

533541
public enum GlobalActionCategory

osu.Game/Screens/Edit/Editor.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,14 @@ public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
833833
case GlobalAction.EditorDiscardUnsavedChanges:
834834
DiscardUnsavedChanges();
835835
return true;
836+
837+
case GlobalAction.EditorEditExternally:
838+
editExternally();
839+
return true;
840+
841+
case GlobalAction.EditorSubmitBeatmap:
842+
submitBeatmap();
843+
return true;
836844
}
837845

838846
return false;
@@ -1284,7 +1292,10 @@ private IEnumerable<MenuItem> createFileMenuItems()
12841292

12851293
if (RuntimeInfo.IsDesktop)
12861294
{
1287-
var externalEdit = new EditorMenuItem(EditorStrings.EditExternally, MenuItemType.Standard, editExternally);
1295+
var externalEdit = new EditorMenuItem(EditorStrings.EditExternally, MenuItemType.Standard, editExternally)
1296+
{
1297+
Hotkey = new Hotkey(GlobalAction.EditorEditExternally)
1298+
};
12881299
saveRelatedMenuItems.Add(externalEdit);
12891300
yield return externalEdit;
12901301
}
@@ -1295,7 +1306,10 @@ private IEnumerable<MenuItem> createFileMenuItems()
12951306

12961307
if (isSetMadeOfLegacyRulesetBeatmaps && submissionAvailable)
12971308
{
1298-
var upload = new EditorMenuItem(EditorStrings.SubmitBeatmap, MenuItemType.Standard, submitBeatmap);
1309+
var upload = new EditorMenuItem(EditorStrings.SubmitBeatmap, MenuItemType.Standard, submitBeatmap)
1310+
{
1311+
Hotkey = new Hotkey(GlobalAction.EditorSubmitBeatmap)
1312+
};
12991313
saveRelatedMenuItems.Add(upload);
13001314
yield return upload;
13011315
}
@@ -1306,7 +1320,8 @@ private IEnumerable<MenuItem> createFileMenuItems()
13061320
yield return new EditorMenuItem(EditorStrings.OpenInfoPage, MenuItemType.Standard,
13071321
() => (Game as OsuGame)?.OpenUrlExternally(editorBeatmap.BeatmapInfo.GetOnlineURL(api, editorBeatmap.BeatmapInfo.Ruleset)));
13081322
yield return new EditorMenuItem(EditorStrings.OpenDiscussionPage, MenuItemType.Standard,
1309-
() => (Game as OsuGame)?.OpenUrlExternally($@"{api.Endpoints.WebsiteUrl}/beatmapsets/{editorBeatmap.BeatmapInfo.BeatmapSet!.OnlineID}/discussion/{editorBeatmap.BeatmapInfo.OnlineID}"));
1323+
() => (Game as OsuGame)?.OpenUrlExternally(
1324+
$@"{api.Endpoints.WebsiteUrl}/beatmapsets/{editorBeatmap.BeatmapInfo.BeatmapSet!.OnlineID}/discussion/{editorBeatmap.BeatmapInfo.OnlineID}"));
13101325
}
13111326

13121327
yield return new OsuMenuItemSpacer();

0 commit comments

Comments
 (0)