Make some Control properties animatable (#6376)

This commit is contained in:
eoineoineoin
2026-01-10 22:35:08 +00:00
committed by GitHub
parent 736e46cd82
commit 5b06066fcb
2 changed files with 7 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Animations;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
@@ -355,6 +356,7 @@ namespace Robust.Client.UserInterface
/// </remarks>
/// <seealso cref="MinWidth"/>
/// <seealso cref="MinHeight"/>
[Animatable]
public Vector2 MinSize
{
get => new(_minWidth, _minHeight);
@@ -378,6 +380,7 @@ namespace Robust.Client.UserInterface
/// </remarks>
/// <seealso cref="SetWidth"/>
/// <seealso cref="SetHeight"/>
[Animatable]
public Vector2 SetSize
{
get => new(_setWidth, _setHeight);
@@ -434,6 +437,7 @@ namespace Robust.Client.UserInterface
/// Width component of <see cref="SetSize"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[Animatable]
public float SetWidth
{
get => _setWidth;
@@ -449,6 +453,7 @@ namespace Robust.Client.UserInterface
/// Height component of <see cref="SetSize"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[Animatable]
public float SetHeight
{
get => _setHeight;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
@@ -44,6 +44,7 @@ namespace Robust.Client.UserInterface.Controls
/// Thrown if <see cref="TextMemory"/> was set directly and there is no backing string instance to fetch.
/// </exception>
[ViewVariables]
[Animatable]
public string? Text
{
get => _text ?? (_textMemory.Length > 0 ? throw new InvalidOperationException("Label uses TextMemory, cannot fetch string text.") : null);