Puddles & spreader refactor (#15191)

This commit is contained in:
metalgearsloth
2023-04-10 15:37:03 +10:00
committed by GitHub
parent 3178ab83f6
commit 317a4013eb
141 changed files with 3046 additions and 3201 deletions

View File

@@ -0,0 +1,39 @@
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Controls
{
[GenerateTypedNameReferences]
public partial class SplitBar : BoxContainer
{
public SplitBar()
{
RobustXamlLoader.Load(this);
}
public void Clear()
{
DisposeAllChildren();
}
public void AddEntry(float amount, Color color, string? tooltip = null)
{
AddChild(new PanelContainer
{
ToolTip = tooltip,
HorizontalExpand = true,
SizeFlagsStretchRatio = amount,
MouseFilter = MouseFilterMode.Stop,
PanelOverride = new StyleBoxFlat
{
BackgroundColor = color,
PaddingLeft = 2f,
PaddingRight = 2f,
},
MinSize = new Vector2(24, 0)
});
}
}
}