Skip to content

Commit

Permalink
Add player height and dynamic scaling to zeus uncon icons (#74)
Browse files Browse the repository at this point in the history
* Add player height to zeus uncon icons

* Use correct position commands

* Scale icon with distance
  • Loading branch information
Timi007 authored Feb 18, 2022
1 parent b0469b5 commit c0cec7a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions addons/zeus/functions/fnc_initDrawIconEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ CHECK(!isNil {(_curatorModule getVariable QGVAR(unconsciousPlayers))});
private _unconsciousPlayers = _curatorModule getVariable [QGVAR(unconsciousPlayers), []];

{
private _pos = getPos _x;
private _pos = ASLToAGL (getPosASLVisual _x);
private _camPos = ASLToAGL (getPosASLVisual curatorCamera);
private _d = _pos distance _camPos;
private _scale = linearConversion [300, 730, _d, 1.5, 0, true]; // 300m => 1.5, 730m => 0

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

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

0 comments on commit c0cec7a

Please sign in to comment.