Sentry turrets - Part 6: Sentry turret control panels (#35235)

This commit is contained in:
chromiumboy
2025-05-26 08:00:50 -05:00
committed by GitHub
parent 32ffbbfb0f
commit f99850e1fb
18 changed files with 1511 additions and 66 deletions

View File

@@ -7,7 +7,7 @@ namespace Content.Client.UserInterface.Controls;
/// <summary>
/// A button intended for use with a monotone color palette
/// </summary>
public sealed class MonotoneButton : ContainerButton
public sealed class MonotoneButton : Button
{
/// <summary>
/// Specifies the color of the label text when the button is pressed.
@@ -15,43 +15,9 @@ public sealed class MonotoneButton : ContainerButton
[ViewVariables]
public Color AltTextColor { set; get; } = new Color(0.2f, 0.2f, 0.2f);
/// <summary>
/// The label that holds the button text.
/// </summary>
public Label Label { get; }
/// <summary>
/// The text displayed by the button.
/// </summary>
[PublicAPI, ViewVariables]
public string? Text { get => Label.Text; set => Label.Text = value; }
/// <summary>
/// How to align the text inside the button.
/// </summary>
[PublicAPI, ViewVariables]
public AlignMode TextAlign { get => Label.Align; set => Label.Align = value; }
/// <summary>
/// If true, the button will allow shrinking and clip text
/// to prevent the text from going outside the bounds of the button.
/// If false, the minimum size will always fit the contained text.
/// </summary>
[PublicAPI, ViewVariables]
public bool ClipText
{
get => Label.ClipText;
set => Label.ClipText = value;
}
public MonotoneButton()
{
Label = new Label
{
StyleClasses = { StyleClassButton }
};
AddChild(Label);
RemoveStyleClass("button");
UpdateAppearance();
}