mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:23:21 +08:00
Fix Show
then Reset
potentially resulting in incorrect load target
This commit is contained in:
parent
471eea750a
commit
b1a444180f
@ -70,16 +70,18 @@ namespace osu.Game.Skinning.Editor
|
|||||||
// base call intentionally omitted.
|
// base call intentionally omitted.
|
||||||
if (skinEditor == null)
|
if (skinEditor == null)
|
||||||
{
|
{
|
||||||
skinEditor = new SkinEditor(target);
|
var editor = new SkinEditor(target);
|
||||||
skinEditor.State.BindValueChanged(editorVisibilityChanged);
|
editor.State.BindValueChanged(editorVisibilityChanged);
|
||||||
|
|
||||||
// Schedule ensures that if `Show` is called before this overlay is loaded,
|
// Schedule ensures that if `Show` is called before this overlay is loaded,
|
||||||
// it will not throw (LoadComponentAsync requires the load target to be in a loaded state).
|
// it will not throw (LoadComponentAsync requires the load target to be in a loaded state).
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
Debug.Assert(skinEditor != null);
|
Debug.Assert(editor != null);
|
||||||
LoadComponentAsync(skinEditor, AddInternal);
|
LoadComponentAsync(editor, AddInternal);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
skinEditor = editor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
skinEditor.Show();
|
skinEditor.Show();
|
||||||
|
Loading…
Reference in New Issue
Block a user