1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-06 21:57:19 +08:00

Fix initial skin state being stored wrong to undo history

This commit is contained in:
Dean Herbert 2024-09-30 19:53:06 +09:00
parent 16e69b08a1
commit 1f2f4a533f
No known key found for this signature in database

View File

@ -422,17 +422,24 @@ namespace osu.Game.Overlays.SkinEditor
}); });
changeHandler?.Dispose(); changeHandler?.Dispose();
changeHandler = null;
skins.EnsureMutableSkin(); // Schedule is required to ensure that all layout in `LoadComplete` methods has been completed
// before storing an undo state.
//
// See https://github.com/ppy/osu/blob/8e6a4559e3ae8c9892866cf9cf8d4e8d1b72afd0/osu.Game/Skinning/SkinReloadableDrawable.cs#L76.
Schedule(() =>
{
var targetContainer = getTarget(selectedTarget.Value);
var targetContainer = getTarget(selectedTarget.Value); if (targetContainer != null)
changeHandler = new SkinEditorChangeHandler(targetContainer);
if (targetContainer != null) hasBegunMutating = true;
changeHandler = new SkinEditorChangeHandler(targetContainer);
hasBegunMutating = true;
// Reload sidebar components. // Reload sidebar components.
selectedTarget.TriggerChange(); selectedTarget.TriggerChange();
});
} }
/// <summary> /// <summary>