diff --git a/addons/nametags/XEH_PREP.hpp b/addons/nametags/XEH_PREP.hpp index a27102a4e5..33b21f04ec 100644 --- a/addons/nametags/XEH_PREP.hpp +++ b/addons/nametags/XEH_PREP.hpp @@ -1,9 +1,5 @@ - -PREP(canShow); -PREP(doShow); PREP(drawNameTagIcon); PREP(getCachedFlags); -PREP(getVehicleData); PREP(initIsSpeaking); PREP(moduleNameTags); PREP(onDraw3d); diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index e663274dbd..85115690b4 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -15,7 +15,6 @@ GVAR(showNamesTime) = -10; // Statement GVAR(showNamesTime) = CBA_missionTime; - // if (call FUNC(canShow)) then{ call FUNC(doShow); }; // This code doesn't work (canShow has a nil / has never worked??) // Return false so it doesn't block other actions false }, diff --git a/addons/nametags/functions/common.hpp b/addons/nametags/functions/common.hpp deleted file mode 100644 index ef3706cd32..0000000000 --- a/addons/nametags/functions/common.hpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Author: aeroson - * Images, index in images and order of roles. - * Defined number also implies order, lower number shows more on top of the list. - */ - -#define PILOT 0 -#define DRIVER 1 -#define COPILOT PILOT -#define COMMANDER 2 -#define GUNNER 3 -#define FFV 4 -#define CARGO 5 - -#define ROLE_IMAGES [ \ - "a3\ui_f\data\IGUI\Cfg\Actions\getinpilot_ca.paa", \ - "a3\ui_f\data\IGUI\Cfg\Actions\getindriver_ca.paa", \ - "a3\ui_f\data\IGUI\Cfg\Actions\getincommander_ca.paa", \ - "a3\ui_f\data\IGUI\Cfg\Actions\getingunner_ca.paa", \ - QPATHTOF(UI\icon_position_ffv.paa), \ - "a3\ui_f\data\IGUI\Cfg\Actions\getincargo_ca.paa" \ -] diff --git a/addons/nametags/functions/fnc_canShow.sqf b/addons/nametags/functions/fnc_canShow.sqf deleted file mode 100644 index 9cc83cfd91..0000000000 --- a/addons/nametags/functions/fnc_canShow.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#include "script_component.hpp" -/* - * Author: aeroson - * Checks if crew info can be shown. - * Might be called several times a second. - * - * Arguments: - * None - * - * Return Value: - * Can show Crew Info - * - * Example: - * call ace_nametags_fnc_canShow - * - * Public: No - */ - -((vehicle ACE_player) != ACE_player) && -{GVAR(ShowCrewInfo)} && -{!(vehicle ACE_player isKindOf "ParachuteBase")}; diff --git a/addons/nametags/functions/fnc_doShow.sqf b/addons/nametags/functions/fnc_doShow.sqf deleted file mode 100644 index 32acffe045..0000000000 --- a/addons/nametags/functions/fnc_doShow.sqf +++ /dev/null @@ -1,86 +0,0 @@ -#include "script_component.hpp" -#include "common.hpp" -/* - * Author: aeroson - * Shows the actual text and sets text the crew info. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * call ace_nametags_fnc_doShow - * - * Public: No - */ - -private _player = ACE_player; -private _vehicle = vehicle _player; -private _type = typeOf _vehicle; -private _config = configOf _vehicle; -private _text = format[" %2
", getText(_config>>"picture"), getText (_config >> "DisplayName")]; - -private _data = [_type] call FUNC(getVehicleData); - -private _isAir = _data select 0; -private _data = _data select 1; - -private _turretUnits = _data apply {_vehicle turretUnit (_x select 0)}; -private _turretRoles = _data apply {_x select 1}; - -private _roleType = CARGO; -private _toShow = []; -{ - switch (_x) do { - case commander _vehicle: { - _roleType = COMMANDER; - }; - case gunner _vehicle: { - _roleType = GUNNER; - }; - case driver _vehicle: { - _roleType = if(_isAir) then { PILOT } else { DRIVER }; - }; - default { - _index = _turretUnits find _x; - if(_index !=-1 ) then { - _roleType = _turretRoles select _index; - } else { - _roleType = CARGO; - }; - }; - }; - _toShow pushBack [_x, _roleType]; -} forEach crew _vehicle; - -_toShow = [ - _toShow, - [], - { - _x select 1 - }, - "ASCEND", - { - _unit = _x select 0; - alive _unit - } -] call BIS_fnc_sortBy; - -private _roleImages = ROLE_IMAGES; -{ - private _unit = _x select 0; - private _roleType = _x select 1; - _text = _text + format["%1
", [_unit] call EFUNC(common,getName), _roleImages select _roleType]; -} forEach _toShow; - -("ACE_CrewInfo_CrewInfo" call BIS_fnc_rscLayer) cutRsc ["ACE_CrewInfo_dialog", "PLAIN", 1, false]; - -terminate (missionNamespace getVariable [QGVAR(hideCrewInfoHandle), scriptNull]); -GVAR(hideCrewInfoHandle) = 0 spawn { - sleep 2; - ("ACE_CrewInfo_CrewInfo" call BIS_fnc_rscLayer) cutFadeOut 2; -}; - -[_text] call FUNC(setText); diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf deleted file mode 100644 index 48eeab4626..0000000000 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ /dev/null @@ -1,103 +0,0 @@ -#include "script_component.hpp" -#include "common.hpp" -/* - * Author: aeroson - * Gathers and caches data needed by ace_nametags_fnc_doShow. - * What really does make difference for the engine is simulation of CfgAmmo. - * Priority of roles is: driver/pilot, gunner, copilot, commander, FFV, cargo. - * - * Arguments: - * None - * - * Return Value: - * Data - * 0: Vehicle inherits from Air - * 1: Categorized vehicle's turrets - * - * Example: - * call ace_nametags_fnc_getVehicleData - * - * Public: No - */ - -params ["_type"]; - -private _varName = format ["ACE_CrewInfo_Cache_%1", _type]; -private _data = + (uiNamespace getVariable _varName); - -if (!isNil "_data") exitWith {_data}; - -_data = []; -private _isAir = _type isKindOf "Air"; - -private _fnc_addTurretUnit = { - params ["_config", "_path"]; - private _role = CARGO; - - private _simulationEmpty = 0; - private _simulationLaserDesignate = 0; - private _simulationOther = 0; - { - { - private _magazine = configFile >> "CfgMagazines" >> _x; - private _ammo = configFile >> "CfgAmmo" >> getText (_magazine >> "ammo"); - private _simulation = getText (_ammo >> "simulation"); - - if(_simulation=="") then { - _simulationEmpty = _simulationEmpty + 1; - } else { - if(_simulation=="laserDesignate") then { - _simulationLaserDesignate = _simulationLaserDesignate + 1; - } else { - _simulationOther = _simulationOther + 1; - }; - }; - - } forEach getArray (configFile >> "CfgWeapons" >> _x >> "magazines"); - } forEach getArray (_config >> "weapons"); - - if(_simulationOther>0) then { - _role = GUNNER; - }; - if (_role == CARGO && {getNumber (_config >> "isCopilot") == 1}) then { - _role = COPILOT; - }; - if (_role == CARGO && {_simulationLaserDesignate>0 || getNumber (_config >> "primaryObserver") == 1}) then { - _role = COMMANDER; - }; - if (_role == CARGO && {getNumber (_config >> "isPersonTurret") == 1}) then { - _role = FFV; - }; - - _data pushBack [_path, _role]; -}; - - -private _fnc_addTurret = { - params ["_config", "_path"]; - - _config = _config >> "Turrets"; - private _count = count _config; - - private _offset = 0; - - for "_index" from 0 to (_count - 1) do { - private _turretPath = _path + [_index - _offset]; - private _turretConfig = _config select _index; - if (isClass _turretConfig) then { - [_turretConfig, _turretPath] call _fnc_addTurretUnit; - [_turretConfig, _turretPath] call _fnc_addTurret; - } else { - _offset = _offset + 1; - }; - }; -}; - - -_config = configFile >> "CfgVehicles" >> _type; -[_config, []] call _fnc_addTurret; - -_data = [_isAir, _data]; -uiNamespace setVariable [_varName, _data]; - -_data