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

@@ -5,6 +5,7 @@ using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.IoC;
namespace Content.Client.GameObjects.EntitySystems
@@ -20,9 +21,16 @@ namespace Content.Client.GameObjects.EntitySystems
{
base.Initialize();
var inputSys = EntitySystemManager.GetEntitySystem<InputSystem>();
inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenInventoryMenu,
InputCmdHandler.FromDelegate(s => HandleOpenInventoryMenu()));
CommandBinds.Builder
.Bind(ContentKeyFunctions.OpenInventoryMenu,
InputCmdHandler.FromDelegate(s => HandleOpenInventoryMenu()))
.Register<ClientInventorySystem>();
}
public override void Shutdown()
{
CommandBinds.Unregister<ClientInventorySystem>();
base.Shutdown();
}
private void HandleOpenInventoryMenu()