Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. override void OnUpdate(float timeslice)
  2. {
  3. InventoryMenu inventoryOpen = InventoryMenu.Cast( GetUIManager().FindMenu(MENU_INVENTORY) );
  4. Input input = GetGame().GetInput();
  5. PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
  6. if (m_IsOpen && inventoryOpen)
  7. {
  8. GetGame().GetInput().DisableAction(UAGestureSlot01);
  9. GetGame().GetInput().DisableAction(UAGestureSlot02);
  10. GetGame().GetInput().DisableAction(UAGestureSlot03);
  11. GetGame().GetInput().DisableAction(UAGestureSlot04);
  12. GetGame().GetInput().DisableAction(UAGestureSlot05);
  13. GetGame().GetInput().DisableAction(UAGestureSlot06);
  14. GetGame().GetInput().DisableAction(UAGestureSlot07);
  15. GetGame().GetInput().DisableAction(UAGestureSlot08);
  16. GetGame().GetInput().DisableAction(UAGestureSlot09);
  17. GetGame().GetInput().DisableAction(UAGestureSlot10);
  18. GetGame().GetInput().DisableAction(UAUIGesturesOpen);
  19. GetGame().GetInput().DisableAction(UAHeavyMeleeAttack);
  20.  
  21. if(KeyState(KeyCode.KC_TAB) > 0)
  22. {
  23. ClearKey(KeyCode.KC_TAB);
  24. if (firstPress)
  25. {
  26. firstPress = false;
  27. } else {
  28. HideInventory();
  29. GetUApi().ActivateGroup("infantry");
  30. m_IsOpen = false;
  31. fuckyou = true;
  32. }
  33. } else {
  34. firstPress = false;
  35. }
  36. if(KeyState(KeyCode.KC_ESCAPE) > 0)
  37. {
  38. ClearKey(KeyCode.KC_ESCAPE);
  39. HideInventory();
  40. GetUApi().ActivateGroup("infantry");
  41. m_IsOpen = false;
  42. }
  43. if(KeyState(KeyCode.KC_SPACE) > 0)
  44. {
  45. ClearKey(KeyCode.KC_SPACE);
  46. HideInventory();
  47. GetUApi().ActivateGroup("infantry");
  48. m_IsOpen = false;
  49. }
  50. } else {
  51. if( input.GetActionDown("UAGear", false ) )
  52. {
  53. firstPress = true;
  54. } else {
  55. firstPress = false;
  56. fuckyou = false;
  57. }
  58. }
  59.  
  60. if (player.m_IsFalling)
  61. {
  62. HideInventory();
  63. GetUApi().ActivateGroup("infantry");
  64. m_IsOpen = false;
  65. }
  66.  
  67. if (player.IsUnconscious() && m_IsOpen)
  68. {
  69. PlayerControlEnable();
  70. GetUApi().ActivateGroup("infantry");
  71. m_IsOpen = false;
  72. }
  73. super.OnUpdate(timeslice);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement