Files
tbd-station-14/Content.Client/CartridgeLoader/Cartridges/CrewManifestUiFragment.xaml.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

35 lines
943 B
C#

using Content.Client.CrewManifest.UI;
using Content.Shared.CrewManifest;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.CartridgeLoader.Cartridges;
[GenerateTypedNameReferences]
public sealed partial class CrewManifestUiFragment : BoxContainer
{
public CrewManifestUiFragment()
{
RobustXamlLoader.Load(this);
StationName.AddStyleClass("LabelBig");
Orientation = LayoutOrientation.Vertical;
HorizontalExpand = true;
VerticalExpand = true;
}
public void UpdateState(string stationName, CrewManifestEntries? entries)
{
CrewManifestListing.RemoveAllChildren();
StationNameContainer.Visible = entries != null;
StationName.Text = stationName;
if (entries == null)
return;
CrewManifestListing.AddCrewManifestEntries(entries);
}
}