Fix admin ObjectsTab error (#11272)

This commit is contained in:
Leon Friedrich
2022-09-16 07:06:52 +12:00
committed by GitHub
parent 591b5463a1
commit 9ba869c744

View File

@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using Content.Client.Station;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
@@ -56,7 +56,9 @@ public sealed partial class ObjectsTab : Control
foreach (var entity in entities)
{
var ctrl = new ObjectsTabEntry(_entityManager.GetComponent<MetaDataComponent>(entity).EntityName, entity);
// TODO the server eitehr needs to send the entity's name, or it needs to ensure the client knows about the entity.
var name = _entityManager.GetComponentOrNull<MetaDataComponent>(entity)?.EntityName ?? "Unknown Entity"; // this should be fixed, so I CBF localizing.
var ctrl = new ObjectsTabEntry(name, entity);
_objects.Add(ctrl);
ObjectList.AddChild(ctrl);
ctrl.OnPressed += args => OnEntryPressed?.Invoke(args);