mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-02-14 23:14:45 +01:00
* feat: allow removing empty smart fridge entries * review --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
26 lines
637 B
C#
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;
|
|
}
|
|
}
|