Remove Explicit GridId References (#8315)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
internal sealed class AtmosDebugOverlaySystem : SharedAtmosDebugOverlaySystem
|
||||
{
|
||||
|
||||
private readonly Dictionary<GridId, AtmosDebugOverlayMessage> _tileData =
|
||||
private readonly Dictionary<EntityUid, AtmosDebugOverlayMessage> _tileData =
|
||||
new();
|
||||
|
||||
// Configuration set by debug commands and used by AtmosDebugOverlay {
|
||||
@@ -77,12 +77,12 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
_tileData.Clear();
|
||||
}
|
||||
|
||||
public bool HasData(GridId gridId)
|
||||
public bool HasData(EntityUid gridId)
|
||||
{
|
||||
return _tileData.ContainsKey(gridId);
|
||||
}
|
||||
|
||||
public AtmosDebugOverlayData? GetData(GridId gridIndex, Vector2i indices)
|
||||
public AtmosDebugOverlayData? GetData(EntityUid gridIndex, Vector2i indices)
|
||||
{
|
||||
if (!_tileData.TryGetValue(gridIndex, out var srcMsg))
|
||||
return null;
|
||||
|
||||
@@ -5,7 +5,6 @@ using JetBrains.Annotations;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Atmos.EntitySystems
|
||||
@@ -31,7 +30,7 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
public readonly int[] FireFrameCounter = new int[FireStates];
|
||||
public readonly Texture[][] FireFrames = new Texture[FireStates][];
|
||||
|
||||
private readonly Dictionary<GridId, Dictionary<Vector2i, GasOverlayChunk>> _tileData =
|
||||
private readonly Dictionary<EntityUid, Dictionary<Vector2i, GasOverlayChunk>> _tileData =
|
||||
new();
|
||||
|
||||
public const int GasOverlayZIndex = 1;
|
||||
@@ -95,7 +94,7 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
}
|
||||
|
||||
// Slightly different to the server-side system version
|
||||
private GasOverlayChunk GetOrCreateChunk(GridId gridId, Vector2i indices)
|
||||
private GasOverlayChunk GetOrCreateChunk(EntityUid gridId, Vector2i indices)
|
||||
{
|
||||
if (!_tileData.TryGetValue(gridId, out var chunks))
|
||||
{
|
||||
@@ -130,12 +129,12 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasData(GridId gridId)
|
||||
public bool HasData(EntityUid gridId)
|
||||
{
|
||||
return _tileData.ContainsKey(gridId);
|
||||
}
|
||||
|
||||
public GasOverlayEnumerator GetOverlays(GridId gridIndex, Vector2i indices)
|
||||
public GasOverlayEnumerator GetOverlays(EntityUid gridIndex, Vector2i indices)
|
||||
{
|
||||
if (!_tileData.TryGetValue(gridIndex, out var chunks))
|
||||
return default;
|
||||
@@ -149,7 +148,7 @@ namespace Content.Client.Atmos.EntitySystems
|
||||
return new GasOverlayEnumerator(overlays, this);
|
||||
}
|
||||
|
||||
public FireOverlayEnumerator GetFireOverlays(GridId gridIndex, Vector2i indices)
|
||||
public FireOverlayEnumerator GetFireOverlays(EntityUid gridIndex, Vector2i indices)
|
||||
{
|
||||
if (!_tileData.TryGetValue(gridIndex, out var chunks))
|
||||
return default;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Client.Atmos.EntitySystems;
|
||||
using Content.Client.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.EntitySystems;
|
||||
using Robust.Client.Graphics;
|
||||
@@ -41,7 +41,7 @@ namespace Content.Client.Atmos.Overlays
|
||||
|
||||
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
|
||||
{
|
||||
if (!_atmosDebugOverlaySystem.HasData(mapGrid.Index))
|
||||
if (!_atmosDebugOverlaySystem.HasData(mapGrid.GridEntityId))
|
||||
continue;
|
||||
|
||||
drawHandle.SetTransform(mapGrid.WorldMatrix);
|
||||
@@ -50,7 +50,7 @@ namespace Content.Client.Atmos.Overlays
|
||||
{
|
||||
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
|
||||
{
|
||||
var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Index, tile.GridIndices);
|
||||
var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.GridEntityId, tile.GridIndices);
|
||||
if (dataMaybeNull != null)
|
||||
{
|
||||
var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull!;
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace Content.Client.Atmos.Overlays
|
||||
|
||||
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
|
||||
{
|
||||
if (!_gasTileOverlaySystem.HasData(mapGrid.Index))
|
||||
if (!_gasTileOverlaySystem.HasData(mapGrid.GridEntityId))
|
||||
continue;
|
||||
|
||||
drawHandle.SetTransform(mapGrid.WorldMatrix);
|
||||
|
||||
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
|
||||
{
|
||||
var enumerator = _gasTileOverlaySystem.GetFireOverlays(mapGrid.Index, tile.GridIndices);
|
||||
var enumerator = _gasTileOverlaySystem.GetFireOverlays(mapGrid.GridEntityId, tile.GridIndices);
|
||||
while (enumerator.MoveNext(out var tuple))
|
||||
{
|
||||
drawHandle.DrawTexture(tuple.Texture, new Vector2(tile.X, tile.Y), tuple.Color);
|
||||
|
||||
@@ -35,14 +35,14 @@ namespace Content.Client.Atmos.Overlays
|
||||
|
||||
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
|
||||
{
|
||||
if (!_gasTileOverlaySystem.HasData(mapGrid.Index))
|
||||
if (!_gasTileOverlaySystem.HasData(mapGrid.GridEntityId))
|
||||
continue;
|
||||
|
||||
drawHandle.SetTransform(mapGrid.WorldMatrix);
|
||||
|
||||
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
|
||||
{
|
||||
var enumerator = _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices);
|
||||
var enumerator = _gasTileOverlaySystem.GetOverlays(mapGrid.GridEntityId, tile.GridIndices);
|
||||
while (enumerator.MoveNext(out var tuple))
|
||||
{
|
||||
drawHandle.DrawTexture(tuple.Texture, new Vector2(tile.X, tile.Y), tuple.Color);
|
||||
|
||||
Reference in New Issue
Block a user