Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 11.37 KB | None | 0 0
  1. /**
  2.  * ExileClient_gui_hud_event_onKeyUp
  3.  *
  4.  * Exile Mod
  5.  * www.exilemod.com
  6.  * © 2015 Exile Mod Team
  7.  *
  8.  * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
  9.  * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
  10.  */
  11.  
  12. private["_stopPropagation", "_caller", "_keyCode", "_shiftState", "_controlState", "_altState", "_posObject", "_step"];
  13. _stopPropagation = false;
  14. _caller = _this select 0;
  15. _keyCode = _this select 1;
  16. _shiftState = _this select 2;
  17. _controlState = _this select 3;
  18. _altState = _this select 4;
  19. if (_keyCode in (actionKeys "TacticalView")) exitWith {true};
  20. if (_keyCode in (actionKeys "User1") && !(_keyCode isEqualTo 0x02)) exitWith
  21. {
  22.     if !(ExileClientIsHandcuffed) then
  23.     {
  24.         call ExileClient_object_vehicle_interaction_keyLock;
  25.     };
  26.     true
  27. };
  28. if (_keyCode in (actionKeys "User2")) exitWith
  29. {
  30.     if (ExileClientAllowPartyMarkers) then
  31.     {
  32.         if !(ExileClientPartyID isEqualTo -1) then
  33.         {
  34.             if !(ExileClientIsHandcuffed) then
  35.             {
  36.                 call ExileClient_system_party_updateMyMarker;  
  37.             };
  38.         };
  39.     };
  40.     true
  41. };
  42. if (_keyCode in (actionKeys "User3")) exitWith
  43. {
  44.     ExileClientWaypoints = [];
  45.     true
  46. };
  47. switch (_keyCode) do  
  48. {
  49.     case 0x29: 
  50.     {
  51.         call ExileClient_gui_hud_toggleStatsBar;
  52.         _stopPropagation = true;
  53.     };
  54.     case 0x11,
  55.     case 0x1E,
  56.     case 0x1F,
  57.     case 0x20:
  58.     {
  59.         if (ExileClientIsAutoRunning) then
  60.         {
  61.             call ExileClient_system_autoRun_stop;
  62.             _stopPropagation = true;
  63.         };
  64.     };
  65.     case 0x0B:     
  66.     {
  67.         if !(ExileClientIsHandcuffed) then
  68.         {
  69.             if !(ExileIsPlayingRussianRoulette) then
  70.             {
  71.                 call ExileClient_system_autoRun_toggle;
  72.             };
  73.         };
  74.         _stopPropagation = true;
  75.     };
  76.     case 0x08:  
  77.     {
  78.         if (getText(missionConfigFile >> "Header" >> "gameType") isEqualTo "Escape") then
  79.         {
  80.             player playMove "Exile_Funny_Dab01";
  81.         };
  82.         _stopPropagation = true;
  83.     };
  84.     case 0x09:  { _stopPropagation = true; };
  85.     case 0x0A:  { _stopPropagation = true; };
  86.     case 0x3B:  { _stopPropagation = true; };
  87.     case 0x3C:  { _stopPropagation = true; };
  88.     case 0x3D:  { _stopPropagation = true; };
  89.     case 0x3E:  { _stopPropagation = true; };
  90.     case 0x41:  { _stopPropagation = true; };
  91.     case 0x42:  {call ZZZ24_fnc_healplayer; _stopPropagation = true; };
  92.     case 0x43:  { _stopPropagation = true; };
  93.     case 0x44:  { _stopPropagation = true; };
  94.     case 0x57:  { _stopPropagation = true; };
  95.     case 0x58:  { _stopPropagation = true; };
  96.     case 0x0E:  { _stopPropagation = true; };
  97.     case 0x02:  
  98.     {
  99.         if !(ExileClientIsHandcuffed || ExileIsPlayingRussianRoulette) then
  100.         {
  101.             if (ExileClientIsInConstructionMode) then
  102.             {
  103.                 ExileClientConstructionObject setObjectTextureGlobal [0, "#(argb,2,2,1)color(0.7,0.93,0,0.6,ca)"];
  104.                 ExileClientConstructionCurrentSnapToObject = objNull;
  105.                 ExileClientConstructionIsInSelectSnapObjectMode = false;
  106.                 ExileClientConstructionPossibleSnapPositions = [];
  107.                 ExileClientConstructionMode = 1;
  108.                 [] call ExileClient_gui_constructionMode_update;
  109.             }
  110.             else
  111.             {
  112.                 if (primaryWeapon player != "") then
  113.                 {
  114.                     if (primaryWeapon player != currentWeapon player) then
  115.                     {
  116.                         player selectWeapon (primaryWeapon player);
  117.                     };
  118.                 };
  119.             };
  120.         };
  121.         _stopPropagation = true;
  122.     };
  123.     case 0x03:  
  124.     {
  125.         if !(ExileClientIsHandcuffed || ExileIsPlayingRussianRoulette) then
  126.         {
  127.             if (ExileClientIsInConstructionMode) then
  128.             {
  129.                 ExileClientConstructionObject setObjectTextureGlobal [0, "#(argb,2,2,1)color(0.7,0.93,0,0.6,ca)"];
  130.                 ExileClientConstructionCurrentSnapToObject = objNull;
  131.                 ExileClientConstructionIsInSelectSnapObjectMode = false;
  132.                 ExileClientConstructionPossibleSnapPositions = [];
  133.                 ExileClientConstructionMode = 2;
  134.                 [] call ExileClient_gui_constructionMode_update;
  135.             }
  136.             else
  137.             {
  138.                 if (handgunWeapon player != "") then
  139.                 {
  140.                     if (handgunWeapon player != currentWeapon player) then
  141.                     {
  142.                         player selectWeapon (handgunWeapon player);
  143.                     };
  144.                 };
  145.             };
  146.         };
  147.         _stopPropagation = true;
  148.     };
  149.     case 0x04:  
  150.     {
  151.         if !(ExileClientIsHandcuffed || ExileIsPlayingRussianRoulette) then
  152.         {
  153.             if (ExileClientIsInConstructionMode) then
  154.             {
  155.                 if (ExileClientConstructionSupportSnapMode) then
  156.                 {
  157.                     if (ExileClientConstructionMode != 3) then
  158.                     {
  159.                         ExileClientConstructionCurrentSnapToObject = objNull;
  160.                         ExileClientConstructionPossibleSnapPositions = [];
  161.                         ["InfoTitleAndText", ["Snap Mode", "Look at the object you want to snap to, press SPACE to lock on it and then move your object next to a snap point. Press SPACE again to place the object."]] call ExileClient_gui_toaster_addTemplateToast;
  162.                     };
  163.                     ExileClientConstructionMode = 3;
  164.                     ExileClientConstructionIsInSelectSnapObjectMode = true;
  165.                     [] call ExileClient_gui_constructionMode_update;
  166.                 };
  167.             }
  168.             else
  169.             {
  170.                 if (secondaryWeapon player != "") then
  171.                 {
  172.                     if (secondaryWeapon player != currentWeapon player) then
  173.                     {
  174.                         player selectWeapon (secondaryWeapon player);
  175.                     };
  176.                 };
  177.             };
  178.         };
  179.         _stopPropagation = true;
  180.     };
  181.     case 0x05:  
  182.     {
  183.         if !(ExileClientIsHandcuffed || ExileIsPlayingRussianRoulette) then
  184.         {
  185.             if (ExileClientIsInConstructionMode) then
  186.             {
  187.                 if !(ExileClientConstructionKitClassName isEqualTo "Exile_Item_Flag") then
  188.                 {
  189.                     ExileClientConstructionModePhysx = !ExileClientConstructionModePhysx;
  190.                     [] call ExileClient_gui_constructionMode_update;
  191.                 };
  192.             }
  193.             else
  194.             {
  195.                 if (currentWeapon player != "") then
  196.                 {
  197.                     ExileClientPlayerHolsteredWeapon = currentWeapon player;
  198.                     player action["switchWeapon", player, player, 100];
  199.                 }
  200.                 else
  201.                 {
  202.                     if (ExileClientPlayerHolsteredWeapon != "") then
  203.                     {
  204.                         player selectWeapon ExileClientPlayerHolsteredWeapon;
  205.                     };
  206.                 };
  207.             };
  208.         };
  209.         _stopPropagation = true;
  210.     };
  211.     case 0x06:
  212.     {
  213.         if (ExileClientIsInConstructionMode) then
  214.         {
  215.             ExileClientConstructionShowHint = !ExileClientConstructionShowHint;
  216.             [] call ExileClient_gui_constructionMode_update;
  217.         }
  218.         else
  219.         {
  220.             call ExileClient_system_music_earplugs_toggle;
  221.         };
  222.         _stopPropagation = true;
  223.     };
  224.     case 0x07:
  225.     {
  226.         if (getText(missionConfigFile >> "Header" >> "gameType") isEqualTo "Escape") then
  227.         {
  228.             if (alive player) then
  229.             {
  230.                 [] call ExileClient_gui_hud_toggleEscapeStats;
  231.             }; 
  232.         }
  233.         else
  234.         {
  235.             if (ExileClientIsInConstructionMode) then
  236.             {
  237.                 if(ExileClientConstructionLock)then
  238.                 {
  239.                     ExileClientConstructionLock = false;
  240.                     _posObject = position ExileClientConstructionObject;
  241.                     ExileClientConstructionOffset = player worldToModel _posObject;
  242.                     ExileClientConstructionRotation = (getDir ExileClientConstructionObject) - (getDir player);
  243.                 }
  244.                 else
  245.                 {
  246.                     ExileClientConstructionLock = true;
  247.                 }; 
  248.             }
  249.             else
  250.             {
  251.                 if (!ExileClientXM8IsVisible) then
  252.                 {
  253.                     if ("Exile_Item_XM8" in (assignedItems player)) then
  254.                     {
  255.                         if (alive player) then
  256.                         {
  257.                             [] call ExileClient_gui_xm8_show;
  258.                         }; 
  259.                     };
  260.                 };
  261.             };
  262.         };
  263.         _stopPropagation = true;
  264.     };
  265.     case 0x39:
  266.     {
  267.         if (ExileIsPlayingRussianRoulette) then
  268.         {
  269.             if (ExileRussianRouletteCanFire) then
  270.             {
  271.                 [] spawn ExileClient_system_russianRoulette_fire;
  272.             };
  273.         }
  274.         else
  275.         {
  276.             if (ExileClientIsInConstructionMode) then
  277.             {
  278.                 if (ExileClientConstructionMode == 3) then
  279.                 {
  280.                     if (ExileClientConstructionIsInSelectSnapObjectMode) then
  281.                     {
  282.                         if !(isNull ExileClientConstructionCurrentSnapToObject) then
  283.                         {
  284.                             ExileClientConstructionIsInSelectSnapObjectMode = false;
  285.                             [] call ExileClient_gui_constructionMode_update;
  286.                         };
  287.                     }
  288.                     else
  289.                     {
  290.                         if (ExileClientConstructionCanPlaceObject) then
  291.                         {
  292.                             ExileClientConstructionResult = 1;
  293.                         };
  294.                     };
  295.                 }
  296.                 else
  297.                 {
  298.                     if (ExileClientConstructionCanPlaceObject) then
  299.                     {
  300.                         ExileClientConstructionResult = 1;
  301.                     };
  302.                 };
  303.                 _stopPropagation = true;
  304.             };
  305.         };
  306.     };
  307.     case 0x01:
  308.     {
  309.         if (ExileIsPlayingRussianRoulette) then
  310.         {
  311.             _stopPropagation = true;
  312.         }
  313.         else
  314.         {
  315.             if (ExileClientIsInConstructionMode) then
  316.             {
  317.                 _stopPropagation = true;
  318.             };
  319.         };
  320.     };
  321.     case 0x10:
  322.     {
  323.         if (ExileClientIsInConstructionMode) then
  324.         {
  325.             _step = 45;
  326.             if (_shiftState) then
  327.             {
  328.                 _step = 90;
  329.             }
  330.             else
  331.             {
  332.                 if (_controlState) then
  333.                 {
  334.                     _step = 22.5;
  335.                 };
  336.             };
  337.             ExileClientConstructionRotation = (ExileClientConstructionRotation - _step + 360) % 360;   
  338.             [] call ExileClient_gui_constructionMode_update;
  339.             _stopPropagation = true;
  340.         };
  341.     };
  342.     case 0x12:
  343.     {
  344.         if (ExileClientIsInConstructionMode) then
  345.         {
  346.             _step = 45;
  347.             if (_shiftState) then
  348.             {
  349.                 _step = 90;
  350.             }
  351.             else
  352.             {
  353.                 if (_controlState) then
  354.                 {
  355.                     _step = 22.5;
  356.                 };
  357.             };
  358.             ExileClientConstructionRotation = (ExileClientConstructionRotation + _step + 360) % 360;   
  359.             [] call ExileClient_gui_constructionMode_update;
  360.             _stopPropagation = true;
  361.         };
  362.     };
  363.     case 0x19:
  364.     {
  365.         if (ExileClientIsInBush) then
  366.         {
  367.             call ExileClient_object_bush_detach;
  368.             _stopPropagation = true;
  369.         };
  370.     };
  371.     case 0x31:
  372.     {
  373.         if!(isNull ExileClientCameraParentObject)then
  374.         {
  375.             if(ExileClientCameraNVG)then
  376.             {
  377.                 camUseNVG false;
  378.             }
  379.             else
  380.             {
  381.                 camUseNVG true;
  382.             }; 
  383.             ExileClientCameraNVG = !ExileClientCameraNVG;
  384.             _stopPropagation = true;
  385.         };
  386.     };
  387.     case 0xC9:
  388.     {
  389.         if (ExileClientIsInConstructionMode) then
  390.         {
  391.             _step = 0.25;
  392.             if (_shiftState) then
  393.             {
  394.                 _step = 1;
  395.             }
  396.             else
  397.             {
  398.                 if (_controlState) then
  399.                 {
  400.                     _step = 0.025;
  401.                 };
  402.             };
  403.             ExileClientConstructionOffset set [2, ((((ExileClientConstructionOffset select 2) + _step) min 6) max -3) ];
  404.             [] call ExileClient_gui_constructionMode_update;
  405.             _stopPropagation = true;
  406.         };
  407.     };
  408.     case 0xD1:
  409.     {
  410.         if (ExileClientIsInConstructionMode) then
  411.         {
  412.             _step = 0.25;
  413.             if (_shiftState) then
  414.             {
  415.                 _step = 1;
  416.             }
  417.             else
  418.             {
  419.                 if (_controlState) then
  420.                 {
  421.                     _step = 0.025;
  422.                 };
  423.             };
  424.             ExileClientConstructionOffset set [2, ((((ExileClientConstructionOffset select 2) - _step) min 6) max -3) ];
  425.             [] call ExileClient_gui_constructionMode_update;
  426.             _stopPropagation = true;
  427.         };
  428.     };
  429.     case 0xC7:
  430.     {
  431.         if (ExileClientIsInConstructionMode) then
  432.         {
  433.             _step = 0.25;
  434.             if (_shiftState) then
  435.             {
  436.                 _step = 1;
  437.             }
  438.             else
  439.             {
  440.                 if (_controlState) then
  441.                 {
  442.                     _step = 0.025;
  443.                 };
  444.             };
  445.             ExileClientConstructionOffset set [1, (((ExileClientConstructionOffset select 1) + _step) min 6) max ExileClientConstructionBoundingRadius ];
  446.             [] call ExileClient_gui_constructionMode_update;
  447.             _stopPropagation = true;
  448.         };
  449.     };
  450.     case 0xCF:
  451.     {
  452.         if (ExileClientIsInConstructionMode) then
  453.         {
  454.             _step = 0.25;
  455.             if (_shiftState) then
  456.             {
  457.                 _step = 1;
  458.             }
  459.             else
  460.             {
  461.                 if (_controlState) then
  462.                 {
  463.                     _step = 0.025;
  464.                 };
  465.             };
  466.             ExileClientConstructionOffset set [1, (((ExileClientConstructionOffset select 1) - _step) min 6) max ExileClientConstructionBoundingRadius ];
  467.             [] call ExileClient_gui_constructionMode_update;
  468.             _stopPropagation = true;
  469.         };
  470.     };
  471.     case 0xDB:
  472.     {
  473.         switch (ExilePartyEspMode) do
  474.         {
  475.             case 0:         { ExilePartyEspMode = 1; };
  476.             case 1:     { ExilePartyEspMode = 2; };
  477.             case 2:             { ExilePartyEspMode = 0; };
  478.         };
  479.         _stopPropagation = true;
  480.     };
  481. };
  482. _stopPropagation
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement