fn_getInfMarkerIcon.sqf 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. Name: cTab_fnc_getInfMarkerIcon
  3. Author(s):
  4. Gundy
  5. Description:
  6. Fetch infantry marker, based on Shack Tactical ST_STHud_GetMarkerName
  7. Parameters:
  8. (Optional)
  9. 0: OBJECT - Unit to return infantry marker for
  10. Returns:
  11. STRING - Path to infantry marker
  12. Example:
  13. player call cTab_fnc_getInfMarkerIcon;
  14. */
  15. private "_unit";
  16. _unit = _this;
  17. if (getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "attendant") == 1) exitWith {
  18. "\A3\ui_f\data\map\vehicleicons\iconManMedic_ca.paa"
  19. };
  20. if (getNumber(configFile >> "CfgVehicles" >> typeOf(_unit) >> "engineer") == 1) exitWith {
  21. "\A3\ui_f\data\map\vehicleicons\iconManEngineer_ca.paa"
  22. };
  23. if (leader(_unit) == _unit) exitWith {
  24. "\A3\ui_f\data\map\vehicleicons\iconManLeader_ca.paa"
  25. };
  26. // This appears to be the most consistent way to detect that a weapon is an
  27. // MG of some sort. These pictures are the overlays for the BIS team hud.
  28. if (getText(configFile >> "CfgWeapons" >> primaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_mg_ca.paa") exitWith {
  29. "\A3\ui_f\data\map\vehicleicons\iconManMG_ca.paa"
  30. };
  31. // Do something similar for launchers.
  32. if (getText(configFile >> "CfgWeapons" >> secondaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_at_ca.paa") exitWith {
  33. "\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa"
  34. };
  35. "\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa"