2021-11-11 16:10:57 -07:00
|
|
|
|
using Content.Shared.Body.Components;
|
2020-10-26 12:11:32 +01:00
|
|
|
|
using Robust.Client.Console;
|
|
|
|
|
|
using Robust.Client.GameObjects;
|
2021-02-01 16:49:43 -08:00
|
|
|
|
using Robust.Shared.Console;
|
2021-02-11 01:13:03 -08:00
|
|
|
|
using Robust.Shared.GameObjects;
|
2020-10-26 12:11:32 +01:00
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Commands
|
|
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class ShowMechanismsCommand : IConsoleCommand
|
2020-10-26 12:11:32 +01:00
|
|
|
|
{
|
|
|
|
|
|
public const string CommandName = "showmechanisms";
|
|
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once StringLiteralTypo
|
|
|
|
|
|
public string Command => CommandName;
|
|
|
|
|
|
public string Description => "Makes mechanisms visible, even when they shouldn't be.";
|
|
|
|
|
|
public string Help => $"{Command}";
|
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-10-26 12:11:32 +01:00
|
|
|
|
{
|
2021-09-28 13:35:29 +02:00
|
|
|
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
2022-01-04 02:17:39 -07:00
|
|
|
|
var mechanisms = entityManager.EntityQuery<MechanismComponent>(true);
|
2020-10-26 12:11:32 +01:00
|
|
|
|
|
|
|
|
|
|
foreach (var mechanism in mechanisms)
|
|
|
|
|
|
{
|
2021-12-08 12:09:43 +01:00
|
|
|
|
if (entityManager.TryGetComponent(mechanism.Owner, out SpriteComponent? sprite))
|
2020-10-26 12:11:32 +01:00
|
|
|
|
{
|
|
|
|
|
|
sprite.ContainerOccluded = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
|
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand("showcontainedcontext");
|
2020-10-26 12:11:32 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|