Click Migration (#94)
* Migrated Interaction system to the new Input system. * Contexts are now set up in content.
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
<Compile Include="EntryPoint.cs" />
|
||||
<Compile Include="GameObjects\Components\Inventory\ClientInventoryComponent.cs" />
|
||||
<Compile Include="GameObjects\Components\Storage\ClientStorageComponent.cs" />
|
||||
<Compile Include="Input\ContentContexts.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="GameObjects\Components\Items\ClientHandsComponent.cs" />
|
||||
<Compile Include="Interfaces\GameObjects\Components\Items\IHandsComponent.cs" />
|
||||
|
||||
@@ -3,7 +3,9 @@ using Content.Client.GameObjects.Components.Construction;
|
||||
using Content.Client.GameObjects.Components.Power;
|
||||
using Content.Client.GameObjects.Components.SmoothWalling;
|
||||
using Content.Client.GameObjects.Components.Storage;
|
||||
using Content.Client.Input;
|
||||
using Content.Client.Interfaces.GameObjects;
|
||||
using SS14.Client.Interfaces.Input;
|
||||
using SS14.Shared.ContentPack;
|
||||
using SS14.Shared.Interfaces.GameObjects;
|
||||
using SS14.Shared.IoC;
|
||||
@@ -63,6 +65,16 @@ namespace Content.Client
|
||||
factory.RegisterIgnore("Smes");
|
||||
|
||||
prototypes.RegisterIgnore("material");
|
||||
|
||||
}
|
||||
|
||||
public override void PostInit()
|
||||
{
|
||||
base.PostInit();
|
||||
|
||||
// Setup key contexts
|
||||
var inputMan = IoCManager.Resolve<IInputManager>();
|
||||
ContentContexts.SetupContexts(inputMan.Contexts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
23
Content.Client/Input/ContentContexts.cs
Normal file
23
Content.Client/Input/ContentContexts.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Shared.Input;
|
||||
using SS14.Shared.Input;
|
||||
|
||||
namespace Content.Client.Input
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains a helper function for setting up all content
|
||||
/// contexts, and modifying existing engine ones.
|
||||
/// </summary>
|
||||
public static class ContentContexts
|
||||
{
|
||||
public static void SetupContexts(IInputContextContainer contexts)
|
||||
{
|
||||
var human = contexts.GetContext("human");
|
||||
human.AddFunction(ContentKeyFunctions.SwapHands);
|
||||
human.AddFunction(ContentKeyFunctions.Drop);
|
||||
human.AddFunction(ContentKeyFunctions.ActivateItemInHand);
|
||||
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
|
||||
human.AddFunction(ContentKeyFunctions.ExamineEntity);
|
||||
human.AddFunction(ContentKeyFunctions.UseItemInHand);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user