mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Use the local user's username when saving a new beatmap
This commit is contained in:
parent
e337e6b3b0
commit
d849f7f2b5
@ -97,20 +97,24 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public WorkingBeatmap CreateNew(RulesetInfo ruleset)
|
public WorkingBeatmap CreateNew(RulesetInfo ruleset)
|
||||||
{
|
{
|
||||||
|
var metadata = new BeatmapMetadata
|
||||||
|
{
|
||||||
|
Artist = "artist",
|
||||||
|
Title = "title",
|
||||||
|
Author = User.SYSTEM_USER,
|
||||||
|
};
|
||||||
|
|
||||||
var set = new BeatmapSetInfo
|
var set = new BeatmapSetInfo
|
||||||
{
|
{
|
||||||
Metadata = new BeatmapMetadata
|
Metadata = metadata,
|
||||||
{
|
|
||||||
Artist = "unknown",
|
|
||||||
Title = "unknown",
|
|
||||||
Author = User.SYSTEM_USER,
|
|
||||||
},
|
|
||||||
Beatmaps = new List<BeatmapInfo>
|
Beatmaps = new List<BeatmapInfo>
|
||||||
{
|
{
|
||||||
new BeatmapInfo
|
new BeatmapInfo
|
||||||
{
|
{
|
||||||
BaseDifficulty = new BeatmapDifficulty(),
|
BaseDifficulty = new BeatmapDifficulty(),
|
||||||
Ruleset = ruleset
|
Ruleset = ruleset,
|
||||||
|
Metadata = metadata,
|
||||||
|
Version = "difficulty"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -28,6 +28,7 @@ using osu.Framework.Logging;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Screens.Edit.Compose;
|
using osu.Game.Screens.Edit.Compose;
|
||||||
using osu.Game.Screens.Edit.Setup;
|
using osu.Game.Screens.Edit.Setup;
|
||||||
@ -72,6 +73,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
|
||||||
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, GameHost host)
|
private void load(OsuColour colours, GameHost host)
|
||||||
{
|
{
|
||||||
@ -95,6 +99,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
{
|
{
|
||||||
isNewBeatmap = true;
|
isNewBeatmap = true;
|
||||||
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value);
|
Beatmap.Value = beatmapManager.CreateNew(Ruleset.Value);
|
||||||
|
Beatmap.Value.BeatmapSetInfo.Metadata.Author = api.LocalUser.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -408,7 +413,14 @@ namespace osu.Game.Screens.Edit
|
|||||||
clock.SeekForward(!clock.IsRunning, amount);
|
clock.SeekForward(!clock.IsRunning, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveBeatmap() => beatmapManager.Save(playableBeatmap.BeatmapInfo, editorBeatmap);
|
private void saveBeatmap()
|
||||||
|
{
|
||||||
|
// apply any set-level metadata changes.
|
||||||
|
beatmapManager.Update(playableBeatmap.BeatmapInfo.BeatmapSet);
|
||||||
|
|
||||||
|
// save the loaded beatmap's data stream.
|
||||||
|
beatmapManager.Save(playableBeatmap.BeatmapInfo, editorBeatmap);
|
||||||
|
}
|
||||||
|
|
||||||
private void exportBeatmap()
|
private void exportBeatmap()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user