Files
space-station-14/Content.Client/SmartFridge/SmartFridgeItem.xaml.cs
Perry Fraser 78343b2dbb feat: allow removing empty smart fridge entries (#39195)
* feat: allow removing empty smart fridge entries

* review

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-01-09 14:48:38 +00:00

26 lines
637 B
C#

using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
namespace Content.Client.SmartFridge;
[GenerateTypedNameReferences]
public sealed partial class SmartFridgeItem : BoxContainer
{
public Action? RemoveButtonPressed;
public SmartFridgeItem(EntityUid uid, string text)
{
RobustXamlLoader.Load(this);
EntityView.SetEntity(uid);
NameLabel.Text = text;
RemoveButton.OnPressed += _ => RemoveButtonPressed?.Invoke();
if (uid.IsValid())
RemoveButton.Visible = false;
}
}