Fix admin ObjectsTab error (#11272)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user