Merge remote-tracking branch 'upstream/master' into 20-10-30-admins

This commit is contained in:
Pieter-Jan Briers
2020-11-10 16:59:17 +01:00
473 changed files with 5588 additions and 3584 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Content.Server.Administration;
using Content.Server.GameObjects.Components.MachineLinking;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Shared.Administration;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
@@ -27,7 +28,7 @@ namespace Content.Server.GameObjects.EntitySystems
_transmitters = new Dictionary<NetUserId, SignalTransmitterComponent>();
}
public void SignalLinkerKeybind(NetUserId id, bool? enable)
public bool SignalLinkerKeybind(NetUserId id, bool? enable)
{
if (enable == null)
{
@@ -38,13 +39,13 @@ namespace Content.Server.GameObjects.EntitySystems
{
if (_transmitters.ContainsKey(id))
{
return;
return true;
}
if (_transmitters.Count == 0)
{
CommandBinds.Builder
.Bind(EngineKeyFunctions.Use, new PointerInputCmdHandler(HandleUse))
.BindBefore(EngineKeyFunctions.Use, new PointerInputCmdHandler(HandleUse), typeof(InteractionSystem))
.Register<SignalLinkerSystem>();
}
@@ -55,7 +56,7 @@ namespace Content.Server.GameObjects.EntitySystems
{
if (!_transmitters.ContainsKey(id))
{
return;
return false;
}
_transmitters.Remove(id);
@@ -64,6 +65,7 @@ namespace Content.Server.GameObjects.EntitySystems
CommandBinds.Unregister<SignalLinkerSystem>();
}
}
return enable == true;
}
private bool HandleUse(ICommonSession session, EntityCoordinates coords, EntityUid uid)
@@ -132,7 +134,8 @@ namespace Content.Server.GameObjects.EntitySystems
return;
}
system.SignalLinkerKeybind(player.UserId, enable);
var ret = system.SignalLinkerKeybind(player.UserId, enable);
shell.SendText(player, ret ? "Enabled" : "Disabled");
}
}
}