Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. A3C_GREN_VISUAL = {
  2. params ["_muzzle","_mode"];
  3. //player commandchat str [_mode];
  4.  
  5. //-- label parent button
  6. private _col = if (count A3C_AI_GREN_ARRAY == 0) then {[1,1,1,0.3]} else{[1,1,1,0.6]};
  7. (findDisplay 7999 displayCtrl 9015) ctrlSetText "A3C_CORE\ui\pictures\icon_menu_grenade.paa";
  8. (findDisplay 7999 displayCtrl 9015) ctrlSetTextColor _col;
  9. (findDisplay 7999 displayCtrl 9016) ctrlSetToolTip "AI Grenades";
  10.  
  11.  
  12. //-- sort grenades by usability
  13. A3C_AI_GREN_ARRAY =
  14. [
  15. A3C_AI_GREN_ARRAY,
  16. [],
  17. {
  18. _ammo = getText (configfile >> "CfgMagazines" >> _x >> "ammo");
  19. _number = 0;
  20. _explo = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive");
  21. if (_explo == 1) then {
  22. _hit = getNumber (configfile >> "CfgAmmo" >> _ammo >> "hit");
  23. _number = 1000 * _hit;
  24. } else {
  25. _number = getNumber (configfile >> "CfgAmmo" >> _ammo >> "aiAmmoUsageFlags");
  26. };
  27. _number
  28. },
  29. "DESCEND"
  30. ] call BIS_fnc_sortBy;
  31.  
  32. if (A3C_RADIALMODE == "GRENADE" && {BV_GREN == 1}) then {
  33. //-- reset outer ring buttons
  34. for "_i" from 10008 to 10039 do {
  35. (findDisplay 7999 displayCtrl _i) ctrlShow false;
  36. if (_i % 2 == 0) then {
  37. (findDisplay 7999 displayCtrl _i) ctrlSetText "";
  38. } else {
  39. (findDisplay 7999 displayCtrl _i) ctrlSetTooltip "";
  40. };
  41. };
  42.  
  43. _outerRingBackGroundIDs = ["PlaceHolder","Left","bottom","Right","Top"];
  44.  
  45. //-- outer ring backgrounds
  46. for "_i" from 8001 to 8004 do {
  47. _ind = _i - 8000;
  48.  
  49. if ( _ind <= ((ceil ((count A3C_AI_GREN_ARRAY) / 4) ) min 3) ) then {
  50. (findDisplay 7999 displayCtrl _i) ctrlShow true; //-- outer circle backgroud shown
  51. (findDisplay 7999 displayCtrl _i) ctrlSetText (format ["A3C_CORE\ui\pictures\BG_Radial_OuterRing_%1.paa",_outerRingBackGroundIDs select _ind]);
  52. } else {
  53. (findDisplay 7999 displayCtrl _i) ctrlShow false; //-- outer circle backgroud hidden
  54. };
  55. };
  56. if (count A3C_AI_GREN_ARRAY == 0) exitWith {};
  57. //-- label buttons-images and fncs
  58. {
  59. _btnID = (10039 - (_foreachIndex * 2));
  60. _imgID = ((10039 - (_foreachIndex * 2)) - 1);
  61. _buttonitem = 16 - _foreachIndex;
  62. //systemchat str _btnID;
  63. _btnClicker = findDisplay 7999 displayCtrl _btnID;
  64. _btnImage = findDisplay 7999 displayCtrl _imgID;
  65. {_x ctrlShow true} foreach [_btnImage,_btnClicker];
  66. _btnImage ctrlSetText (gettext (configfile >> "CfgMagazines" >> _x >> "picture"));
  67. _btnClicker ctrlSetToolTip (gettext (configfile >> "CfgMagazines" >> _x >> "displayNameShort"));
  68. call compile format
  69. [
  70. "
  71. A3C_OUTER_RING_BTN_fnc_%1 =
  72. [
  73. [],
  74. {
  75. A3C_GREN_MUZZLE = '%2';
  76. [] spawn A3C_RadialMenu_GREN;
  77. systemchat '%2'
  78. }
  79. ];
  80. ",
  81. _buttonitem,
  82. _x
  83. ];
  84. } foreach A3C_AI_GREN_ARRAY;
  85. };
  86. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement