1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Fix beatmap skin properties not copying

This commit is contained in:
Bartłomiej Dach 2022-02-06 18:50:11 +01:00
parent 1292722a00
commit a144d6f8d6
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
3 changed files with 39 additions and 13 deletions

View File

@ -144,7 +144,7 @@ namespace osu.Game.Beatmaps
targetBeatmapSet.Beatmaps.Add(newBeatmapInfo);
newBeatmapInfo.BeatmapSet = targetBeatmapSet;
beatmapModelManager.Save(newBeatmapInfo, newBeatmap);
beatmapModelManager.Save(newBeatmapInfo, newBeatmap, creationParameters.ReferenceBeatmapSkin);
workingBeatmapCache.Invalidate(targetBeatmapSet);
return GetWorkingBeatmap(newBeatmap.BeatmapInfo);

View File

@ -9,6 +9,7 @@ using JetBrains.Annotations;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -853,13 +854,14 @@ namespace osu.Game.Screens.Edit
private void switchToNewDifficulty(RulesetInfo rulesetInfo, bool clearAllObjects)
=> loader?.ScheduleSwitchToNewDifficulty(new NewDifficultyCreationParameters
{
BeatmapSet = editorBeatmap.BeatmapInfo.BeatmapSet,
Ruleset = rulesetInfo,
ReferenceBeatmap = playableBeatmap,
ClearAllObjects = clearAllObjects,
EditorState = GetState()
});
(
editorBeatmap.BeatmapInfo.BeatmapSet.AsNonNull(),
rulesetInfo,
playableBeatmap,
editorBeatmap.BeatmapSkin,
clearAllObjects,
GetState()
));
private EditorMenuItem createDifficultySwitchMenu()
{

View File

@ -1,8 +1,11 @@
// 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.
#nullable enable
using osu.Game.Beatmaps;
using osu.Game.Rulesets;
using osu.Game.Skinning;
namespace osu.Game.Screens.Edit
{
@ -11,26 +14,47 @@ namespace osu.Game.Screens.Edit
/// <summary>
/// The <see cref="BeatmapSetInfo"/> that should contain the newly-created difficulty.
/// </summary>
public BeatmapSetInfo BeatmapSet { get; set; }
public BeatmapSetInfo BeatmapSet { get; }
/// <summary>
/// The <see cref="RulesetInfo"/> that the new difficulty should be playable for.
/// </summary>
public RulesetInfo Ruleset { get; set; }
public RulesetInfo Ruleset { get; }
/// <summary>
/// A reference <see cref="IBeatmap"/> upon which the new difficulty should be based.
/// </summary>
public IBeatmap ReferenceBeatmap { get; set; }
public IBeatmap ReferenceBeatmap { get; }
/// <summary>
/// A reference <see cref="ISkin"/> that the new difficulty should base its own skin upon.
/// </summary>
public ISkin? ReferenceBeatmapSkin { get; }
/// <summary>
/// Whether all objects should be cleared from the new difficulty.
/// </summary>
public bool ClearAllObjects { get; set; }
public bool ClearAllObjects { get; }
/// <summary>
/// The saved state of the previous <see cref="Editor"/> which should be restored upon opening the newly-created difficulty.
/// </summary>
public EditorState EditorState { get; set; }
public EditorState EditorState { get; }
public NewDifficultyCreationParameters(
BeatmapSetInfo beatmapSet,
RulesetInfo ruleset,
IBeatmap referenceBeatmap,
ISkin? referenceBeatmapSkin,
bool clearAllObjects,
EditorState editorState)
{
BeatmapSet = beatmapSet;
Ruleset = ruleset;
ReferenceBeatmap = referenceBeatmap;
ReferenceBeatmapSkin = referenceBeatmapSkin;
ClearAllObjects = clearAllObjects;
EditorState = editorState;
}
}
}