Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- systemchat "start mui.sqf";
- objects = [];
- times = [];
- draw3d = {
- private ["_start","_pos","_text"];
- _toPercentage = {
- private ["_x"];
- _x = round((_this/1.)*1000.)/10.;
- /*if(_x<10) exitWith {
- format[" %1",_x];
- };
- if(_x<100) exitWith {
- format[" %1",_x];
- };
- format["%1",_x];*/
- _x;
- };
- _x = player;
- if(cameraView in ["INTERNAL","GUNNER"]) then {
- _pos = positionCameraToWorld [0,0,0]; //[ [getPosASL _x, _x modelToWorld (_x selectionposition "RightHand")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
- } else {
- _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "RightShoulder")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
- };
- _start = _pos;
- _maxDist = 30;
- {
- if(terrainIntersect [_start, getPos _x]) then {
- _i = objects find _x;
- if(_i!=-1) then {
- objects = objects - [objects select _i];
- times = times - [times select _i];
- };
- } else {
- _dist = _start distance _x;
- _alpha = 1 - _dist/_maxDist;
- if(!(_x in objects)) then {
- objects set[count objects, _x];
- times set[count times, time];
- };
- _text = str(round((time-(times select (objects find _x)))*10.0)/10.0);
- 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"];
- drawLine3D [visiblePosition _x, _start, [1,0,0,_alpha]];
- };
- } forEach (_start nearObjects ["grenade",_maxDist]);
- _maxDist = 20;
- {
- if(side _x==playerSide && !(terrainIntersect [_start, getPos _x])) then {
- _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "RightShoulder")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
- _scr = worldToScreen _pos;
- _alpha = 1;
- if(count _scr>0) then {
- _dist = sqrt((((_scr select 0)-.5)^2) + (((_scr select 1)-.5)^2));
- _alpha = (0 max ((_dist / .5) min 1));
- };
- drawIcon3D ["a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa", [.1,.6,1,_alpha/2.], _pos, .8, .8, 0, "", 0, .03, "default"];
- _dist = _start distance _x;
- if(_dist<_maxDist) then {
- _alpha = _alpha * (1 - _dist/_maxDist);
- drawLine3D [_pos, _start, [0,.1,1,_alpha]];
- };
- };
- } forEach allUnits;
- _x = player;
- _pos = getPosASL _x;
- _pos set [2, (_pos select 2) + ((_x selectionposition "Spine3") select 2)];
- _scr = worldToScreen _pos;
- if(count _scr>0) then {
- _scr set [0, (_scr select 0) + .1];
- _pos = positionCameraToWorld [_scr select 0, _scr select 1, 1];
- _pos = positionCameraToWorld [0,0,1];
- _text = format["aaaaaaaa %1", _x ammo (currentWeapon _x)];
- drawIcon3D [getText(configFile >> "cfgWeapons" >> (currentWeapon _x) >> "picture"), [1,1,1,1], _pos, 2, 2, 0, _text, 0, .03, "default"];
- };
- _x = cursorTarget;
- if(!isNull(_x)) then {
- _pos = [0,0,0];
- _text = "";
- switch (true) do {
- case (_x iskindof "Man"): {
- _pos = [ [getPosASL _x, _x modelToWorld (_x selectionposition "Spine3")] call BIS_fnc_vectorDiff, visiblePositionASL _x ] call BIS_fnc_vectorAdd;
- _scr = worldToScreen _pos;
- if(count _scr>0) then {
- _scr set [0, (_scr select 0) + .1];
- _pos = screenToWorld _scr;
- _text = format["damage: %1", (damage _x) call _toPercentage];
- };
- };
- case (_x iskindof "AllVehicles"): {
- _pos = getposatl _x;
- _text = format["damage: %1 | class: %2% | fuel: %3", (damage _x) call _toPercentage, typeof _x, (fuel _x) call _toPercentage];
- };
- default {
- };
- };
- drawIcon3D ["a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa", [.1,.6,1,.5], _pos, 0, 0, 0, _text, 0, .03, "default"];
- };
- };
- [] call draw3d;
- a=addMissionEventHandler["draw3d",{
- [] call draw3d;
- }];
- // triangle full a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targetairtexture_gs.paa
- // trinalgy empty a3\ui_f\data\IGUI\Cfg\Cursors\explosive_ca.paa
- // square a3\ui_f\data\IGUI\Cfg\TacticalDisplay\targettexture_gs.paa
- // heal a3\ui_f\data\IGUI\Cfg\Actions\heal_ca.paa
- // hexagon a3\ui_f\data\IGUI\Cfg\Cursors\select_ca.paa
- // target a3\ui_f\data\IGUI\Cfg\Cursors\assault_ca.paa
Advertisement
Add Comment
Please, Sign In to add comment