StrippingMenu.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Robust.Client.UserInterface.Controls;
  2. using Robust.Client.UserInterface.CustomControls;
  3. using Robust.Shared.Timing;
  4. using static Robust.Client.UserInterface.Controls.BoxContainer;
  5. namespace Content.Client.Strip
  6. {
  7. public sealed class StrippingMenu : DefaultWindow
  8. {
  9. public LayoutContainer InventoryContainer = new();
  10. public BoxContainer HandsContainer = new() { Orientation = LayoutOrientation.Horizontal };
  11. public BoxContainer SnareContainer = new();
  12. public bool Dirty = true;
  13. public event Action? OnDirty;
  14. public StrippingMenu()
  15. {
  16. var box = new BoxContainer() { Orientation = LayoutOrientation.Vertical, Margin = new Thickness(0, 8) };
  17. Contents.AddChild(box);
  18. box.AddChild(SnareContainer);
  19. box.AddChild(HandsContainer);
  20. box.AddChild(InventoryContainer);
  21. }
  22. public void ClearButtons()
  23. {
  24. InventoryContainer.DisposeAllChildren();
  25. HandsContainer.DisposeAllChildren();
  26. SnareContainer.DisposeAllChildren();
  27. }
  28. protected override void FrameUpdate(FrameEventArgs args)
  29. {
  30. if (!Dirty)
  31. return;
  32. Dirty = false;
  33. OnDirty?.Invoke();
  34. }
  35. }
  36. }