mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 15:43:21 +08:00
Fix beatmap skin properties not copying
This commit is contained in:
parent
1292722a00
commit
a144d6f8d6
@ -144,7 +144,7 @@ namespace osu.Game.Beatmaps
|
|||||||
targetBeatmapSet.Beatmaps.Add(newBeatmapInfo);
|
targetBeatmapSet.Beatmaps.Add(newBeatmapInfo);
|
||||||
newBeatmapInfo.BeatmapSet = targetBeatmapSet;
|
newBeatmapInfo.BeatmapSet = targetBeatmapSet;
|
||||||
|
|
||||||
beatmapModelManager.Save(newBeatmapInfo, newBeatmap);
|
beatmapModelManager.Save(newBeatmapInfo, newBeatmap, creationParameters.ReferenceBeatmapSkin);
|
||||||
|
|
||||||
workingBeatmapCache.Invalidate(targetBeatmapSet);
|
workingBeatmapCache.Invalidate(targetBeatmapSet);
|
||||||
return GetWorkingBeatmap(newBeatmap.BeatmapInfo);
|
return GetWorkingBeatmap(newBeatmap.BeatmapInfo);
|
||||||
|
@ -9,6 +9,7 @@ using JetBrains.Annotations;
|
|||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -853,13 +854,14 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
private void switchToNewDifficulty(RulesetInfo rulesetInfo, bool clearAllObjects)
|
private void switchToNewDifficulty(RulesetInfo rulesetInfo, bool clearAllObjects)
|
||||||
=> loader?.ScheduleSwitchToNewDifficulty(new NewDifficultyCreationParameters
|
=> loader?.ScheduleSwitchToNewDifficulty(new NewDifficultyCreationParameters
|
||||||
{
|
(
|
||||||
BeatmapSet = editorBeatmap.BeatmapInfo.BeatmapSet,
|
editorBeatmap.BeatmapInfo.BeatmapSet.AsNonNull(),
|
||||||
Ruleset = rulesetInfo,
|
rulesetInfo,
|
||||||
ReferenceBeatmap = playableBeatmap,
|
playableBeatmap,
|
||||||
ClearAllObjects = clearAllObjects,
|
editorBeatmap.BeatmapSkin,
|
||||||
EditorState = GetState()
|
clearAllObjects,
|
||||||
});
|
GetState()
|
||||||
|
));
|
||||||
|
|
||||||
private EditorMenuItem createDifficultySwitchMenu()
|
private EditorMenuItem createDifficultySwitchMenu()
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit
|
namespace osu.Game.Screens.Edit
|
||||||
{
|
{
|
||||||
@ -11,26 +14,47 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="BeatmapSetInfo"/> that should contain the newly-created difficulty.
|
/// The <see cref="BeatmapSetInfo"/> that should contain the newly-created difficulty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public BeatmapSetInfo BeatmapSet { get; set; }
|
public BeatmapSetInfo BeatmapSet { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The <see cref="RulesetInfo"/> that the new difficulty should be playable for.
|
/// The <see cref="RulesetInfo"/> that the new difficulty should be playable for.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public RulesetInfo Ruleset { get; set; }
|
public RulesetInfo Ruleset { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A reference <see cref="IBeatmap"/> upon which the new difficulty should be based.
|
/// A reference <see cref="IBeatmap"/> upon which the new difficulty should be based.
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Whether all objects should be cleared from the new difficulty.
|
/// Whether all objects should be cleared from the new difficulty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ClearAllObjects { get; set; }
|
public bool ClearAllObjects { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The saved state of the previous <see cref="Editor"/> which should be restored upon opening the newly-created difficulty.
|
/// The saved state of the previous <see cref="Editor"/> which should be restored upon opening the newly-created difficulty.
|
||||||
/// </summary>
|
/// </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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user