Advertisement
Guest User

ExileClient_gui_hud_event_onKeyUp - Vector Building

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