Skip to content

Commit

Permalink
Add line connecting unconscious icon and unit (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timi007 authored Jan 13, 2024
1 parent c609a4e commit ba45b7a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion addons/zeus/functions/fnc_add3DENCommentsDrawEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (!GVAR(3DENComments_drawEHAdded)) then {
[_posAGL select 0, _posAGL select 1, 0],
_color
];
}
};
} count _3denComments;
}, [GVAR(3DENComments_data)]] call CBA_fnc_addBISEventHandler;
};
Expand Down
19 changes: 14 additions & 5 deletions addons/zeus/functions/fnc_addACEUnconsciousIconDrawEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,34 @@ if (!GVAR(ACEIcon_drawEHAdded)) then {
private _unconsciousPlayers = _curatorModule getVariable [QGVAR(unconsciousPlayers), []];

{
private _pos = ASLToAGL (getPosASLVisual _x);
private _camPos = ASLToAGL (getPosASLVisual curatorCamera);
private _d = _pos distance _camPos;
private _unitPosAGL = _x modelToWorldVisual (_x selectionPosition "pelvis"); // Model center position
private _camPosAGL = ASLToAGL (getPosASLVisual curatorCamera);
private _d = _unitPosAGL distance _camPosAGL;
private _scale = linearConversion [300, 730, _d, 1.5, 0, true]; // 300m => 1.5, 730m => 0

if (_scale < 0.01) then {
continue;
};

private _color = [0.9, 0, 0, 1];
private _iconPosAGL = [_unitPosAGL select 0, _unitPosAGL select 1, (_unitPosAGL select 2) + 2];

drawIcon3D [
"z\ace\addons\zeus\ui\Icon_Module_Zeus_Unconscious_ca.paa",
[0.9, 0, 0, 1],
[_pos select 0, _pos select 1, (_pos select 2) + 2],
_color,
_iconPosAGL,
_scale, // Width
_scale, // Height
0, // Angle
"", // Text
1 // Shadow
];

drawLine3D [
[_iconPosAGL select 0, _iconPosAGL select 1, (_iconPosAGL select 2) - 0.02], // Hide line start behind icon
_unitPosAGL,
_color
];
} count _unconsciousPlayers;
}, [_curatorModule]] call CBA_fnc_addBISEventHandler;
};
Expand Down

0 comments on commit ba45b7a

Please sign in to comment.