mirror of https://github.com/ppy/osu
Ensure skin is saved immediately after becoming mutable
Without doing this, the JSON content is not written to the file. A user assumption is that as soon as a skin shows up in the skin list as exportable, it should export correctly, so it makes sense that it should be in a sane state even if the user has not made any changes in the skin editor yet. Going forward, we might move more of the json serialisation logic out, and run for consistency as part of the import process. This seems like the simplest way to guarantee things for now, though.
This commit is contained in:
parent
fe99d4e984
commit
0e82e9355b
|
@ -156,7 +156,13 @@ public void EnsureMutableSkin()
|
|||
}).Result;
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
// save once to ensure the required json content is populated.
|
||||
// currently this only happens on save.
|
||||
result.PerformRead(skin => Save(skin.CreateInstance(this)));
|
||||
|
||||
CurrentSkinInfo.Value = result;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue