1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Fix skin potentially being lost when opening and closing skin editor rapidly

This commit is contained in:
Dean Herbert 2024-01-16 15:23:07 +09:00
parent 0e41d0c9cf
commit cd02d00c03
No known key found for this signature in database

View File

@ -47,7 +47,7 @@ namespace osu.Game.Overlays.SkinEditor
protected override bool StartHidden => true;
private Drawable targetScreen = null!;
private Drawable? targetScreen;
private OsuTextFlowContainer headerText = null!;
@ -541,8 +541,14 @@ namespace osu.Game.Overlays.SkinEditor
if (!hasBegunMutating)
return;
if (targetScreen?.IsLoaded != true)
return;
SkinComponentsContainer[] targetContainers = availableTargets.ToArray();
if (!targetContainers.All(c => c.ComponentsLoaded))
return;
foreach (var t in targetContainers)
currentSkin.Value.UpdateDrawableTarget(t);