Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override void OnUpdate(float timeslice)
- {
- InventoryMenu inventoryOpen = InventoryMenu.Cast( GetUIManager().FindMenu(MENU_INVENTORY) );
- Input input = GetGame().GetInput();
- PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
- if (m_IsOpen && inventoryOpen)
- {
- GetGame().GetInput().DisableAction(UAGestureSlot01);
- GetGame().GetInput().DisableAction(UAGestureSlot02);
- GetGame().GetInput().DisableAction(UAGestureSlot03);
- GetGame().GetInput().DisableAction(UAGestureSlot04);
- GetGame().GetInput().DisableAction(UAGestureSlot05);
- GetGame().GetInput().DisableAction(UAGestureSlot06);
- GetGame().GetInput().DisableAction(UAGestureSlot07);
- GetGame().GetInput().DisableAction(UAGestureSlot08);
- GetGame().GetInput().DisableAction(UAGestureSlot09);
- GetGame().GetInput().DisableAction(UAGestureSlot10);
- GetGame().GetInput().DisableAction(UAUIGesturesOpen);
- GetGame().GetInput().DisableAction(UAHeavyMeleeAttack);
- if(KeyState(KeyCode.KC_TAB) > 0)
- {
- ClearKey(KeyCode.KC_TAB);
- if (firstPress)
- {
- firstPress = false;
- } else {
- HideInventory();
- GetUApi().ActivateGroup("infantry");
- m_IsOpen = false;
- fuckyou = true;
- }
- } else {
- firstPress = false;
- }
- if(KeyState(KeyCode.KC_ESCAPE) > 0)
- {
- ClearKey(KeyCode.KC_ESCAPE);
- HideInventory();
- GetUApi().ActivateGroup("infantry");
- m_IsOpen = false;
- }
- if(KeyState(KeyCode.KC_SPACE) > 0)
- {
- ClearKey(KeyCode.KC_SPACE);
- HideInventory();
- GetUApi().ActivateGroup("infantry");
- m_IsOpen = false;
- }
- } else {
- if( input.GetActionDown("UAGear", false ) )
- {
- firstPress = true;
- } else {
- firstPress = false;
- fuckyou = false;
- }
- }
- if (player.m_IsFalling)
- {
- HideInventory();
- GetUApi().ActivateGroup("infantry");
- m_IsOpen = false;
- }
- if (player.IsUnconscious() && m_IsOpen)
- {
- PlayerControlEnable();
- GetUApi().ActivateGroup("infantry");
- m_IsOpen = false;
- }
- super.OnUpdate(timeslice);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement