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