* Content - change the (should-be-obsolete) DisposeAllChildren into the more robust RemoveAllChildren.
* Remove duplicate calls.
---------
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
public void SetAccessLevels(IPrototypeManager protoManager, List<ProtoId<AccessLevelPrototype>> accessLevels)
{
_accessButtons.Clear();
- AccessLevelGrid.DisposeAllChildren();
+ AccessLevelGrid.RemoveAllChildren();
foreach (var access in accessLevels)
{
public void SetAllowedIcons(string currentJobIconId)
{
- IconGrid.DisposeAllChildren();
+ IconGrid.RemoveAllChildren();
var jobIconButtonGroup = new ButtonGroup();
var i = 0;
private bool TryRebuildAccessGroupControls()
{
- AccessGroupList.DisposeAllChildren();
- AccessLevelChecklist.DisposeAllChildren();
+ AccessGroupList.RemoveAllChildren();
+ AccessLevelChecklist.RemoveAllChildren();
// No access level prototypes were assigned to any of the access level groups.
// Either the turret controller has no assigned access levels or their names were invalid.
/// </summary>
public void RebuildAccessLevelsControls()
{
- AccessLevelChecklist.DisposeAllChildren();
+ AccessLevelChecklist.RemoveAllChildren();
_accessLevelEntries.Clear();
// No access level prototypes were assigned to any of the access level groups
/// </summary>
public void UpdateReagents()
{
- ReagentList.DisposeAllChildren();
+ ReagentList.RemoveAllChildren();
if (_selectedSolution == null || _solutions == null)
return;
/// <param name="solution">The selected solution.</param>
private void UpdateVolumeBox(Solution solution)
{
- VolumeBox.DisposeAllChildren();
+ VolumeBox.RemoveAllChildren();
var volumeLabel = new Label();
volumeLabel.HorizontalExpand = true;
/// <param name="solution">The selected solution.</param>
private void UpdateThermalBox(Solution solution)
{
- ThermalBox.DisposeAllChildren();
+ ThermalBox.RemoveAllChildren();
var heatCap = solution.GetHeatCapacity(null);
var specificHeatLabel = new Label();
specificHeatLabel.HorizontalExpand = true;
if (!_orderConsoleQuery.TryComp(_owner, out var orderConsole))
return;
- Requests.DisposeAllChildren();
+ Requests.RemoveAllChildren();
foreach (var order in orders)
{
public void SetOrders(SpriteSystem sprites, IPrototypeManager protoManager, List<CargoOrderData> orders)
{
- Orders.DisposeAllChildren();
+ Orders.RemoveAllChildren();
foreach (var order in orders)
{
-using Content.Client.CrewManifest.UI;
+using Content.Client.CrewManifest.UI;
using Content.Shared.CrewManifest;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
public void UpdateState(string stationName, CrewManifestEntries? entries)
{
- CrewManifestListing.DisposeAllChildren();
CrewManifestListing.RemoveAllChildren();
StationNameContainer.Visible = entries != null;
// Changelog is not kept in memory so load it again.
var changelogs = await _changelog.LoadChangelog();
- Tabs.DisposeAllChildren();
+ Tabs.RemoveAllChildren();
var i = 0;
foreach (var changelog in changelogs)
/// </summary>
public void Close()
{
- RootMenu.MenuBody.DisposeAllChildren();
+ RootMenu.MenuBody.RemoveAllChildren();
CancelOpen?.Cancel();
CancelClose?.Cancel();
OnContextClosed?.Invoke();
var element = new EntityMenuElement(entity);
element.SubMenu = new ContextMenuPopup(_context, element);
element.SubMenu.OnPopupOpen += () => _verb.OpenVerbMenu(entity, popup: element.SubMenu);
- element.SubMenu.OnPopupHide += element.SubMenu.MenuBody.DisposeAllChildren;
+ element.SubMenu.OnPopupHide += element.SubMenu.MenuBody.RemoveAllChildren;
_context.AddElement(menu, element);
Elements.TryAdd(entity, element);
}
private void RefreshList()
{
// Clear
- Grids.DisposeAllChildren();
+ Grids.RemoveAllChildren();
if (_decals == null || _allDecals == null)
return;
public void Populate(string name, CrewManifestEntries? entries)
{
- CrewManifestListing.DisposeAllChildren();
CrewManifestListing.RemoveAllChildren();
StationNameContainer.Visible = entries != null;
_isUnlockPending = _nextUnlock >= _timing.CurTime;
_isCooldownPending = _nextReady >= _timing.CurTime;
- Container.DisposeAllChildren();
+ Container.RemoveAllChildren();
if (_destinations.Count == 0)
{
AlertsContainer.Visible = showAlerts;
if (showAlerts)
- AlertsContainer.DisposeAllChildren();
+ AlertsContainer.RemoveAllChildren();
if (msg.Unrevivable == true)
AlertsContainer.AddChild(new RichTextLabel
var stateNames = GetMarkingStateNames(prototype);
_currentMarkingColors.Clear();
- CMarkingColors.DisposeAllChildren();
+ CMarkingColors.RemoveAllChildren();
List<ColorSelectorSliders> colorSliders = new();
for (int i = 0; i < prototype.Sprites.Count; i++)
{
var marking = _markings[Slot];
- ColorSelectorContainer.DisposeAllChildren();
ColorSelectorContainer.RemoveAllChildren();
if (marking.MarkingColors.Count != proto.Sprites.Count)
public void ReloadCharacterPickers()
{
_createNewCharacterButton.Orphan();
- Characters.DisposeAllChildren();
+ Characters.RemoveAllChildren();
var numberOfFullSlots = 0;
var characterButtonsGroup = new ButtonGroup();
/// </summary>
public void RefreshTraits()
{
- TraitsList.DisposeAllChildren();
+ TraitsList.RemoveAllChildren();
var traits = _prototypeManager.EnumeratePrototypes<TraitPrototype>().OrderBy(t => Loc.GetString(t.Name)).ToList();
TabContainer.SetTabTitle(3, Loc.GetString("humanoid-profile-editor-traits-tab"));
public void RefreshAntags()
{
- AntagList.DisposeAllChildren();
+ AntagList.RemoveAllChildren();
var items = new[]
{
("humanoid-profile-editor-antag-preference-yes-button", 0),
/// </summary>
public void RefreshJobs()
{
- JobList.DisposeAllChildren();
+ JobList.RemoveAllChildren();
_jobCategories.Clear();
_jobPriorities.Clear();
var firstCategory = true;
{
var protoMan = collection.Resolve<IPrototypeManager>();
var loadoutSystem = collection.Resolve<IEntityManager>().System<LoadoutSystem>();
- RestrictionsContainer.DisposeAllChildren();
+ RestrictionsContainer.RemoveAllChildren();
if (_groupProto.MinLimit > 0)
{
});
}
- LoadoutsContainer.DisposeAllChildren();
+ LoadoutsContainer.RemoveAllChildren();
// Get all loadout prototypes for this group.
var validProtos = _groupProto.Loadouts.Select(id => protoMan.Index(id));
_previewDummy = uid;
- ViewBox.DisposeAllChildren();
+ ViewBox.RemoveAllChildren();
var spriteView = new SpriteView
{
OverrideDirection = Direction.South,
-using System.Numerics;
+using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
{
_prototypes.Clear();
- PrototypeList.DisposeAllChildren();
+ PrototypeList.RemoveAllChildren();
_prototypes.AddRange(prototypes);
public void Search(List<MappingPrototype> prototypes)
{
_search.Clear();
- SearchList.DisposeAllChildren();
+ SearchList.RemoveAllChildren();
_lastIndices = (0, -1);
_search.AddRange(prototypes);
}
else
{
- button.ChildrenPrototypes.DisposeAllChildren();
+ button.ChildrenPrototypes.RemoveAllChildren();
button.CollapseButton.Label.Text = "▶";
}
}
// Selection action
windowEntry.Button.OnButtonUp += args =>
{
- windowEntry.SourcesContainer.DisposeAllChildren();
- windowEntry.LoadsContainer.DisposeAllChildren();
+ windowEntry.SourcesContainer.RemoveAllChildren();
+ windowEntry.LoadsContainer.RemoveAllChildren();
ButtonAction(windowEntry, masterContainer);
};
}
public void ClearOptions()
{
- Container.DisposeAllChildren();
+ Container.RemoveAllChildren();
}
protected override void FrameUpdate(FrameEventArgs args)
{
DockingControl.BuildDocks(shuttle);
var currentDock = DockingControl.ViewedDock;
- // DockedWith.DisposeAllChildren();
- DockPorts.DisposeAllChildren();
+ // DockedWith.RemoveAllChildren();
+ DockPorts.RemoveAllChildren();
_ourDockButtons.Clear();
if (shuttle == null)
// TODO: Loc and cvar for this.
_earlyLaunchTime = scc.EarlyLaunchTime;
- AuthorizationsContainer.DisposeAllChildren();
+ AuthorizationsContainer.RemoveAllChildren();
var remainingAuths = scc.AuthorizationsRequired - scc.Authorizations.Count;
AuthorizationCount.Text = Loc.GetString("emergency-shuttle-ui-remaining", ("remaining", remainingAuths));
private void ClearMapObjects()
{
_mapObjectControls.Clear();
- HyperspaceDestinations.DisposeAllChildren();
+ HyperspaceDestinations.RemoveAllChildren();
_pendingMapObjects.Clear();
_mapObjects.Clear();
_mapHeadings.Clear();
public void ClearButtons()
{
- InventoryContainer.DisposeAllChildren();
- HandsContainer.DisposeAllChildren();
- SnareContainer.DisposeAllChildren();
+ InventoryContainer.RemoveAllChildren();
+ HandsContainer.RemoveAllChildren();
+ SnareContainer.RemoveAllChildren();
}
protected override void FrameUpdate(FrameEventArgs args)
public void UpdateState(ThiefBackpackBoundUserInterfaceState state)
{
- SetsGrid.DisposeAllChildren();
+ SetsGrid.RemoveAllChildren();
var selectedNumber = 0;
foreach (var (set, info) in state.Sets)
{
-using System.Numerics;
+using System.Numerics;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
public void Clear()
{
- DisposeAllChildren();
+ RemoveAllChildren();
}
public void AddEntry(float amount, Color color, string? tooltip = null)
public void UpdateValues(List<string> headers, List<string[]> values)
{
- Values.DisposeAllChildren();
+ Values.RemoveAllChildren();
Values.Columns = headers.Count;
for (var i = 0; i < headers.Count; i++)
public void Populate()
{
- ButtonContainer.DisposeAllChildren();
+ ButtonContainer.RemoveAllChildren();
AddButtons();
}
public void ClearEntries()
{
NoRolesMessage.Visible = true;
- EntryContainer.DisposeAllChildren();
+ EntryContainer.RemoveAllChildren();
_collapsibleBoxes.Clear();
}
-using System.Linq;
+using System.Linq;
using Content.Client.UserInterface.Systems.Inventory.Controls;
using Robust.Client.UserInterface.Controls;
public void Clear()
{
ClearButtons();
- _grid.DisposeAllChildren();
+ _grid.RemoveAllChildren();
}
public IEnumerable<HandButton> GetButtons()
Close();
var menu = popup ?? _context.RootMenu;
- menu.MenuBody.DisposeAllChildren();
+ menu.MenuBody.RemoveAllChildren();
CurrentTarget = target;
CurrentVerbs = _verbSystem.GetVerbs(target, user, Verb.VerbTypes, out ExtraCategories, force);
/// </summary>
public void AddServerVerbs(List<Verb>? verbs, ContextMenuPopup popup)
{
- popup.MenuBody.DisposeAllChildren();
+ popup.MenuBody.RemoveAllChildren();
// Verbs may be null if the server does not think we can see the target entity. This **should** not happen.
if (verbs == null)