Put 'Export package' and 'Export legacy package' in one nested menu

This commit is contained in:
OliBomby 2023-07-18 12:37:37 +02:00
parent bcdf531039
commit 395dd23966
2 changed files with 19 additions and 4 deletions

View File

@ -40,9 +40,14 @@ namespace osu.Game.Localisation
public static LocalisableString ExportPackage => new TranslatableString(getKey(@"export_package"), @"Export package");
/// <summary>
/// "Export legacy package"
/// "Legacy format (.osz)"
/// </summary>
public static LocalisableString ExportLegacyPackage => new TranslatableString(getKey(@"export_legacy_package"), @"Export legacy package");
public static LocalisableString ExportLegacyFormat => new TranslatableString(getKey(@"export_legacy_format"), @"Legacy format (.osz)");
/// <summary>
/// "New format (.olz)"
/// </summary>
public static LocalisableString ExportNewFormat => new TranslatableString(getKey(@"export_new_format"), @"New format (.olz)");
/// <summary>
/// "Create new difficulty"

View File

@ -998,8 +998,7 @@ namespace osu.Game.Screens.Edit
private List<MenuItem> createFileMenuItems() => new List<MenuItem>
{
new EditorMenuItem(WebCommonStrings.ButtonsSave, MenuItemType.Standard, () => Save()),
new EditorMenuItem(EditorStrings.ExportPackage, MenuItemType.Standard, exportBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
new EditorMenuItem(EditorStrings.ExportLegacyPackage, MenuItemType.Standard, exportLegacyBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
createExportPackageMenu(),
new EditorMenuItemSpacer(),
createDifficultyCreationMenu(),
createDifficultySwitchMenu(),
@ -1009,6 +1008,17 @@ namespace osu.Game.Screens.Edit
new EditorMenuItem(CommonStrings.Exit, MenuItemType.Standard, this.Exit)
};
private EditorMenuItem createExportPackageMenu()
{
var exportItems = new List<MenuItem>
{
new EditorMenuItem(EditorStrings.ExportNewFormat, MenuItemType.Standard, exportBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
new EditorMenuItem(EditorStrings.ExportLegacyFormat, MenuItemType.Standard, exportLegacyBeatmap) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
};
return new EditorMenuItem(EditorStrings.ExportPackage) { Items = exportItems };
}
private void exportBeatmap()
{
Save();