Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -64,15 +64,18 @@ namespace Content.Client.Medical.CrewMonitoring
// add a row for each sensor
foreach (var sensor in stSensors.OrderBy(a => a.Name))
{
var sensorEntity = _entManager.GetEntity(sensor.SuitSensorUid);
var coordinates = _entManager.GetCoordinates(sensor.Coordinates);
// add button with username
var nameButton = new CrewMonitoringButton()
{
SuitSensorUid = sensor.SuitSensorUid,
Coordinates = sensor.Coordinates,
SuitSensorUid = sensorEntity,
Coordinates = coordinates,
Text = sensor.Name,
Margin = new Thickness(5f, 5f),
};
if (sensor.SuitSensorUid == _trackedButton?.SuitSensorUid)
if (sensorEntity == _trackedButton?.SuitSensorUid)
nameButton.AddStyleClass(StyleNano.StyleClassButtonColorGreen);
SetColorLabel(nameButton.Label, sensor.TotalDamage, sensor.IsAlive);
SensorsTable.AddChild(nameButton);
@@ -113,10 +116,10 @@ namespace Content.Client.Medical.CrewMonitoring
SensorsTable.AddChild(box);
_rowsContent.Add(box);
if (sensor.Coordinates != null && NavMap.Visible)
if (coordinates != null && NavMap.Visible)
{
NavMap.TrackedCoordinates.TryAdd(sensor.Coordinates.Value,
(true, sensor.SuitSensorUid == _trackedButton?.SuitSensorUid ? StyleNano.PointGreen : StyleNano.PointRed));
NavMap.TrackedCoordinates.TryAdd(coordinates.Value,
(true, sensorEntity == _trackedButton?.SuitSensorUid ? StyleNano.PointGreen : StyleNano.PointRed));
nameButton.OnButtonUp += args =>
{
@@ -124,8 +127,8 @@ namespace Content.Client.Medical.CrewMonitoring
//Make previous point red
NavMap.TrackedCoordinates[_trackedButton.Coordinates.Value] = (true, StyleNano.PointRed);
NavMap.TrackedCoordinates[sensor.Coordinates.Value] = (true, StyleNano.PointGreen);
NavMap.CenterToCoordinates(sensor.Coordinates.Value);
NavMap.TrackedCoordinates[coordinates.Value] = (true, StyleNano.PointGreen);
NavMap.CenterToCoordinates(coordinates.Value);
nameButton.AddStyleClass(StyleNano.StyleClassButtonColorGreen);
if (_trackedButton != null)
@@ -145,7 +148,7 @@ namespace Content.Client.Medical.CrewMonitoring
private BoxContainer GetPositionBox(SuitSensorStatus sensor, Vector2 monitorCoordsInStationSpace, bool snap, float precision)
{
EntityCoordinates? coordinates = sensor.Coordinates;
EntityCoordinates? coordinates = _entManager.GetCoordinates(sensor.Coordinates);
var box = new BoxContainer() { Orientation = LayoutOrientation.Horizontal };
if (coordinates == null || _stationUid == null)