mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08:00
Take user argument in CreateNew method parameters
This commit is contained in:
parent
d3fbc7cc53
commit
fba253f131
@ -18,6 +18,7 @@ using osu.Game.IO;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using osu.Game.Tests.Resources;
|
||||
using osu.Game.Users;
|
||||
using SharpCompress.Archives;
|
||||
using SharpCompress.Archives.Zip;
|
||||
using SharpCompress.Common;
|
||||
@ -767,7 +768,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
var osu = loadOsu(host);
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo);
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, User.SYSTEM_USER);
|
||||
|
||||
manager.Save(working.BeatmapInfo, working.Beatmap);
|
||||
|
||||
@ -794,7 +795,7 @@ namespace osu.Game.Tests.Beatmaps.IO
|
||||
var osu = loadOsu(host);
|
||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo);
|
||||
var working = manager.CreateNew(new OsuRuleset().RulesetInfo, User.SYSTEM_USER);
|
||||
|
||||
((Beatmap)working.Beatmap).HitObjects.Add(new HitCircle { StartTime = 5000 });
|
||||
|
||||
|
@ -95,13 +95,13 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
protected override bool ShouldDeleteArchive(string path) => Path.GetExtension(path)?.ToLowerInvariant() == ".osz";
|
||||
|
||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset)
|
||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset, User user)
|
||||
{
|
||||
var metadata = new BeatmapMetadata
|
||||
{
|
||||
Artist = "artist",
|
||||
Title = "title",
|
||||
Author = User.SYSTEM_USER,
|
||||
Author = user,
|
||||
};
|
||||
|
||||
var set = new BeatmapSetInfo
|
||||
|
@ -98,8 +98,7 @@ namespace osu.Game.Screens.Edit
|
||||
if (Beatmap.Value is DummyWorkingBeatmap)
|
||||
{
|
||||
isNewBeatmap = true;
|
||||
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value);
|
||||
Beatmap.Value.BeatmapSetInfo.Metadata.Author = api.LocalUser.Value;
|
||||
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value, api.LocalUser.Value);
|
||||
}
|
||||
|
||||
try
|
||||
|
Loading…
Reference in New Issue
Block a user