mirror of
https://github.com/ppy/osu
synced 2024-12-30 19:02:27 +00:00
Add serialization support via SkinnableInfo
This commit is contained in:
parent
c9f5808bf2
commit
11b1b8c633
@ -60,6 +60,7 @@ namespace osu.Game.Extensions
|
||||
component.Scale = info.Scale;
|
||||
component.Anchor = info.Anchor;
|
||||
component.Origin = info.Origin;
|
||||
component.IsUsingClosestAnchor().Value = !info.IsNotUsingClosestAnchor;
|
||||
|
||||
if (component is Container container)
|
||||
{
|
||||
|
@ -32,6 +32,13 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
public Anchor Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <see langword="false"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is
|
||||
/// automatically determined by proximity, <see langword="true"/> if the user has overridden it.
|
||||
/// </summary>
|
||||
/// <remarks>Stored this way because <c>default(bool)</c> is <see langword="false"/> and we want the default behaviour to be "closest".</remarks>
|
||||
public bool IsNotUsingClosestAnchor { get; set; }
|
||||
|
||||
public List<SkinnableInfo> Children { get; } = new List<SkinnableInfo>();
|
||||
|
||||
[JsonConstructor]
|
||||
@ -52,6 +59,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Scale = component.Scale;
|
||||
Anchor = component.Anchor;
|
||||
Origin = component.Origin;
|
||||
IsNotUsingClosestAnchor = !component.IsUsingClosestAnchor().Value;
|
||||
|
||||
if (component is Container<Drawable> container)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user