Files
tbd-station-14/Content.Client/Strip/StrippingMenu.cs
LordCarve a3ddba6f42 Cleanup - Use RemoveAllChildren() over DisposeAllChildren() (#39848)
* Content - change the (should-be-obsolete) DisposeAllChildren into the more robust RemoveAllChildren.

* Remove duplicate calls.

---------

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2025-09-23 15:40:48 +12:00

43 lines
1.2 KiB
C#

using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Timing;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Strip
{
public sealed class StrippingMenu : DefaultWindow
{
public LayoutContainer InventoryContainer = new();
public LayoutContainer HandsContainer = new();
public BoxContainer SnareContainer = new();
public bool Dirty = true;
public event Action? OnDirty;
public StrippingMenu()
{
var box = new BoxContainer() { Orientation = LayoutOrientation.Vertical, Margin = new Thickness(0, 8) };
Contents.AddChild(box);
box.AddChild(SnareContainer);
box.AddChild(HandsContainer);
box.AddChild(InventoryContainer);
}
public void ClearButtons()
{
InventoryContainer.RemoveAllChildren();
HandsContainer.RemoveAllChildren();
SnareContainer.RemoveAllChildren();
}
protected override void FrameUpdate(FrameEventArgs args)
{
if (!Dirty)
return;
Dirty = false;
OnDirty?.Invoke();
}
}
}