mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 17:13:29 +00:00
dismantled callsign function from units and markers
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
// function name: armatak_fnc_extract_marker_callsign
|
||||
// function author: Valmo
|
||||
// function description: Gets the unit name or classname to be used as TAK callsign in a Marker
|
||||
|
||||
params["_unit"];
|
||||
|
||||
private _callsign = "";
|
||||
|
||||
if ((([_unit] call BIS_fnc_objectType) select 0) == "Vehicle") then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
|
||||
if (!isNull driver _unit) then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName") + " | " + ([name (driver _unit)] call armatak_fnc_shorten_name);
|
||||
};
|
||||
};
|
||||
|
||||
if (unitIsUAV _unit) then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
|
||||
if (isUAVConnected _unit) then {
|
||||
_callsign = (_callsign) + "[ON]";
|
||||
} else {
|
||||
_callsign = (_callsign) + "[OFF]";
|
||||
}
|
||||
};
|
||||
|
||||
armatak_attribute_marker_callsign = _unit getVariable "armatak_attribute_marker_callsign";
|
||||
|
||||
if (!isNil "armatak_attribute_marker_callsign" or armatak_attribute_marker_callsign != '') then {
|
||||
_callsign = armatak_attribute_marker_callsign;
|
||||
};
|
||||
|
||||
_callsign
|
||||
@@ -0,0 +1,25 @@
|
||||
// function name: armatak_fnc_extract_unit_callsign
|
||||
// function author: Valmo
|
||||
// function description: Gets the unit name or classname to be used as TAK callsign from a unit
|
||||
|
||||
params["_unit"];
|
||||
|
||||
private _callsign = "";
|
||||
|
||||
if (roleDescription _unit != "") then {
|
||||
_callsign = ([name _unit] call armatak_fnc_shorten_name) + " | " + roleDescription _unit;
|
||||
} else {
|
||||
_callsign = name _unit;
|
||||
|
||||
if (_callsign == "Error: No unit") then {
|
||||
_callsign = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
|
||||
};
|
||||
};
|
||||
|
||||
armatak_attribute_unit_callsign = _unit getVariable "armatak_attribute_unit_callsign";
|
||||
|
||||
if (!isNil "armatak_attribute_unit_callsign" or armatak_attribute_unit_callsign != '') then {
|
||||
_callsign = armatak_attribute_unit_callsign;
|
||||
};
|
||||
|
||||
_callsign
|
||||
Reference in New Issue
Block a user