MapManager warning cleanup client edition (#36766)

* Update ExplosionOverlaySystem.cs

* noting here that this may be reverted.

Not sure why transform sys is attached like this.

* Noting that this may be reverted.

* rapid fire spit spit spit spit spit

* last one on the client.

* Update SpawnExplosionWindow.xaml.cs

* Update ParallaxOverlay.cs

* wweeeeebbbbbbbbbbbbbbbbbbbbbbbbb edit

* requested changes.

* Update Content.Client/Shuttles/UI/ShuttleMapControl.xaml.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Shuttles/UI/ShuttleMapControl.xaml.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Parallax/ParallaxSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Parallax/ParallaxSystem.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Parallax/ParallaxOverlay.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Parallax/BiomeDebugOverlay.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Overlays/StencilOverlay.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Parallax/BiomeDebugOverlay.cs

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* Update Content.Client/Atmos/Overlays/GasTileOverlay.cs

* Update Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
This commit is contained in:
Kyle Tyo
2025-05-14 19:38:51 -04:00
committed by GitHub
parent c84d4753b9
commit e8b139e9a2
9 changed files with 31 additions and 26 deletions

View File

@@ -19,10 +19,10 @@ namespace Content.Client.Administration.UI.SpawnExplosion;
public sealed partial class SpawnExplosionWindow : DefaultWindow public sealed partial class SpawnExplosionWindow : DefaultWindow
{ {
[Dependency] private readonly IClientConsoleHost _conHost = default!; [Dependency] private readonly IClientConsoleHost _conHost = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;
private readonly SharedMapSystem _mapSystem;
private readonly SharedTransformSystem _transform = default!; private readonly SharedTransformSystem _transform = default!;
private readonly SpawnExplosionEui _eui; private readonly SpawnExplosionEui _eui;
@@ -38,6 +38,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_mapSystem = _entMan.System<SharedMapSystem>();
_transform = _entMan.System<TransformSystem>(); _transform = _entMan.System<TransformSystem>();
_eui = eui; _eui = eui;
@@ -87,7 +88,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
{ {
_mapData.Clear(); _mapData.Clear();
MapOptions.Clear(); MapOptions.Clear();
foreach (var map in _mapManager.GetAllMapIds()) foreach (var map in _mapSystem.GetAllMapIds())
{ {
_mapData.Add(map); _mapData.Add(map);
MapOptions.AddItem(map.ToString()); MapOptions.AddItem(map.ToString());

View File

@@ -14,6 +14,9 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
[UsedImplicitly] [UsedImplicitly]
public sealed partial class LoadBlueprintsWindow : DefaultWindow public sealed partial class LoadBlueprintsWindow : DefaultWindow
{ {
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
public LoadBlueprintsWindow() public LoadBlueprintsWindow()
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
@@ -21,9 +24,9 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
protected override void EnteredTree() protected override void EnteredTree()
{ {
var mapManager = IoCManager.Resolve<IMapManager>(); var mapSystem = _entityManager.System<SharedMapSystem>();
foreach (var mapId in mapManager.GetAllMapIds()) foreach (var mapId in mapSystem.GetAllMapIds())
{ {
MapOptions.AddItem(mapId.ToString(), (int) mapId); MapOptions.AddItem(mapId.ToString(), (int) mapId);
} }
@@ -39,21 +42,19 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
private void Reset() private void Reset()
{ {
var entManager = IoCManager.Resolve<IEntityManager>(); var xformSystem = _entityManager.System<SharedTransformSystem>();
var xformSystem = entManager.System<SharedTransformSystem>(); var player = _playerManager.LocalEntity;
var playerManager = IoCManager.Resolve<IPlayerManager>();
var player = playerManager.LocalEntity;
var currentMap = MapId.Nullspace; var currentMap = MapId.Nullspace;
var position = Vector2.Zero; var position = Vector2.Zero;
var rotation = Angle.Zero; var rotation = Angle.Zero;
if (entManager.TryGetComponent<TransformComponent>(player, out var xform)) if (_entityManager.TryGetComponent<TransformComponent>(player, out var xform))
{ {
currentMap = xform.MapID; currentMap = xform.MapID;
position = xformSystem.GetWorldPosition(xform); position = xformSystem.GetWorldPosition(xform);
if (entManager.TryGetComponent<TransformComponent>(xform.GridUid, out var gridXform)) if (_entityManager.TryGetComponent<TransformComponent>(xform.GridUid, out var gridXform))
{ {
rotation = xformSystem.GetWorldRotation(gridXform); rotation = xformSystem.GetWorldRotation(gridXform);
} }

View File

@@ -21,6 +21,7 @@ namespace Content.Client.Atmos.Overlays
{ {
private readonly IEntityManager _entManager; private readonly IEntityManager _entManager;
private readonly IMapManager _mapManager; private readonly IMapManager _mapManager;
private readonly SharedMapSystem _mapSystem;
private readonly SharedTransformSystem _xformSys; private readonly SharedTransformSystem _xformSys;
public override OverlaySpace Space => OverlaySpace.WorldSpaceEntities | OverlaySpace.WorldSpaceBelowWorld; public override OverlaySpace Space => OverlaySpace.WorldSpaceEntities | OverlaySpace.WorldSpaceBelowWorld;
@@ -51,6 +52,7 @@ namespace Content.Client.Atmos.Overlays
{ {
_entManager = entManager; _entManager = entManager;
_mapManager = IoCManager.Resolve<IMapManager>(); _mapManager = IoCManager.Resolve<IMapManager>();
_mapSystem = entManager.System<SharedMapSystem>();
_xformSys = xformSys; _xformSys = xformSys;
_shader = protoMan.Index<ShaderPrototype>("unshaded").Instance(); _shader = protoMan.Index<ShaderPrototype>("unshaded").Instance();
ZIndex = GasOverlayZIndex; ZIndex = GasOverlayZIndex;
@@ -163,7 +165,7 @@ namespace Content.Client.Atmos.Overlays
xformQuery, xformQuery,
_xformSys); _xformSys);
var mapUid = _mapManager.GetMapEntityId(args.MapId); var mapUid = _mapSystem.GetMapOrInvalid(args.MapId);
if (_entManager.TryGetComponent<MapAtmosphereComponent>(mapUid, out var atmos)) if (_entManager.TryGetComponent<MapAtmosphereComponent>(mapUid, out var atmos))
DrawMapOverlay(drawHandle, args, mapUid, atmos); DrawMapOverlay(drawHandle, args, mapUid, atmos);

View File

@@ -4,7 +4,6 @@ using Robust.Client.Graphics;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Graphics.RSI; using Robust.Shared.Graphics.RSI;
using Robust.Shared.Map;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Client.Explosion; namespace Content.Client.Explosion;
@@ -19,7 +18,7 @@ public sealed class ExplosionOverlaySystem : EntitySystem
[Dependency] private readonly IResourceCache _resCache = default!; [Dependency] private readonly IResourceCache _resCache = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!; [Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!; [Dependency] private readonly SharedPointLightSystem _lights = default!;
[Dependency] private readonly IMapManager _mapMan = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize() public override void Initialize()
@@ -69,7 +68,7 @@ public sealed class ExplosionOverlaySystem : EntitySystem
} }
// Map may have been deleted. // Map may have been deleted.
if (_mapMan.MapExists(component.Epicenter.MapId)) if (_mapSystem.MapExists(component.Epicenter.MapId))
{ {
// spawn in a client-side light source at the epicenter // spawn in a client-side light source at the epicenter
var lightEntity = Spawn("ExplosionLight", component.Epicenter); var lightEntity = Spawn("ExplosionLight", component.Epicenter);

View File

@@ -48,7 +48,7 @@ public sealed partial class StencilOverlay : Overlay
protected override void Draw(in OverlayDrawArgs args) protected override void Draw(in OverlayDrawArgs args)
{ {
var mapUid = _mapManager.GetMapEntityId(args.MapId); var mapUid = _map.GetMapOrInvalid(args.MapId);
var invMatrix = args.Viewport.GetWorldToLocalMatrix(); var invMatrix = args.Viewport.GetWorldToLocalMatrix();
if (_blep?.Texture.Size != args.Viewport.Size) if (_blep?.Texture.Size != args.Viewport.Size)

View File

@@ -17,7 +17,6 @@ public sealed class BiomeDebugOverlay : Overlay
[Dependency] private readonly IEntityManager _entManager = default!; [Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!; [Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IInputManager _inputManager = default!; [Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IResourceCache _cache = default!; [Dependency] private readonly IResourceCache _cache = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefManager = default!; [Dependency] private readonly ITileDefinitionManager _tileDefManager = default!;
@@ -38,7 +37,7 @@ public sealed class BiomeDebugOverlay : Overlay
protected override bool BeforeDraw(in OverlayDrawArgs args) protected override bool BeforeDraw(in OverlayDrawArgs args)
{ {
var mapUid = _mapManager.GetMapEntityId(args.MapId); var mapUid = _maps.GetMapOrInvalid(args.MapId);
return _entManager.HasComponent<BiomeComponent>(mapUid); return _entManager.HasComponent<BiomeComponent>(mapUid);
} }
@@ -51,7 +50,7 @@ public sealed class BiomeDebugOverlay : Overlay
if (mousePos.MapId == MapId.Nullspace || mousePos.MapId != args.MapId) if (mousePos.MapId == MapId.Nullspace || mousePos.MapId != args.MapId)
return; return;
var mapUid = _mapManager.GetMapEntityId(args.MapId); var mapUid = _maps.GetMapOrInvalid(args.MapId);
if (!_entManager.TryGetComponent(mapUid, out BiomeComponent? biomeComp) || !_entManager.TryGetComponent(mapUid, out MapGridComponent? grid)) if (!_entManager.TryGetComponent(mapUid, out BiomeComponent? biomeComp) || !_entManager.TryGetComponent(mapUid, out MapGridComponent? grid))
return; return;

View File

@@ -2,6 +2,7 @@ using System.Numerics;
using Content.Client.Parallax.Managers; using Content.Client.Parallax.Managers;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Parallax.Biomes; using Content.Shared.Parallax.Biomes;
using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Enums; using Robust.Shared.Enums;
@@ -17,8 +18,8 @@ public sealed class ParallaxOverlay : Overlay
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IParallaxManager _manager = default!; [Dependency] private readonly IParallaxManager _manager = default!;
private readonly SharedMapSystem _mapSystem;
private readonly ParallaxSystem _parallax; private readonly ParallaxSystem _parallax;
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowWorld; public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowWorld;
@@ -27,12 +28,13 @@ public sealed class ParallaxOverlay : Overlay
{ {
ZIndex = ParallaxSystem.ParallaxZIndex; ZIndex = ParallaxSystem.ParallaxZIndex;
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_mapSystem = _entManager.System<SharedMapSystem>();
_parallax = _entManager.System<ParallaxSystem>(); _parallax = _entManager.System<ParallaxSystem>();
} }
protected override bool BeforeDraw(in OverlayDrawArgs args) protected override bool BeforeDraw(in OverlayDrawArgs args)
{ {
if (args.MapId == MapId.Nullspace || _entManager.HasComponent<BiomeComponent>(_mapManager.GetMapEntityId(args.MapId))) if (args.MapId == MapId.Nullspace || _entManager.HasComponent<BiomeComponent>(_mapSystem.GetMapOrInvalid(args.MapId)))
return false; return false;
return true; return true;

View File

@@ -10,9 +10,9 @@ namespace Content.Client.Parallax;
public sealed class ParallaxSystem : SharedParallaxSystem public sealed class ParallaxSystem : SharedParallaxSystem
{ {
[Dependency] private readonly IMapManager _map = default!;
[Dependency] private readonly IOverlayManager _overlay = default!; [Dependency] private readonly IOverlayManager _overlay = default!;
[Dependency] private readonly IParallaxManager _parallax = default!; [Dependency] private readonly IParallaxManager _parallax = default!;
[Dependency] private readonly SharedMapSystem _map = default!;
[ValidatePrototypeId<ParallaxPrototype>] [ValidatePrototypeId<ParallaxPrototype>]
private const string Fallback = "Default"; private const string Fallback = "Default";
@@ -58,12 +58,12 @@ public sealed class ParallaxSystem : SharedParallaxSystem
public ParallaxLayerPrepared[] GetParallaxLayers(MapId mapId) public ParallaxLayerPrepared[] GetParallaxLayers(MapId mapId)
{ {
return _parallax.GetParallaxLayers(GetParallax(_map.GetMapEntityId(mapId))); return _parallax.GetParallaxLayers(GetParallax(_map.GetMapOrInvalid(mapId)));
} }
public string GetParallax(MapId mapId) public string GetParallax(MapId mapId)
{ {
return GetParallax(_map.GetMapEntityId(mapId)); return GetParallax(_map.GetMapOrInvalid(mapId));
} }
public string GetParallax(EntityUid mapUid) public string GetParallax(EntityUid mapUid)

View File

@@ -24,7 +24,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
{ {
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IInputManager _inputs = default!; [Dependency] private readonly IInputManager _inputs = default!;
[Dependency] private readonly IMapManager _mapManager = default!; private readonly SharedMapSystem _mapSystem;
private readonly ShuttleSystem _shuttles; private readonly ShuttleSystem _shuttles;
private readonly SharedTransformSystem _xformSystem; private readonly SharedTransformSystem _xformSystem;
@@ -73,6 +73,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
public ShuttleMapControl() : base(256f, 512f, 512f) public ShuttleMapControl() : base(256f, 512f, 512f)
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
_mapSystem = EntManager.System<SharedMapSystem>();
_shuttles = EntManager.System<ShuttleSystem>(); _shuttles = EntManager.System<ShuttleSystem>();
_xformSystem = EntManager.System<SharedTransformSystem>(); _xformSystem = EntManager.System<SharedTransformSystem>();
var cache = IoCManager.Resolve<IResourceCache>(); var cache = IoCManager.Resolve<IResourceCache>();
@@ -109,7 +110,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
{ {
if (args.Function == EngineKeyFunctions.UIClick) if (args.Function == EngineKeyFunctions.UIClick)
{ {
var mapUid = _mapManager.GetMapEntityId(ViewingMap); var mapUid = _mapSystem.GetMapOrInvalid(ViewingMap);
var beaconsOnly = EntManager.TryGetComponent(mapUid, out FTLDestinationComponent? destComp) && var beaconsOnly = EntManager.TryGetComponent(mapUid, out FTLDestinationComponent? destComp) &&
destComp.BeaconsOnly; destComp.BeaconsOnly;
@@ -249,7 +250,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
DrawParallax(handle); DrawParallax(handle);
var viewedMapUid = _mapManager.GetMapEntityId(ViewingMap); var viewedMapUid = _mapSystem.GetMapOrInvalid(ViewingMap);
var matty = Matrix3Helpers.CreateInverseTransform(Offset, Angle.Zero); var matty = Matrix3Helpers.CreateInverseTransform(Offset, Angle.Zero);
var realTime = _timing.RealTime; var realTime = _timing.RealTime;
var viewBox = new Box2(Offset - WorldRangeVector, Offset + WorldRangeVector); var viewBox = new Box2(Offset - WorldRangeVector, Offset + WorldRangeVector);