Advertisement
Guest User

Untitled

a guest
Jan 24th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.01 KB | None | 0 0
  1. {
  2. (findDisplay 12 displayCtrl 51) ctrlRemoveEventHandler ["Draw",TeamMapEvent];
  3. } remoteExec ["bis_fnc_call", 0];
  4. {} remoteExec ["BIS_fnc_call",0,"TeamMapUI"];
  5.  
  6. {
  7. [] spawn
  8. {
  9. waitUntil {sleep 0.1; getClientState == "BRIEFING READ"};
  10. disableMapIndicators [true,false,false,false];
  11.  
  12. maxDistanceFlagMarker3D = 1500;
  13. transitionDistanceFlagMarker3D = 500;
  14. maxDistanceUnitMarker3D = 150;
  15. maxDistanceUnitMarkerText3D = 10;
  16. maxCursorRangeUnitMarker = 0.02;
  17. minMapZoomUnitMarker = 0.0045;
  18.  
  19. TeamMapEvent = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",
  20. {
  21. _vehicleList = [];
  22. {
  23. if((side group _x) isEqualTo (side group player)) then
  24. {
  25. _pos = _x modelToWorldVisual [0,0,0];
  26. _unit = driver vehicle _x;
  27. _dir = getDir _x;
  28. _text = (name _x);
  29. _distance = player distance _x;
  30.  
  31. _alpha = 1;
  32. _color = switch (side group _x) do
  33. {
  34. case west: {[0.10,0.45,1,_alpha]};
  35. case east: {[0.8,0.05,0,_alpha]};
  36. case independent: {[0.5,1,0.5,_alpha]};
  37. default {[1,1,1,_alpha]};
  38. };
  39.  
  40. if((group player) isEqualTo (group _unit)) then
  41. {
  42. _color = [1,0.855,0.28,_alpha];
  43. };
  44.  
  45. _pos2D = (_this select 0) ctrlMapWorldToScreen _pos;
  46. _posCursor2D = getMousePosition;
  47. _dist = _pos2D distance2D _posCursor2D;
  48. _scale = ctrlMapScale (_this select 0);
  49.  
  50. if (vehicle _x == _x) then
  51. {
  52. if((_scale > minMapZoomUnitMarker) && (_dist > maxCursorRangeUnitMarker)) then {_text = "";};
  53.  
  54. _this select 0 drawIcon
  55. [
  56. "\A3\ui_f\data\Map\VehicleIcons\iconManVirtual_ca.paa",
  57. _color,
  58. _pos,
  59. 20,
  60. 20,
  61. _dir,
  62. _text,
  63. 2,
  64. 0.05,
  65. "RobotoCondensedBold",
  66. "left"
  67. ];
  68.  
  69. _this select 0 drawIcon
  70. [
  71. "\A3\ui_f\data\Map\VehicleIcons\iconManVirtual_ca.paa",
  72. _color,
  73. _pos,
  74. 20,
  75. 20,
  76. _dir,
  77. _text,
  78. 1,
  79. 0.05,
  80. "RobotoCondensedBold",
  81. "left"
  82. ];
  83. }
  84. else
  85. {
  86. if !((vehicle _x) in _vehicleList) then
  87. {
  88. _vehicleList pushback vehicle _x;
  89.  
  90. _dir = getDir vehicle _x;
  91.  
  92. _className = (typeOf vehicle _x);
  93. _file = getText (configfile >> "CfgVehicles" >> _className >> "icon");
  94.  
  95. _driver = driver vehicle _x;
  96.  
  97. _vehName = getText (configfile >> "CfgVehicles" >> _className >> "displayName");
  98. _text = _vehName;
  99.  
  100. _text2 = "";
  101. _count = count crew vehicle _x;
  102. if(_count > 1) then
  103. {
  104. _text2 = ((name _driver) + " + " + (str (_count-1)) + " more");
  105. }
  106. else
  107. {
  108. _text2 = (name _driver);
  109. };
  110. if((_scale > minMapZoomUnitMarker) && (_dist > maxCursorRangeUnitMarker)) then {_text = ""; _text2 = "";};
  111.  
  112. _this select 0 drawIcon
  113. [
  114. _file,
  115. _color,
  116. _pos,
  117. 20,
  118. 20,
  119. _dir,
  120. _text,
  121. 2,
  122. 0.05,
  123. "RobotoCondensedBold",
  124. "left"
  125. ];
  126.  
  127. _this select 0 drawIcon
  128. [
  129. _file,
  130. _color,
  131. _pos,
  132. 20,
  133. 20,
  134. _dir,
  135. _text2,
  136. 2,
  137. 0.05,
  138. "RobotoCondensedBold",
  139. "right"
  140. ];
  141.  
  142. _this select 0 drawIcon
  143. [
  144. _file,
  145. _color,
  146. _pos,
  147. 20,
  148. 20,
  149. _dir,
  150. _text,
  151. 1,
  152. 0.05,
  153. "RobotoCondensedBold",
  154. "left"
  155. ];
  156. };
  157. };
  158.  
  159. if(_x == player) then
  160. {
  161. _color set[3,0.5];
  162. _this select 0 drawIcon
  163. [
  164. "\a3\ui_f\data\Map\groupIcons\selector_selected_ca.paa",
  165. _color,
  166. _pos,
  167. 30,
  168. 30,
  169. _dir,
  170. "",
  171. 0,
  172. 0.05,
  173. "RobotoCondensedBold",
  174. "left"
  175. ];
  176. };
  177. };
  178. } foreach allPlayers;
  179. }];
  180. };
  181. } remoteExec ["BIS_fnc_call",0,"TeamMapUI"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement