Fix griddrag and tethergun (#10510)

This commit is contained in:
metalgearsloth
2022-09-01 13:11:45 +10:00
committed by GitHub
parent a44c5a447e
commit a0f2e7ac92
9 changed files with 126 additions and 18 deletions

View File

@@ -1,21 +0,0 @@
using Content.Client.Weapons.Ranged.Systems;
using Robust.Shared.Console;
namespace Content.Client.Weapons.Ranged;
public sealed class TetherGunCommand : IConsoleCommand
{
public string Command => "tethergun";
public string Description => "Allows you to drag mobs around with your mouse.";
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var system = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<TetherGunSystem>();
system.Enabled ^= true;
if (system.Enabled)
shell.WriteLine("Tether gun toggled on");
else
shell.WriteLine("Tether gun toggled off");
}
}

View File

@@ -31,6 +31,12 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
{
base.Initialize();
SubscribeNetworkEvent<PredictTetherEvent>(OnPredictTether);
SubscribeNetworkEvent<TetherGunToggleMessage>(OnTetherGun);
}
private void OnTetherGun(TetherGunToggleMessage ev)
{
Enabled = ev.Enabled;
}
private void OnPredictTether(PredictTetherEvent ev)