mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Start with a fresh beatmap when entering editor from main menu
This commit is contained in:
@ -27,6 +27,7 @@ using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Users;
|
||||
using Decoder = osu.Game.Beatmaps.Formats.Decoder;
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
@ -94,6 +95,30 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
|
||||
|
||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset)
|
||||
{
|
||||
var set = new BeatmapSetInfo
|
||||
{
|
||||
Metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = "unknown",
|
||||
Title = "unknown",
|
||||
Author = User.SYSTEM_USER,
|
||||
},
|
||||
Beatmaps = new List<BeatmapInfo>
|
||||
{
|
||||
new BeatmapInfo
|
||||
{
|
||||
BaseDifficulty = new BeatmapDifficulty(),
|
||||
Ruleset = ruleset
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var working = Import(set).Result;
|
||||
return GetWorkingBeatmap(working.Beatmaps.First());
|
||||
}
|
||||
|
||||
protected override async Task Populate(BeatmapSetInfo beatmapSet, ArchiveReader archive, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (archive != null)
|
||||
|
Reference in New Issue
Block a user