Input Handling (#90)

* Migrates the Examine system to the new Input system.

* Update Engine.
This commit is contained in:
Acruid
2018-08-08 11:43:49 -07:00
committed by GitHub
parent b0a3f294c5
commit 830159390b
7 changed files with 62 additions and 49 deletions

View File

@@ -28,7 +28,7 @@ namespace Content.Client.GameObjects
private InventoryWindow Window;
private string TemplateName = "HumanInventory"; //stored for serialization purposes
private InputCommand OpenMenuCommand;
private InputCmdHandler _openMenuCmdHandler;
public override void OnRemove()
{
@@ -42,7 +42,7 @@ namespace Content.Client.GameObjects
base.ExposeData(serializer);
Window = new InventoryWindow(this);
OpenMenuCommand = InputCommand.FromDelegate(() => { Window.AddToScreen(); Window.Open(); });
_openMenuCmdHandler = InputCmdHandler.FromDelegate(session => { Window.AddToScreen(); Window.Open(); });
serializer.DataField(ref TemplateName, "Template", "HumanInventory");
Window.CreateInventory(TemplateName);
}
@@ -65,7 +65,7 @@ namespace Content.Client.GameObjects
break;
case PlayerAttachedMsg _:
inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, OpenMenuCommand);
inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, _openMenuCmdHandler);
break;
case PlayerDetachedMsg _: