2021-03-03 06:56:52 +00:00
|
|
|
using Content.Shared.Input;
|
2019-04-15 21:11:38 -06:00
|
|
|
using Robust.Shared.Input;
|
2018-08-16 15:57:11 -07:00
|
|
|
|
|
|
|
|
namespace Content.Client.Input
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2018-09-20 18:19:04 +02:00
|
|
|
/// Contains a helper function for setting up all content
|
2018-08-16 15:57:11 -07:00
|
|
|
/// contexts, and modifying existing engine ones.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ContentContexts
|
|
|
|
|
{
|
|
|
|
|
public static void SetupContexts(IInputContextContainer contexts)
|
|
|
|
|
{
|
2019-04-13 09:45:09 +02:00
|
|
|
var common = contexts.GetContext("common");
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.FocusChat);
|
2021-04-20 18:39:39 -05:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusLocalChat);
|
2022-01-11 06:48:18 -08:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusWhisperChat);
|
2021-04-20 18:39:39 -05:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusRadio);
|
2020-07-06 08:45:58 -05:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusOOC);
|
2020-07-08 05:18:16 -05:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusAdminChat);
|
2021-07-20 10:29:09 +02:00
|
|
|
common.AddFunction(ContentKeyFunctions.FocusConsoleChat);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.FocusDeadChat);
|
2021-04-20 18:39:39 -05:00
|
|
|
common.AddFunction(ContentKeyFunctions.CycleChatChannelForward);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.CycleChatChannelBackward);
|
2019-05-16 14:41:43 -07:00
|
|
|
common.AddFunction(ContentKeyFunctions.ExamineEntity);
|
2021-03-03 06:56:52 +00:00
|
|
|
common.AddFunction(ContentKeyFunctions.OpenInfo);
|
2020-04-30 12:45:21 +02:00
|
|
|
common.AddFunction(ContentKeyFunctions.TakeScreenshot);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.TakeScreenshotNoUI);
|
2020-08-16 20:54:33 +02:00
|
|
|
common.AddFunction(ContentKeyFunctions.Point);
|
2021-10-05 14:29:03 +11:00
|
|
|
common.AddFunction(ContentKeyFunctions.OpenContextMenu);
|
2019-04-13 09:45:09 +02:00
|
|
|
|
2018-08-16 15:57:11 -07:00
|
|
|
var human = contexts.GetContext("human");
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.SwapHands);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.Drop);
|
2022-03-17 20:13:31 +13:00
|
|
|
human.AddFunction(ContentKeyFunctions.UseItemInHand);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.AltUseItemInHand);
|
2018-08-16 15:57:11 -07:00
|
|
|
human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
|
2018-08-22 01:19:47 -07:00
|
|
|
human.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
|
2021-08-22 03:20:18 +10:00
|
|
|
human.AddFunction(ContentKeyFunctions.AltActivateItemInWorld);
|
2020-07-27 00:54:32 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.TryPullObject);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.MovePulledObject);
|
2020-09-16 14:58:50 -07:00
|
|
|
human.AddFunction(ContentKeyFunctions.ReleasePulledObject);
|
2019-07-17 21:37:58 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.OpenCraftingMenu);
|
2019-07-20 13:11:42 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.OpenInventoryMenu);
|
2020-05-05 00:39:15 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.SmartEquipBackpack);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.SmartEquipBelt);
|
2019-08-04 16:03:51 -07:00
|
|
|
human.AddFunction(ContentKeyFunctions.MouseMiddle);
|
2020-05-03 14:26:49 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.WideAttack);
|
2020-09-26 15:25:22 +02:00
|
|
|
human.AddFunction(ContentKeyFunctions.ArcadeUp);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.ArcadeDown);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.ArcadeLeft);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.ArcadeRight);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.Arcade1);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.Arcade2);
|
|
|
|
|
human.AddFunction(ContentKeyFunctions.Arcade3);
|
2021-02-26 04:31:06 +03:00
|
|
|
|
|
|
|
|
// actions should be common (for ghosts, mobs, etc)
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar0);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar1);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar2);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar3);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar4);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar5);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar6);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar7);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar8);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Hotbar9);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout1);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout2);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout3);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout4);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout5);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout6);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout7);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout8);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.Loadout9);
|
2018-09-20 18:19:04 +02:00
|
|
|
|
2021-08-22 20:14:52 -07:00
|
|
|
var aghost = contexts.New("aghost", "common");
|
|
|
|
|
aghost.AddFunction(EngineKeyFunctions.MoveUp);
|
|
|
|
|
aghost.AddFunction(EngineKeyFunctions.MoveDown);
|
|
|
|
|
aghost.AddFunction(EngineKeyFunctions.MoveLeft);
|
|
|
|
|
aghost.AddFunction(EngineKeyFunctions.MoveRight);
|
|
|
|
|
aghost.AddFunction(EngineKeyFunctions.Walk);
|
|
|
|
|
aghost.AddFunction(ContentKeyFunctions.SwapHands);
|
|
|
|
|
aghost.AddFunction(ContentKeyFunctions.Drop);
|
|
|
|
|
aghost.AddFunction(ContentKeyFunctions.ThrowItemInHand);
|
|
|
|
|
|
2018-09-20 18:19:04 +02:00
|
|
|
var ghost = contexts.New("ghost", "common");
|
|
|
|
|
ghost.AddFunction(EngineKeyFunctions.MoveUp);
|
|
|
|
|
ghost.AddFunction(EngineKeyFunctions.MoveDown);
|
|
|
|
|
ghost.AddFunction(EngineKeyFunctions.MoveLeft);
|
|
|
|
|
ghost.AddFunction(EngineKeyFunctions.MoveRight);
|
2020-06-19 15:15:25 +02:00
|
|
|
ghost.AddFunction(EngineKeyFunctions.Walk);
|
2020-02-02 16:38:51 -05:00
|
|
|
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.OpenEntitySpawnWindow);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.OpenSandboxWindow);
|
|
|
|
|
common.AddFunction(ContentKeyFunctions.OpenTileSpawnWindow);
|
2022-02-08 13:54:41 -07:00
|
|
|
common.AddFunction(ContentKeyFunctions.OpenDecalSpawnWindow);
|
2020-08-25 17:18:32 +02:00
|
|
|
common.AddFunction(ContentKeyFunctions.OpenAdminMenu);
|
2018-08-16 15:57:11 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|