1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-22 23:00:52 +08:00

Fix migration not working correctly when applying on a default skin

This commit is contained in:
Dean Herbert
2022-04-28 14:09:41 +09:00
Unverified
parent aabe586578
commit 7c1b0b41ff
+9 -10
View File
@@ -162,7 +162,6 @@ namespace osu.Game.Screens.Play
if (!configShowGraph.IsDefault)
{
ShowGraph.Value = configShowGraph.Value;
configShowGraph.SetDefault();
// This is pretty ugly, but the only way to make this stick...
if (skinManager != null)
@@ -171,17 +170,17 @@ namespace osu.Game.Screens.Play
if (skinnableTarget != null)
{
skinManager.EnsureMutableSkin();
// If the skin is not mutable, a mutable instance will be created, causing this migration logic to run again on the correct skin.
// Therefore we want to avoid resetting the config value on this invocation.
if (skinManager.EnsureMutableSkin())
return;
// If `EnsureMutableSkin` actually changed the skin, default layout may take a frame to apply.
// See `SkinnableTargetComponentsContainer`'s use of ScheduleAfterChildren.
ScheduleAfterChildren(() =>
{
var skin = skinManager.CurrentSkin.Value;
skin.UpdateDrawableTarget(skinnableTarget);
var skin = skinManager.CurrentSkin.Value;
skin.UpdateDrawableTarget(skinnableTarget);
skinManager.Save(skin);
});
skinManager.Save(skin);
configShowGraph.SetDefault();
}
}
}