mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
Content update for NetEntities (#18935)
This commit is contained in:
@@ -49,7 +49,8 @@ namespace Content.Client.ContextMenu.UI
|
||||
|
||||
private string? SearchPlayerName(EntityUid entity)
|
||||
{
|
||||
return _adminSystem.PlayerList.FirstOrDefault(player => player.EntityUid == entity)?.Username;
|
||||
var netEntity = _entityManager.GetNetEntity(entity);
|
||||
return _adminSystem.PlayerList.FirstOrDefault(player => player.NetEntity == netEntity)?.Username;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,12 +78,12 @@ namespace Content.Client.ContextMenu.UI
|
||||
var representation = _entityManager.ToPrettyString(entity);
|
||||
|
||||
var name = representation.Name;
|
||||
var id = representation.Uid;
|
||||
var id = representation.Uid.ToString();
|
||||
var prototype = representation.Prototype;
|
||||
var playerName = representation.Session?.Name ?? SearchPlayerName(entity);
|
||||
var deleted = representation.Deleted;
|
||||
|
||||
return $"{name} ({id}{(prototype != null ? $", {prototype}" : "")}{(playerName != null ? $", {playerName}" : "")}){(deleted ? "D" : "")}";
|
||||
return $"{name} ({id} / {_entityManager.GetNetEntity(entity).ToString()}{(prototype != null ? $", {prototype}" : "")}{(playerName != null ? $", {playerName}" : "")}){(deleted ? "D" : "")}";
|
||||
}
|
||||
|
||||
private string GetEntityDescription(EntityUid entity)
|
||||
|
||||
@@ -133,8 +133,16 @@ namespace Content.Client.ContextMenu.UI
|
||||
var func = args.Function;
|
||||
var funcId = _inputManager.NetworkBindMap.KeyFunctionID(func);
|
||||
|
||||
var message = new FullInputCmdMessage(_gameTiming.CurTick, _gameTiming.TickFraction, funcId,
|
||||
BoundKeyState.Down, _entityManager.GetComponent<TransformComponent>(entity.Value).Coordinates, args.PointerLocation, entity.Value);
|
||||
var message = new ClientFullInputCmdMessage(
|
||||
_gameTiming.CurTick,
|
||||
_gameTiming.TickFraction,
|
||||
funcId)
|
||||
{
|
||||
State = BoundKeyState.Down,
|
||||
Coordinates = _entityManager.GetComponent<TransformComponent>(entity.Value).Coordinates,
|
||||
ScreenCoordinates = args.PointerLocation,
|
||||
Uid = entity.Value,
|
||||
};
|
||||
|
||||
var session = _playerManager.LocalPlayer?.Session;
|
||||
if (session != null)
|
||||
|
||||
Reference in New Issue
Block a user