mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 12:17:26 +08:00
Merge branch 'master' into andy840119/_fix_duel_stage_beatmap
This commit is contained in:
commit
0e30bf902d
@ -8,6 +8,7 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using osu.Framework;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.IO.File;
|
||||
using osu.Framework.Logging;
|
||||
@ -53,6 +54,8 @@ namespace osu.Game.Database
|
||||
|
||||
public virtual string[] HandledExtensions => new[] { ".zip" };
|
||||
|
||||
public virtual bool SupportsImportFromStable => RuntimeInfo.IsDesktop;
|
||||
|
||||
protected readonly FileStore Files;
|
||||
|
||||
protected readonly IDatabaseContextFactory ContextFactory;
|
||||
|
@ -1,8 +1,8 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Configuration;
|
||||
|
||||
@ -15,19 +15,20 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(Storage storage, OsuConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
Add(new SettingsEnumDropdown<ReleaseStream>
|
||||
{
|
||||
new SettingsEnumDropdown<ReleaseStream>
|
||||
{
|
||||
LabelText = "Release stream",
|
||||
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
||||
},
|
||||
new SettingsButton
|
||||
LabelText = "Release stream",
|
||||
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
|
||||
});
|
||||
|
||||
if (RuntimeInfo.IsDesktop)
|
||||
{
|
||||
Add(new SettingsButton
|
||||
{
|
||||
Text = "Open osu! folder",
|
||||
Action = storage.OpenInNativeExplorer,
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,9 +25,9 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(BeatmapManager beatmaps, SkinManager skins, DialogOverlay dialogOverlay)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
if (beatmaps.SupportsImportFromStable)
|
||||
{
|
||||
importBeatmapsButton = new SettingsButton
|
||||
Add(importBeatmapsButton = new SettingsButton
|
||||
{
|
||||
Text = "Import beatmaps from stable",
|
||||
Action = () =>
|
||||
@ -35,20 +35,25 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
importBeatmapsButton.Enabled.Value = false;
|
||||
beatmaps.ImportFromStableAsync().ContinueWith(t => Schedule(() => importBeatmapsButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
deleteBeatmapsButton = new DangerousSettingsButton
|
||||
});
|
||||
}
|
||||
|
||||
Add(deleteBeatmapsButton = new DangerousSettingsButton
|
||||
{
|
||||
Text = "Delete ALL beatmaps",
|
||||
Action = () =>
|
||||
{
|
||||
Text = "Delete ALL beatmaps",
|
||||
Action = () =>
|
||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||
{
|
||||
dialogOverlay?.Push(new DeleteAllBeatmapsDialog(() =>
|
||||
{
|
||||
deleteBeatmapsButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.Delete(beatmaps.GetAllUsableBeatmapSets())).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||
}));
|
||||
}
|
||||
},
|
||||
importSkinsButton = new SettingsButton
|
||||
deleteBeatmapsButton.Enabled.Value = false;
|
||||
Task.Run(() => beatmaps.Delete(beatmaps.GetAllUsableBeatmapSets())).ContinueWith(t => Schedule(() => deleteBeatmapsButton.Enabled.Value = true));
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
if (skins.SupportsImportFromStable)
|
||||
{
|
||||
Add(importSkinsButton = new SettingsButton
|
||||
{
|
||||
Text = "Import skins from stable",
|
||||
Action = () =>
|
||||
@ -56,7 +61,11 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
importSkinsButton.Enabled.Value = false;
|
||||
skins.ImportFromStableAsync().ContinueWith(t => Schedule(() => importSkinsButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
deleteSkinsButton = new DangerousSettingsButton
|
||||
{
|
||||
Text = "Delete ALL skins",
|
||||
@ -91,7 +100,7 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
|
||||
Task.Run(() => beatmaps.Undelete(beatmaps.QueryBeatmapSets(b => b.DeletePending).ToList())).ContinueWith(t => Schedule(() => undeleteButton.Enabled.Value = true));
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ using osu.Game.Screens.Edit.Components.Menus;
|
||||
using osu.Game.Screens.Edit.Compose;
|
||||
using osu.Game.Screens.Edit.Design;
|
||||
using osuTK.Input;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
@ -67,6 +69,15 @@ namespace osu.Game.Screens.Edit
|
||||
SummaryTimeline timeline;
|
||||
PlaybackControl playback;
|
||||
|
||||
var fileMenuItems = new List<MenuItem>();
|
||||
if (RuntimeInfo.IsDesktop)
|
||||
{
|
||||
fileMenuItems.Add(new EditorMenuItem("Export", MenuItemType.Standard, exportBeatmap));
|
||||
fileMenuItems.Add(new EditorMenuItemSpacer());
|
||||
}
|
||||
|
||||
fileMenuItems.Add(new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit));
|
||||
|
||||
InternalChildren = new[]
|
||||
{
|
||||
new Container
|
||||
@ -94,12 +105,7 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
new MenuItem("File")
|
||||
{
|
||||
Items = new[]
|
||||
{
|
||||
new EditorMenuItem("Export", MenuItemType.Standard, exportBeatmap),
|
||||
new EditorMenuItemSpacer(),
|
||||
new EditorMenuItem("Exit", MenuItemType.Standard, this.Exit)
|
||||
}
|
||||
Items = fileMenuItems
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.227.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.228.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
@ -105,8 +105,8 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.128.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.227.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.227.0" />
|
||||
<PackageReference Include="ppy.osu.Framework" Version="2019.228.0" />
|
||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.228.0" />
|
||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||
|
Loading…
Reference in New Issue
Block a user