aeroson

a3 ghost recon like au

Jun 19th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1.  
  2. systemchat "start mui.sqf";
  3.  
  4.  
  5. objects = [];
  6. times = [];
  7.  
  8.  
  9.  
  10. draw3d = {
  11.  
  12. private ["_start","_pos","_text"];
  13.  
  14. _toPercentage = {
  15. private ["_x"];
  16. _x = round((_this/1.)*1000.)/10.;
  17. /*if(_x<10) exitWith {
  18. format[" %1",_x];
  19. };
  20. if(_x<100) exitWith {
  21. format[" %1",_x];
  22. };
  23. format["%1",_x];*/
  24. _x;
  25. };
  26.  
  27.  
  28. _x = player;
  29. if(cameraView in ["INTERNAL","GUNNER"]) then {
  30. _pos = positionCameraToWorld [0,0,0]; //[ [getPosASL _x, _x modelToWorld (_x selectionposition "RightHand")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
  31. } else {
  32. _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "RightShoulder")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
  33. };
  34. _start = _pos;
  35.  
  36. _maxDist = 30;
  37. {
  38. if(terrainIntersect [_start, getPos _x]) then {
  39. _i = objects find _x;
  40. if(_i!=-1) then {
  41. objects = objects - [objects select _i];
  42. times = times - [times select _i];
  43. };
  44. } else {
  45. _dist = _start distance _x;
  46. _alpha = 1 - _dist/_maxDist;
  47. if(!(_x in objects)) then {
  48. objects set[count objects, _x];
  49. times set[count times, time];
  50. };
  51. _text = str(round((time-(times select (objects find _x)))*10.0)/10.0);
  52. drawIcon3D ["a3\ui_f\data\IGUI\RscingameUI\RscUnitInfoAirRTDFull\ico_cpt_park_on_ca.paa", [1,0,0,_alpha], visiblePosition _x, .8, .8, 0, _text, 0, .03, "default"];
  53. drawLine3D [visiblePosition _x, _start, [1,0,0,_alpha]];
  54. };
  55. } forEach (_start nearObjects ["grenade",_maxDist]);
  56.  
  57.  
  58. _maxDist = 20;
  59. {
  60. if(side _x==playerSide && !(terrainIntersect [_start, getPos _x])) then {
  61. _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "RightShoulder")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
  62. _scr = worldToScreen _pos;
  63. _alpha = 1;
  64. if(count _scr>0) then {
  65. _dist = sqrt((((_scr select 0)-.5)^2) + (((_scr select 1)-.5)^2));
  66. _alpha = (0 max ((_dist / .5) min 1));
  67. };
  68. drawIcon3D ["a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa", [.1,.6,1,_alpha/2.], _pos, .8, .8, 0, "", 0, .03, "default"];
  69. _dist = _start distance _x;
  70. if(_dist<_maxDist) then {
  71. _alpha = _alpha * (1 - _dist/_maxDist);
  72. drawLine3D [_pos, _start, [0,.1,1,_alpha]];
  73. };
  74. };
  75. } forEach allUnits;
  76.  
  77.  
  78. _x = player;
  79. _pos = getPosASL _x;
  80. _pos set [2, (_pos select 2) + ((_x selectionposition "Spine3") select 2)];
  81. _scr = worldToScreen _pos;
  82. if(count _scr>0) then {
  83. _scr set [0, (_scr select 0) + .1];
  84. _pos = positionCameraToWorld [_scr select 0, _scr select 1, 1];
  85.  
  86. _pos = positionCameraToWorld [0,0,1];
  87. _text = format["aaaaaaaa %1", _x ammo (currentWeapon _x)];
  88. drawIcon3D [getText(configFile >> "cfgWeapons" >> (currentWeapon _x) >> "picture"), [1,1,1,1], _pos, 2, 2, 0, _text, 0, .03, "default"];
  89. };
  90.  
  91.  
  92. _x = cursorTarget;
  93. if(!isNull(_x)) then {
  94. _pos = [0,0,0];
  95. _text = "";
  96. switch (true) do {
  97. case (_x iskindof "Man"): {
  98. _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "Spine3")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
  99. _scr = worldToScreen _pos;
  100. if(count _scr>0) then {
  101. _scr set [0, (_scr select 0) + .1];
  102. _pos = screenToWorld _scr;
  103. _text = format["damage: %1", (damage _x) call _toPercentage];
  104. };
  105. };
  106. case (_x iskindof "AllVehicles"): {
  107. _pos = getposatl _x;
  108. _text = format["damage: %1 | class: %2% | fuel: %3", (damage _x) call _toPercentage, typeof _x, (fuel _x) call _toPercentage];
  109. };
  110. default {
  111. };
  112. };
  113. drawIcon3D ["a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa", [.1,.6,1,.5], _pos, 0, 0, 0, _text, 0, .03, "default"];
  114. };
  115.  
  116. };
  117.  
  118.  
  119. [] call draw3d;
  120. a=addMissionEventHandler["draw3d",{
  121. [] call draw3d;
  122. }];
  123.  
  124.  
  125.  
  126. // triangle full a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa
  127. // trinalgy empty a3\ui_f\data\IGUI\Cfg\Cursors\explosive_ca.paa
  128. // square a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targettexture_gs.paa
  129. // heal a3\ui_f\data\IGUI\Cfg\Actions\heal_ca.paa
  130. // hexagon a3\ui_f\data\IGUI\Cfg\Cursors\select_ca.paa
  131. // target a3\ui_f\data\IGUI\Cfg\Cursors\assault_ca.paa
Advertisement
Add Comment
Please, Sign In to add comment