Advertisement
skotracker

ExileClient_gui_hud_event_onKeyUp

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