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

Add JsonConstructor attribute to SkinnableTargetWrapper

This commit is contained in:
Dean Herbert 2021-05-13 13:16:20 +09:00
parent 3b862798e9
commit db19617b8b

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using Newtonsoft.Json;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -11,6 +12,7 @@ namespace osu.Game.Skinning
/// A container which is serialised and can encapsulate multiple skinnable elements into a single return type (for consumption via <see cref="ISkin.GetDrawableComponent"/>. /// A container which is serialised and can encapsulate multiple skinnable elements into a single return type (for consumption via <see cref="ISkin.GetDrawableComponent"/>.
/// Will also optionally apply default cross-element layout dependencies when initialised from a non-deserialised source. /// Will also optionally apply default cross-element layout dependencies when initialised from a non-deserialised source.
/// </summary> /// </summary>
[Serializable]
public class SkinnableTargetWrapper : Container, ISkinSerialisable public class SkinnableTargetWrapper : Container, ISkinSerialisable
{ {
private readonly Action<Container> applyDefaults; private readonly Action<Container> applyDefaults;
@ -25,6 +27,7 @@ namespace osu.Game.Skinning
this.applyDefaults = applyDefaults; this.applyDefaults = applyDefaults;
} }
[JsonConstructor]
public SkinnableTargetWrapper() public SkinnableTargetWrapper()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;