mirror of https://github.com/ppy/osu
Add explanation about try-catch logic in `SkinComponentToolbox`
This commit is contained in:
parent
1d83b36cfc
commit
e252f1a3cd
|
@ -8,6 +8,7 @@
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
@ -74,8 +75,14 @@ private void attemptAddComponent(Type type)
|
||||||
RequestPlacement = t => RequestPlacement?.Invoke(t)
|
RequestPlacement = t => RequestPlacement?.Invoke(t)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch
|
catch (DependencyNotRegisteredException)
|
||||||
{
|
{
|
||||||
|
// This loading code relies on try-catching any dependency injection errors to know which components are valid for the current target screen.
|
||||||
|
// If a screen can't provide the required dependencies, a skinnable component should not be displayed in the list.
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e, $"Skin component {type} could not be loaded in the editor component list due to an error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue