diff --git a/Content.Client/Animations/TrackUserComponent.cs b/Content.Client/Animations/TrackUserComponent.cs new file mode 100644 index 0000000000..374c187398 --- /dev/null +++ b/Content.Client/Animations/TrackUserComponent.cs @@ -0,0 +1,17 @@ +using System.Numerics; + +namespace Content.Client.Animations; + +/// +/// Entities with this component tracks the user's world position every frame. +/// +[RegisterComponent] +public sealed partial class TrackUserComponent : Component +{ + public EntityUid? User; + + /// + /// Offset in the direction of the entity's rotation. + /// + public Vector2 Offset = Vector2.Zero; +} diff --git a/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs b/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs index a2a7fb2531..8077406730 100644 --- a/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs +++ b/Content.Client/Light/EntitySystems/ExpendableLightSystem.cs @@ -52,7 +52,7 @@ public sealed class ExpendableLightSystem : VisualizerSystem HorizLinesLookup = new(); - protected Dictionary<(int, Vector2i), (int, Vector2i)> HorizLinesLookupReversed = new(); - protected Dictionary<(int, Vector2i), (int, Vector2i)> VertLinesLookup = new(); - protected Dictionary<(int, Vector2i), (int, Vector2i)> VertLinesLookupReversed = new(); + private Dictionary _horizLines = new(); + private Dictionary _horizLinesReversed = new(); + private Dictionary _vertLines = new(); + private Dictionary _vertLinesReversed = new(); // Components private NavMapComponent? _navMap; @@ -376,7 +377,7 @@ public partial class NavMapControl : MapGridControl var fontSize = (int) Math.Round(1 / WorldRange * DefaultDisplayedRange * UIScale * _targetFontsize, 0); var font = new VectorFont(_cache.GetResource("/Fonts/NotoSans/NotoSans-Bold.ttf"), fontSize); - foreach (var beacon in _navMap.Beacons) + foreach (var beacon in _navMap.Beacons.Values) { var position = beacon.Position - offset; position = ScalePosition(position with { Y = -position.Y }); @@ -485,113 +486,106 @@ public partial class NavMapControl : MapGridControl return; // We'll use the following dictionaries to combine collinear wall lines - HorizLinesLookup.Clear(); - HorizLinesLookupReversed.Clear(); - VertLinesLookup.Clear(); - VertLinesLookupReversed.Clear(); + _horizLines.Clear(); + _horizLinesReversed.Clear(); + _vertLines.Clear(); + _vertLinesReversed.Clear(); - foreach ((var (category, chunkOrigin), var chunk) in _navMap.Chunks) + const int southMask = (int) AtmosDirection.South << (int) NavMapChunkType.Wall; + const int eastMask = (int) AtmosDirection.East << (int) NavMapChunkType.Wall; + const int westMask = (int) AtmosDirection.West << (int) NavMapChunkType.Wall; + const int northMask = (int) AtmosDirection.North << (int) NavMapChunkType.Wall; + + foreach (var (chunkOrigin, chunk) in _navMap.Chunks) { - if (category != NavMapChunkType.Wall) - continue; - - for (var i = 0; i < SharedNavMapSystem.ChunkSize * SharedNavMapSystem.ChunkSize; i++) + for (var i = 0; i < SharedNavMapSystem.ArraySize; i++) { - var value = (ushort) Math.Pow(2, i); - var mask = _navMapSystem.GetCombinedEdgesForChunk(chunk.TileData) & value; - - if (mask == 0x0) + var tileData = chunk.TileData[i] & SharedNavMapSystem.WallMask; + if (tileData == 0) continue; - var relativeTile = SharedNavMapSystem.GetTile(mask); + tileData >>= (int) NavMapChunkType.Wall; + + var relativeTile = SharedNavMapSystem.GetTileFromIndex(i); var tile = (chunk.Origin * SharedNavMapSystem.ChunkSize + relativeTile) * _grid.TileSize; - if (!_navMapSystem.AllTileEdgesAreOccupied(chunk.TileData, relativeTile)) + if (tileData != SharedNavMapSystem.AllDirMask) { - AddRectForThinWall(chunk.TileData, tile); + AddRectForThinWall(tileData, tile); continue; } tile = tile with { Y = -tile.Y }; - NavMapChunk? neighborChunk; - bool neighbor; // North edge - if (relativeTile.Y == SharedNavMapSystem.ChunkSize - 1) - { - neighbor = _navMap.Chunks.TryGetValue((NavMapChunkType.Wall, chunkOrigin + new Vector2i(0, 1)), out neighborChunk) && - (neighborChunk.TileData[AtmosDirection.South] & - SharedNavMapSystem.GetFlag(new Vector2i(relativeTile.X, 0))) != 0x0; - } - else - { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(0, 1)); - neighbor = (chunk.TileData[AtmosDirection.South] & flag) != 0x0; - } + var neighborData = 0; + if (relativeTile.Y != SharedNavMapSystem.ChunkSize - 1) + neighborData = chunk.TileData[i+1]; + else if (_navMap.Chunks.TryGetValue(chunkOrigin + Vector2i.Up, out neighborChunk)) + neighborData = neighborChunk.TileData[i + 1 - SharedNavMapSystem.ChunkSize]; - if (!neighbor) - AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), tile + new Vector2i(_grid.TileSize, -_grid.TileSize), HorizLinesLookup, HorizLinesLookupReversed); + if ((neighborData & southMask) == 0) + { + AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), + tile + new Vector2i(_grid.TileSize, -_grid.TileSize), _horizLines, + _horizLinesReversed); + } // East edge - if (relativeTile.X == SharedNavMapSystem.ChunkSize - 1) - { - neighbor = _navMap.Chunks.TryGetValue((NavMapChunkType.Wall, chunkOrigin + new Vector2i(1, 0)), out neighborChunk) && - (neighborChunk.TileData[AtmosDirection.West] & - SharedNavMapSystem.GetFlag(new Vector2i(0, relativeTile.Y))) != 0x0; - } - else - { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(1, 0)); - neighbor = (chunk.TileData[AtmosDirection.West] & flag) != 0x0; - } + neighborData = 0; + if (relativeTile.X != SharedNavMapSystem.ChunkSize - 1) + neighborData = chunk.TileData[i+SharedNavMapSystem.ChunkSize]; + else if (_navMap.Chunks.TryGetValue(chunkOrigin + Vector2i.Right, out neighborChunk)) + neighborData = neighborChunk.TileData[i + SharedNavMapSystem.ChunkSize - SharedNavMapSystem.ArraySize]; - if (!neighbor) - AddOrUpdateNavMapLine(tile + new Vector2i(_grid.TileSize, -_grid.TileSize), tile + new Vector2i(_grid.TileSize, 0), VertLinesLookup, VertLinesLookupReversed); + if ((neighborData & westMask) == 0) + { + AddOrUpdateNavMapLine(tile + new Vector2i(_grid.TileSize, -_grid.TileSize), + tile + new Vector2i(_grid.TileSize, 0), _vertLines, _vertLinesReversed); + } // South edge - if (relativeTile.Y == 0) - { - neighbor = _navMap.Chunks.TryGetValue((NavMapChunkType.Wall, chunkOrigin + new Vector2i(0, -1)), out neighborChunk) && - (neighborChunk.TileData[AtmosDirection.North] & - SharedNavMapSystem.GetFlag(new Vector2i(relativeTile.X, SharedNavMapSystem.ChunkSize - 1))) != 0x0; - } - else - { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(0, -1)); - neighbor = (chunk.TileData[AtmosDirection.North] & flag) != 0x0; - } + neighborData = 0; + if (relativeTile.Y != 0) + neighborData = chunk.TileData[i-1]; + else if (_navMap.Chunks.TryGetValue(chunkOrigin + Vector2i.Down, out neighborChunk)) + neighborData = neighborChunk.TileData[i - 1 + SharedNavMapSystem.ChunkSize]; - if (!neighbor) - AddOrUpdateNavMapLine(tile, tile + new Vector2i(_grid.TileSize, 0), HorizLinesLookup, HorizLinesLookupReversed); + if ((neighborData & northMask) == 0) + { + AddOrUpdateNavMapLine(tile, tile + new Vector2i(_grid.TileSize, 0), _horizLines, + _horizLinesReversed); + } // West edge - if (relativeTile.X == 0) - { - neighbor = _navMap.Chunks.TryGetValue((NavMapChunkType.Wall, chunkOrigin + new Vector2i(-1, 0)), out neighborChunk) && - (neighborChunk.TileData[AtmosDirection.East] & - SharedNavMapSystem.GetFlag(new Vector2i(SharedNavMapSystem.ChunkSize - 1, relativeTile.Y))) != 0x0; - } - else - { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(-1, 0)); - neighbor = (chunk.TileData[AtmosDirection.East] & flag) != 0x0; - } + neighborData = 0; + if (relativeTile.X != 0) + neighborData = chunk.TileData[i-SharedNavMapSystem.ChunkSize]; + else if (_navMap.Chunks.TryGetValue(chunkOrigin + Vector2i.Left, out neighborChunk)) + neighborData = neighborChunk.TileData[i - SharedNavMapSystem.ChunkSize + SharedNavMapSystem.ArraySize]; - if (!neighbor) - AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), tile, VertLinesLookup, VertLinesLookupReversed); + if ((neighborData & eastMask) == 0) + { + AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), tile, _vertLines, + _vertLinesReversed); + } // Add a diagonal line for interiors. Unless there are a lot of double walls, there is no point combining these TileLines.Add((tile + new Vector2(0, -_grid.TileSize), tile + new Vector2(_grid.TileSize, 0))); } } - // Record the combined lines - foreach (var (origin, terminal) in HorizLinesLookup) - TileLines.Add((origin.Item2, terminal.Item2)); + // Record the combined lines + foreach (var (origin, terminal) in _horizLines) + { + TileLines.Add((origin, terminal)); + } - foreach (var (origin, terminal) in VertLinesLookup) - TileLines.Add((origin.Item2, terminal.Item2)); + foreach (var (origin, terminal) in _vertLines) + { + TileLines.Add((origin, terminal)); + } } private void UpdateNavMapAirlocks() @@ -599,26 +593,23 @@ public partial class NavMapControl : MapGridControl if (_navMap == null || _grid == null) return; - foreach (var ((category, _), chunk) in _navMap.Chunks) + foreach (var chunk in _navMap.Chunks.Values) { - if (category != NavMapChunkType.Airlock) - continue; - - for (var i = 0; i < SharedNavMapSystem.ChunkSize * SharedNavMapSystem.ChunkSize; i++) + for (var i = 0; i < SharedNavMapSystem.ArraySize; i++) { - var value = (int) Math.Pow(2, i); - var mask = _navMapSystem.GetCombinedEdgesForChunk(chunk.TileData) & value; - - if (mask == 0x0) + var tileData = chunk.TileData[i] & SharedNavMapSystem.AirlockMask; + if (tileData == 0) continue; - var relative = SharedNavMapSystem.GetTile(mask); + tileData >>= (int) NavMapChunkType.Airlock; + + var relative = SharedNavMapSystem.GetTileFromIndex(i); var tile = (chunk.Origin * SharedNavMapSystem.ChunkSize + relative) * _grid.TileSize; // If the edges of an airlock tile are not all occupied, draw a thin airlock for each edge - if (!_navMapSystem.AllTileEdgesAreOccupied(chunk.TileData, relative)) + if (tileData != SharedNavMapSystem.AllDirMask) { - AddRectForThinAirlock(chunk.TileData, tile); + AddRectForThinAirlock(tileData, tile); continue; } @@ -632,108 +623,90 @@ public partial class NavMapControl : MapGridControl } } - private void AddRectForThinWall(Dictionary tileData, Vector2i tile) + private void AddRectForThinWall(int tileData, Vector2i tile) { - if (_navMapSystem == null || _grid == null) - return; + var leftTop = new Vector2(-0.5f, 0.5f - ThinWallThickness); + var rightBottom = new Vector2(0.5f, 0.5f); - var leftTop = new Vector2(-0.5f, -0.5f + ThinWallThickness); - var rightBottom = new Vector2(0.5f, -0.5f); - - foreach (var (direction, mask) in tileData) + for (var i = 0; i < SharedNavMapSystem.Directions; i++) { - var relative = SharedMapSystem.GetChunkRelative(tile, SharedNavMapSystem.ChunkSize); - var flag = (ushort) SharedNavMapSystem.GetFlag(relative); - - if ((mask & flag) == 0) + var dirMask = 1 << i; + if ((tileData & dirMask) == 0) continue; var tilePosition = new Vector2(tile.X + 0.5f, -tile.Y - 0.5f); - var angle = new Angle(0); - - switch (direction) - { - case AtmosDirection.East: angle = new Angle(MathF.PI * 0.5f); break; - case AtmosDirection.South: angle = new Angle(MathF.PI); break; - case AtmosDirection.West: angle = new Angle(MathF.PI * -0.5f); break; - } + // TODO NAVMAP + // Consider using faster rotation operations, given that these are always 90 degree increments + var angle = -((AtmosDirection) dirMask).ToAngle(); TileRects.Add((angle.RotateVec(leftTop) + tilePosition, angle.RotateVec(rightBottom) + tilePosition)); } } - private void AddRectForThinAirlock(Dictionary tileData, Vector2i tile) + private void AddRectForThinAirlock(int tileData, Vector2i tile) { - if (_navMapSystem == null || _grid == null) - return; + var leftTop = new Vector2(-0.5f + FullWallInstep, 0.5f - FullWallInstep - ThinDoorThickness); + var rightBottom = new Vector2(0.5f - FullWallInstep, 0.5f - FullWallInstep); + var centreTop = new Vector2(0f, 0.5f - FullWallInstep - ThinDoorThickness); + var centreBottom = new Vector2(0f, 0.5f - FullWallInstep); - var leftTop = new Vector2(-0.5f + FullWallInstep, -0.5f + FullWallInstep + ThinDoorThickness); - var rightBottom = new Vector2(0.5f - FullWallInstep, -0.5f + FullWallInstep); - var centreTop = new Vector2(0f, -0.5f + FullWallInstep + ThinDoorThickness); - var centreBottom = new Vector2(0f, -0.5f + FullWallInstep); - - foreach (var (direction, mask) in tileData) + for (var i = 0; i < SharedNavMapSystem.Directions; i++) { - var relative = SharedMapSystem.GetChunkRelative(tile, SharedNavMapSystem.ChunkSize); - var flag = (ushort) SharedNavMapSystem.GetFlag(relative); - - if ((mask & flag) == 0) + var dirMask = 1 << i; + if ((tileData & dirMask) == 0) continue; var tilePosition = new Vector2(tile.X + 0.5f, -tile.Y - 0.5f); - var angle = new Angle(0); - - switch (direction) - { - case AtmosDirection.East: angle = new Angle(MathF.PI * 0.5f);break; - case AtmosDirection.South: angle = new Angle(MathF.PI); break; - case AtmosDirection.West: angle = new Angle(MathF.PI * -0.5f); break; - } - + var angle = -((AtmosDirection) dirMask).ToAngle(); TileRects.Add((angle.RotateVec(leftTop) + tilePosition, angle.RotateVec(rightBottom) + tilePosition)); TileLines.Add((angle.RotateVec(centreTop) + tilePosition, angle.RotateVec(centreBottom) + tilePosition)); } } - protected void AddOrUpdateNavMapLine - (Vector2i origin, + protected void AddOrUpdateNavMapLine( + Vector2i origin, Vector2i terminus, - Dictionary<(int, Vector2i), (int, Vector2i)> lookup, - Dictionary<(int, Vector2i), (int, Vector2i)> lookupReversed, - int index = 0) + Dictionary lookup, + Dictionary lookupReversed) { - (int, Vector2i) foundTermiusTuple; - (int, Vector2i) foundOriginTuple; + Vector2i foundTermius; + Vector2i foundOrigin; - if (lookup.TryGetValue((index, terminus), out foundTermiusTuple) && - lookupReversed.TryGetValue((index, origin), out foundOriginTuple)) + // Does our new line end at the beginning of an existing line? + if (lookup.Remove(terminus, out foundTermius)) { - lookup[foundOriginTuple] = foundTermiusTuple; - lookupReversed[foundTermiusTuple] = foundOriginTuple; + DebugTools.Assert(lookupReversed[foundTermius] == terminus); - lookup.Remove((index, terminus)); - lookupReversed.Remove((index, origin)); + // Does our new line start at the end of an existing line? + if (lookupReversed.Remove(origin, out foundOrigin)) + { + // Our new line just connects two existing lines + DebugTools.Assert(lookup[foundOrigin] == origin); + lookup[foundOrigin] = foundTermius; + lookupReversed[foundTermius] = foundOrigin; + } + else + { + // Our new line precedes an existing line, extending it further to the left + lookup[origin] = foundTermius; + lookupReversed[foundTermius] = origin; + } + return; } - else if (lookup.TryGetValue((index, terminus), out foundTermiusTuple)) + // Does our new line start at the end of an existing line? + if (lookupReversed.Remove(origin, out foundOrigin)) { - lookup[(index, origin)] = foundTermiusTuple; - lookup.Remove((index, terminus)); - lookupReversed[foundTermiusTuple] = (index, origin); + // Our new line just extends an existing line further to the right + DebugTools.Assert(lookup[foundOrigin] == origin); + lookup[foundOrigin] = terminus; + lookupReversed[terminus] = foundOrigin; + return; } - else if (lookupReversed.TryGetValue((index, origin), out foundOriginTuple)) - { - lookupReversed[(index, terminus)] = foundOriginTuple; - lookupReversed.Remove(foundOriginTuple); - lookup[foundOriginTuple] = (index, terminus); - } - - else - { - lookup.Add((index, origin), (index, terminus)); - lookupReversed.Add((index, terminus), (index, origin)); - } + // Completely disconnected line segment. + lookup.Add(origin, terminus); + lookupReversed.Add(terminus, origin); } protected Vector2 GetOffset() diff --git a/Content.Client/Power/PowerMonitoringConsoleNavMapControl.cs b/Content.Client/Power/PowerMonitoringConsoleNavMapControl.cs index 3d94318be8..d5057416cf 100644 --- a/Content.Client/Power/PowerMonitoringConsoleNavMapControl.cs +++ b/Content.Client/Power/PowerMonitoringConsoleNavMapControl.cs @@ -5,6 +5,7 @@ using Robust.Client.Graphics; using Robust.Shared.Collections; using Robust.Shared.Map.Components; using System.Numerics; +using static Content.Shared.Power.SharedPowerMonitoringConsoleSystem; namespace Content.Client.Power; @@ -26,6 +27,11 @@ public sealed partial class PowerMonitoringConsoleNavMapControl : NavMapControl public List PowerCableNetwork = new(); public List FocusCableNetwork = new(); + private Dictionary[] _horizLines = [new(), new(), new()]; + private Dictionary[] _horizLinesReversed = [new(), new(), new()]; + private Dictionary[] _vertLines = [new(), new(), new()]; + private Dictionary[] _vertLinesReversed = [new(), new(), new()]; + private MapGridComponent? _grid; public PowerMonitoringConsoleNavMapControl() : base() @@ -182,28 +188,32 @@ public sealed partial class PowerMonitoringConsoleNavMapControl : NavMapControl if (chunks == null) return decodedOutput; - // We'll use the following dictionaries to combine collinear power cable lines - HorizLinesLookup.Clear(); - HorizLinesLookupReversed.Clear(); - VertLinesLookup.Clear(); - VertLinesLookupReversed.Clear(); + Array.ForEach(_horizLines, x=> x.Clear()); + Array.ForEach(_horizLinesReversed, x=> x.Clear()); + Array.ForEach(_vertLines, x=> x.Clear()); + Array.ForEach(_vertLinesReversed, x=> x.Clear()); - foreach ((var chunkOrigin, var chunk) in chunks) + foreach (var (chunkOrigin, chunk) in chunks) { - for (int cableIdx = 0; cableIdx < chunk.PowerCableData.Length; cableIdx++) + for (var cableIdx = 0; cableIdx < 3; cableIdx++) { + var horizLines = _horizLines[cableIdx]; + var horizLinesReversed = _horizLinesReversed[cableIdx]; + var vertLines = _vertLines[cableIdx]; + var vertLinesReversed = _vertLinesReversed[cableIdx]; + var chunkMask = chunk.PowerCableData[cableIdx]; - for (var chunkIdx = 0; chunkIdx < SharedNavMapSystem.ChunkSize * SharedNavMapSystem.ChunkSize; chunkIdx++) + for (var chunkIdx = 0; chunkIdx < ChunkSize * ChunkSize; chunkIdx++) { - var value = (int) Math.Pow(2, chunkIdx); + var value = 1 << chunkIdx; var mask = chunkMask & value; if (mask == 0x0) continue; - var relativeTile = SharedNavMapSystem.GetTile(mask); - var tile = (chunk.Origin * SharedNavMapSystem.ChunkSize + relativeTile) * _grid.TileSize; + var relativeTile = GetTileFromIndex(chunkIdx); + var tile = (chunk.Origin * ChunkSize + relativeTile) * _grid.TileSize; tile = tile with { Y = -tile.Y }; PowerCableChunk neighborChunk; @@ -212,39 +222,39 @@ public sealed partial class PowerMonitoringConsoleNavMapControl : NavMapControl // Note: we only check the north and east neighbors // East - if (relativeTile.X == SharedNavMapSystem.ChunkSize - 1) + if (relativeTile.X == ChunkSize - 1) { neighbor = chunks.TryGetValue(chunkOrigin + new Vector2i(1, 0), out neighborChunk) && - (neighborChunk.PowerCableData[cableIdx] & SharedNavMapSystem.GetFlag(new Vector2i(0, relativeTile.Y))) != 0x0; + (neighborChunk.PowerCableData[cableIdx] & GetFlag(new Vector2i(0, relativeTile.Y))) != 0x0; } else { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(1, 0)); + var flag = GetFlag(relativeTile + new Vector2i(1, 0)); neighbor = (chunkMask & flag) != 0x0; } if (neighbor) { // Add points - AddOrUpdateNavMapLine(tile, tile + new Vector2i(_grid.TileSize, 0), HorizLinesLookup, HorizLinesLookupReversed, cableIdx); + AddOrUpdateNavMapLine(tile, tile + new Vector2i(_grid.TileSize, 0), horizLines, horizLinesReversed); } // North - if (relativeTile.Y == SharedNavMapSystem.ChunkSize - 1) + if (relativeTile.Y == ChunkSize - 1) { neighbor = chunks.TryGetValue(chunkOrigin + new Vector2i(0, 1), out neighborChunk) && - (neighborChunk.PowerCableData[cableIdx] & SharedNavMapSystem.GetFlag(new Vector2i(relativeTile.X, 0))) != 0x0; + (neighborChunk.PowerCableData[cableIdx] & GetFlag(new Vector2i(relativeTile.X, 0))) != 0x0; } else { - var flag = SharedNavMapSystem.GetFlag(relativeTile + new Vector2i(0, 1)); + var flag = GetFlag(relativeTile + new Vector2i(0, 1)); neighbor = (chunkMask & flag) != 0x0; } if (neighbor) { // Add points - AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), tile, VertLinesLookup, VertLinesLookupReversed, cableIdx); + AddOrUpdateNavMapLine(tile + new Vector2i(0, -_grid.TileSize), tile, vertLines, vertLinesReversed); } } @@ -253,11 +263,25 @@ public sealed partial class PowerMonitoringConsoleNavMapControl : NavMapControl var gridOffset = new Vector2(_grid.TileSize * 0.5f, -_grid.TileSize * 0.5f); - foreach (var (origin, terminal) in HorizLinesLookup) - decodedOutput.Add(new PowerMonitoringConsoleLine(origin.Item2 + gridOffset, terminal.Item2 + gridOffset, (PowerMonitoringConsoleLineGroup) origin.Item1)); + for (var index = 0; index < _horizLines.Length; index++) + { + var horizLines = _horizLines[index]; + foreach (var (origin, terminal) in horizLines) + { + decodedOutput.Add(new PowerMonitoringConsoleLine(origin + gridOffset, terminal + gridOffset, + (PowerMonitoringConsoleLineGroup) index)); + } + } - foreach (var (origin, terminal) in VertLinesLookup) - decodedOutput.Add(new PowerMonitoringConsoleLine(origin.Item2 + gridOffset, terminal.Item2 + gridOffset, (PowerMonitoringConsoleLineGroup) origin.Item1)); + for (var index = 0; index < _vertLines.Length; index++) + { + var vertLines = _vertLines[index]; + foreach (var (origin, terminal) in vertLines) + { + decodedOutput.Add(new PowerMonitoringConsoleLine(origin + gridOffset, terminal + gridOffset, + (PowerMonitoringConsoleLineGroup) index)); + } + } return decodedOutput; } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index 70b7608f6d..dad20a641f 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -742,7 +742,6 @@ namespace Content.Client.Preferences.UI CharacterSlot = _preferencesManager.Preferences.SelectedCharacterIndex; UpdateAntagRequirements(); - UpdateRoleRequirements(); UpdateControls(); ShowClothes.Pressed = true; } diff --git a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml index 86fd09b2c8..32cab732d1 100644 --- a/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml +++ b/Content.Client/UserInterface/Systems/Ghost/Controls/GhostTargetWindow.xaml @@ -1,5 +1,6 @@ +