mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 21:17:18 +08:00
Fix initial skin state being stored wrong to undo history
This commit is contained in:
parent
16e69b08a1
commit
1f2f4a533f
@ -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)
|
if (targetContainer != null)
|
||||||
changeHandler = new SkinEditorChangeHandler(targetContainer);
|
changeHandler = new SkinEditorChangeHandler(targetContainer);
|
||||||
|
|
||||||
hasBegunMutating = true;
|
hasBegunMutating = true;
|
||||||
|
|
||||||
// Reload sidebar components.
|
// Reload sidebar components.
|
||||||
selectedTarget.TriggerChange();
|
selectedTarget.TriggerChange();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user