Use new command binding system supporting multiple bindings (#1043)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
chairbender
2020-05-31 14:32:05 -07:00
committed by GitHub
parent f14701033b
commit 12f3b6bb7b
10 changed files with 102 additions and 62 deletions

View File

@@ -24,6 +24,7 @@ using Robust.Client.Utility;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
@@ -65,9 +66,16 @@ namespace Content.Client.GameObjects.EntitySystems
IoCManager.InjectDependencies(this);
var input = EntitySystemManager.GetEntitySystem<InputSystem>();
input.BindMap.BindFunction(ContentKeyFunctions.OpenContextMenu,
new PointerInputCmdHandler(OnOpenContextMenu));
CommandBinds.Builder
.Bind(ContentKeyFunctions.OpenContextMenu,
new PointerInputCmdHandler(OnOpenContextMenu))
.Register<VerbSystem>();
}
public override void Shutdown()
{
CommandBinds.Unregister<VerbSystem>();
base.Shutdown();
}
public void OpenContextMenu(IEntity entity, ScreenCoordinates screenCoordinates)