ContentContexts.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using Content.Shared.Input;
  2. using Robust.Shared.Input;
  3. namespace Content.Client.Input
  4. {
  5. /// <summary>
  6. /// Contains a helper function for setting up all content
  7. /// contexts, and modifying existing engine ones.
  8. /// </summary>
  9. public static class ContentContexts
  10. {
  11. public static void SetupContexts(IInputContextContainer contexts)
  12. {
  13. var common = contexts.GetContext("common");
  14. common.AddFunction(ContentKeyFunctions.FocusChat);
  15. common.AddFunction(ContentKeyFunctions.FocusLocalChat);
  16. common.AddFunction(ContentKeyFunctions.FocusEmote);
  17. common.AddFunction(ContentKeyFunctions.FocusWhisperChat);
  18. common.AddFunction(ContentKeyFunctions.FocusRadio);
  19. common.AddFunction(ContentKeyFunctions.FocusLOOC);
  20. common.AddFunction(ContentKeyFunctions.FocusOOC);
  21. common.AddFunction(ContentKeyFunctions.FocusAdminChat);
  22. common.AddFunction(ContentKeyFunctions.FocusConsoleChat);
  23. common.AddFunction(ContentKeyFunctions.FocusDeadChat);
  24. common.AddFunction(ContentKeyFunctions.CycleChatChannelForward);
  25. common.AddFunction(ContentKeyFunctions.CycleChatChannelBackward);
  26. common.AddFunction(ContentKeyFunctions.EscapeContext);
  27. common.AddFunction(ContentKeyFunctions.ExamineEntity);
  28. common.AddFunction(ContentKeyFunctions.OpenAHelp);
  29. common.AddFunction(ContentKeyFunctions.TakeScreenshot);
  30. common.AddFunction(ContentKeyFunctions.TakeScreenshotNoUI);
  31. common.AddFunction(ContentKeyFunctions.ToggleFullscreen);
  32. common.AddFunction(ContentKeyFunctions.MoveStoredItem);
  33. common.AddFunction(ContentKeyFunctions.RotateStoredItem);
  34. common.AddFunction(ContentKeyFunctions.SaveItemLocation);
  35. common.AddFunction(ContentKeyFunctions.Point);
  36. common.AddFunction(ContentKeyFunctions.ZoomOut);
  37. common.AddFunction(ContentKeyFunctions.ZoomIn);
  38. common.AddFunction(ContentKeyFunctions.ResetZoom);
  39. common.AddFunction(ContentKeyFunctions.InspectEntity);
  40. common.AddFunction(ContentKeyFunctions.ToggleRoundEndSummaryWindow);
  41. // Not in engine, because engine cannot check for sanbox/admin status before starting placement.
  42. common.AddFunction(ContentKeyFunctions.EditorCopyObject);
  43. // Not in engine because the engine doesn't understand what a flipped object is
  44. common.AddFunction(ContentKeyFunctions.EditorFlipObject);
  45. // Not in engine so that the RCD can rotate objects
  46. common.AddFunction(EngineKeyFunctions.EditorRotateObject);
  47. var human = contexts.GetContext("human");
  48. human.AddFunction(EngineKeyFunctions.MoveUp);
  49. human.AddFunction(EngineKeyFunctions.MoveDown);
  50. human.AddFunction(EngineKeyFunctions.MoveLeft);
  51. human.AddFunction(EngineKeyFunctions.MoveRight);
  52. human.AddFunction(EngineKeyFunctions.Walk);
  53. human.AddFunction(ContentKeyFunctions.SwapHands);
  54. human.AddFunction(ContentKeyFunctions.Drop);
  55. human.AddFunction(ContentKeyFunctions.UseItemInHand);
  56. human.AddFunction(ContentKeyFunctions.AltUseItemInHand);
  57. human.AddFunction(ContentKeyFunctions.OpenCharacterMenu);
  58. human.AddFunction(ContentKeyFunctions.OpenEmotesMenu);
  59. human.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
  60. human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
  61. human.AddFunction(ContentKeyFunctions.AltActivateItemInWorld);
  62. human.AddFunction(ContentKeyFunctions.TryPullObject);
  63. human.AddFunction(ContentKeyFunctions.MovePulledObject);
  64. human.AddFunction(ContentKeyFunctions.ReleasePulledObject);
  65. human.AddFunction(ContentKeyFunctions.OpenCraftingMenu);
  66. human.AddFunction(ContentKeyFunctions.OpenInventoryMenu);
  67. human.AddFunction(ContentKeyFunctions.SmartEquipBackpack);
  68. human.AddFunction(ContentKeyFunctions.SmartEquipBelt);
  69. human.AddFunction(ContentKeyFunctions.OpenBackpack);
  70. human.AddFunction(ContentKeyFunctions.OpenBelt);
  71. human.AddFunction(ContentKeyFunctions.MouseMiddle);
  72. human.AddFunction(ContentKeyFunctions.RotateObjectClockwise);
  73. human.AddFunction(ContentKeyFunctions.RotateObjectCounterclockwise);
  74. human.AddFunction(ContentKeyFunctions.FlipObject);
  75. human.AddFunction(ContentKeyFunctions.ArcadeUp);
  76. human.AddFunction(ContentKeyFunctions.ArcadeDown);
  77. human.AddFunction(ContentKeyFunctions.ArcadeLeft);
  78. human.AddFunction(ContentKeyFunctions.ArcadeRight);
  79. human.AddFunction(ContentKeyFunctions.Arcade1);
  80. human.AddFunction(ContentKeyFunctions.Arcade2);
  81. human.AddFunction(ContentKeyFunctions.Arcade3);
  82. // Shitmed Change Start - TODO: Add hands, feet and groin targeting.
  83. human.AddFunction(ContentKeyFunctions.TargetHead);
  84. human.AddFunction(ContentKeyFunctions.TargetTorso);
  85. human.AddFunction(ContentKeyFunctions.TargetLeftArm);
  86. human.AddFunction(ContentKeyFunctions.TargetLeftHand);
  87. human.AddFunction(ContentKeyFunctions.TargetRightArm);
  88. human.AddFunction(ContentKeyFunctions.TargetRightHand);
  89. human.AddFunction(ContentKeyFunctions.TargetLeftLeg);
  90. human.AddFunction(ContentKeyFunctions.TargetLeftFoot);
  91. human.AddFunction(ContentKeyFunctions.TargetRightLeg);
  92. human.AddFunction(ContentKeyFunctions.TargetRightFoot);
  93. // Shitmed Change End
  94. human.AddFunction(ContentKeyFunctions.Lay); // Stalker-Changes-UI
  95. // actions should be common (for ghosts, mobs, etc)
  96. common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
  97. foreach (var boundKey in ContentKeyFunctions.GetHotbarBoundKeys())
  98. {
  99. common.AddFunction(boundKey);
  100. }
  101. var aghost = contexts.New("aghost", "common");
  102. aghost.AddFunction(EngineKeyFunctions.MoveUp);
  103. aghost.AddFunction(EngineKeyFunctions.MoveDown);
  104. aghost.AddFunction(EngineKeyFunctions.MoveLeft);
  105. aghost.AddFunction(EngineKeyFunctions.MoveRight);
  106. aghost.AddFunction(EngineKeyFunctions.Walk);
  107. aghost.AddFunction(ContentKeyFunctions.SwapHands);
  108. aghost.AddFunction(ContentKeyFunctions.Drop);
  109. aghost.AddFunction(ContentKeyFunctions.UseItemInHand);
  110. aghost.AddFunction(ContentKeyFunctions.AltUseItemInHand);
  111. aghost.AddFunction(ContentKeyFunctions.ActivateItemInWorld);
  112. aghost.AddFunction(ContentKeyFunctions.ThrowItemInHand);
  113. aghost.AddFunction(ContentKeyFunctions.AltActivateItemInWorld);
  114. aghost.AddFunction(ContentKeyFunctions.TryPullObject);
  115. aghost.AddFunction(ContentKeyFunctions.MovePulledObject);
  116. aghost.AddFunction(ContentKeyFunctions.ReleasePulledObject);
  117. var ghost = contexts.New("ghost", "human");
  118. ghost.AddFunction(EngineKeyFunctions.MoveUp);
  119. ghost.AddFunction(EngineKeyFunctions.MoveDown);
  120. ghost.AddFunction(EngineKeyFunctions.MoveLeft);
  121. ghost.AddFunction(EngineKeyFunctions.MoveRight);
  122. ghost.AddFunction(EngineKeyFunctions.Walk);
  123. common.AddFunction(ContentKeyFunctions.OpenEntitySpawnWindow);
  124. common.AddFunction(ContentKeyFunctions.OpenSandboxWindow);
  125. common.AddFunction(ContentKeyFunctions.OpenTileSpawnWindow);
  126. common.AddFunction(ContentKeyFunctions.OpenDecalSpawnWindow);
  127. common.AddFunction(ContentKeyFunctions.OpenAdminMenu);
  128. common.AddFunction(ContentKeyFunctions.OpenGuidebook);
  129. common.AddFunction(ContentKeyFunctions.OpenFactionsMenu);
  130. }
  131. }
  132. }