<commit_before>//	@file Version: 0.9
//	@file Name: playericons.sqf
//	@file Author: [404] Pulse
//	@file Created: 01/01/2012
//	@file Description: Creating and displaying the icons above team or group.

#define icons_idc 46300

#define ICON_fadeDistance 750
#define ICON_limitDistance 1250

FZF_ICHud_Zoom = 0.05;
FZF_ICHud_Scale = 1.0;
FZF_ICHud_Centre = [150, 150];
FZF_ICHud_Customised = false;
FZF_ICHud_Layer = 609;

FZF_IC_Icons = 
{
	private ["_units", "_groupOnly", "_index", "_HUD_ICON"];
	
	if (playerSide == INDEPENDENT) then
	{
		_units = units player;
		_groupOnly = true;
	}
	else
	{
		_units = allUnits;
		_groupOnly = false;
	};
	
	_index = 0;
	
	{
		if (_x != player && {side _x == playerSide || {_groupOnly}}) then
		{
			private ["_unit", "_pos", "_distance", "_pIcon"];
			
			_unit = _x;
			_pos = getPos _unit;
			_distance = _pos distance positionCameraToWorld [0,0,0];
			
			if (_distance < ICON_limitDistance) then // rules out the player and players too far away.
			{
				_pos set [2, (_pos select 2) + 1.5];
				_screen = worldToScreen _pos;			
				
				if (count _screen > 1) then // Dont calculate if they are not on the screen
				{
					_sx = _screen select 0;
					_sy = _screen select 1;
					
					switch (if (alive _unit) then { side _unit } else { playerSide }) do
					{
						case BLUFOR:		{ _pIcon = _bluIcon };
						case OPFOR:			{ _pIcon = _opfIcon };
						case INDEPENDENT:	{ _pIcon = _indIcon };						
					};
					
					_HUD_ICON = _FZF_IC_Hud_Disp displayCtrl (icons_idc + _index);
					_HUD_ICON ctrlSetStructuredText _pIcon;
					_HUD_ICON ctrlSetPosition [_sx, _sy, 0.4, 0.65];
					_HUD_ICON ctrlSetScale (0.35 - ((_distance / ICON_limitDistance) * 0.25));
					_HUD_ICON ctrlSetFade (0 max (((1 / (ICON_limitDistance - ICON_fadeDistance)) * _distance) - (ICON_limitDistance / ICON_fadeDistance)));
					_HUD_ICON ctrlCommit 0;
					_HUD_ICON ctrlShow true;
				}
				else
				{
					_HUD_ICON = _FZF_IC_Hud_Disp displayCtrl (icons_idc + _index);
					_HUD_ICON ctrlShow false;
				};
			}<commit_msg>Fixed player icons position when inside buildings<commit_after>//	@file Version: 0.9
//	@file Name: playericons.sqf
//	@file Author: [404] Pulse
//	@file Created: 01/01/2012
//	@file Description: Creating and displaying the icons above team or group.

#define icons_idc 46300

#define ICON_fadeDistance 750
#define ICON_limitDistance 1250

FZF_ICHud_Zoom = 0.05;
FZF_ICHud_Scale = 1.0;
FZF_ICHud_Centre = [150, 150];
FZF_ICHud_Customised = false;
FZF_ICHud_Layer = 609;

FZF_IC_Icons = 
{
	private ["_units", "_groupOnly", "_index", "_HUD_ICON"];
	
	if (playerSide == INDEPENDENT) then
	{
		_units = units player;
		_groupOnly = true;
	}
	else
	{
		_units = allUnits;
		_groupOnly = false;
	};
	
	_index = 0;
	
	{
		if (_x != player && {side _x == playerSide || {_groupOnly}}) then
		{
			private ["_unit", "_pos", "_distance", "_pIcon"];
			
			_unit = _x;
			//_pos = getPos _unit;
			_pos = _unit modelToWorld [0,0,0];
			_distance = _pos distance positionCameraToWorld [0,0,0];
			
			if (_distance < ICON_limitDistance) then // rules out the player and players too far away.
			{
				_pos set [2, (_pos select 2) + 1.35];
				_screen = worldToScreen _pos;
				
				if (count _screen > 1) then // Dont calculate if they are not on the screen
				{
					_sx = _screen select 0;
					_sy = _screen select 1;
					
					switch (if (alive _unit) then { side _unit } else { playerSide }) do
					{
						case BLUFOR:		{ _pIcon = _bluIcon };
						case OPFOR:			{ _pIcon = _opfIcon };
						case INDEPENDENT:	{ _pIcon = _indIcon };						
					};
					
					_HUD_ICON = _FZF_IC_Hud_Disp displayCtrl (icons_idc + _index);
					_HUD_ICON ctrlSetStructuredText _pIcon;
					_HUD_ICON ctrlSetPosition [_sx, _sy, 0.4, 0.65];
					_HUD_ICON ctrlSetScale (0.35 - ((_distance / ICON_limitDistance) * 0.25));
					_HUD_ICON ctrlSetFade (0 max (((1 / (ICON_limitDistance - ICON_fadeDistance)) * _distance) - (ICON_limitDistance / ICON_fadeDistance)));
					_HUD_ICON ctrlCommit 0;
					_HUD_ICON ctrlShow true;
				}
				else
				{
					_HUD_ICON = _FZF_IC_Hud_Disp displayCtrl (icons_idc + _index);
					_HUD_ICON ctrlShow false;
				};
			}
{'fraction_non_alphanumeric': 0.11328871892925431, 'fraction_numerical': 0.03154875717017208, 'mean_word_length': 3.0086206896551726, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5881721', 'n_tokens_mistral': 2004, 'n_tokens_neox': 1590, 'n_words': 414}