Append copy suffix on creating copy of difficulty

This commit is contained in:
Bartłomiej Dach 2022-02-14 20:19:12 +01:00
parent 1685e214d3
commit 6221447164
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
3 changed files with 11 additions and 4 deletions

View File

@ -134,8 +134,8 @@ namespace osu.Game.Beatmaps
newBeatmap.BeatmapInfo = newBeatmapInfo = referenceBeatmap.BeatmapInfo.Clone();
// assign a new ID to the clone.
newBeatmapInfo.ID = Guid.NewGuid();
// clear difficulty name to avoid clashes on save.
newBeatmapInfo.DifficultyName = string.Empty;
// add "(copy)" suffix to difficulty name to avoid clashes on save.
newBeatmapInfo.DifficultyName += " (copy)";
// clear the hash, as that's what is used to match .osu files with their corresponding realm beatmaps.
newBeatmapInfo.Hash = string.Empty;
// clear online properties.

View File

@ -857,7 +857,7 @@ namespace osu.Game.Screens.Edit
(
editorBeatmap.BeatmapInfo.BeatmapSet.AsNonNull(),
rulesetInfo,
playableBeatmap,
editorBeatmap,
editorBeatmap.BeatmapSkin,
clearAllObjects,
GetState()

View File

@ -84,7 +84,14 @@ namespace osu.Game.Screens.Edit
{
try
{
return beatmapManager.CreateNewDifficulty(creationParameters);
var refetchedBeatmap = beatmapManager.GetWorkingBeatmap(creationParameters.ReferenceBeatmap.BeatmapInfo);
return beatmapManager.CreateNewDifficulty(new NewDifficultyCreationParameters(
refetchedBeatmap.BeatmapSetInfo,
refetchedBeatmap.BeatmapInfo.Ruleset,
refetchedBeatmap.Beatmap,
refetchedBeatmap.Skin,
creationParameters.CreateBlank,
creationParameters.EditorState));
}
catch (Exception ex)
{