Resolve 'EntitySystem.Get<T>()' is obsolete in content (#27936)

* PROJECT 0 WARNINGS: Resolve `'EntitySystem.Get<T>()' is obsolete` in content

* pass entman

* dog ass test

* webeditor
This commit is contained in:
Kara
2024-05-12 17:34:52 -07:00
committed by GitHub
parent efc430f651
commit 993eef1e7c
65 changed files with 186 additions and 110 deletions

View File

@@ -5,11 +5,13 @@ namespace Content.Client.Decals;
public sealed class ToggleDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;
public string Command => "toggledecals";
public string Description => "Toggles decaloverlay";
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
EntitySystem.Get<DecalSystem>().ToggleOverlay();
_e.System<DecalSystem>().ToggleOverlay();
}
}

View File

@@ -16,6 +16,7 @@ namespace Content.Client.Decals.UI;
public sealed partial class DecalPlacerWindow : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IEntityManager _e = default!;
private readonly DecalPlacementSystem _decalPlacementSystem;
@@ -39,7 +40,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_decalPlacementSystem = EntitySystem.Get<DecalPlacementSystem>();
_decalPlacementSystem = _e.System<DecalPlacementSystem>();
// This needs to be done in C# so we can have custom stuff passed in the constructor
// and thus have a proper step size

View File

@@ -139,11 +139,13 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
public sealed class ClearAllNetworkLinkOverlays : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;
public string Command => "clearnetworklinkoverlays";
public string Description => "Clear all network link overlays.";
public string Help => Command;
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
IoCManager.Resolve<IEntityManager>().System<NetworkConfiguratorSystem>().ClearAllOverlays();
_e.System<NetworkConfiguratorSystem>().ClearAllOverlays();
}
}

View File

@@ -8,6 +8,8 @@ namespace Content.Client.NodeContainer
{
public sealed class NodeVisCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;
public string Command => "nodevis";
public string Description => "Toggles node group visualization";
public string Help => "";
@@ -21,20 +23,22 @@ namespace Content.Client.NodeContainer
return;
}
var sys = EntitySystem.Get<NodeGroupSystem>();
var sys = _e.System<NodeGroupSystem>();
sys.SetVisEnabled(!sys.VisEnabled);
}
}
public sealed class NodeVisFilterCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;
public string Command => "nodevisfilter";
public string Description => "Toggles showing a specific group on nodevis";
public string Help => "Usage: nodevis [filter]\nOmit filter to list currently masked-off";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var sys = EntitySystem.Get<NodeGroupSystem>();
var sys = _e.System<NodeGroupSystem>();
if (args.Length == 0)
{