fn_translateUserMarker.sqf 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. Name: cTab_fnc_translateUserMarker
  3. Author(s):
  4. Gundy
  5. Description:
  6. Take the condensed user marker data and translate it so that it can be drawn much quicker
  7. Received marker data format:
  8. Index 0: ARRAY - 2D marker position
  9. Index 1: INTEGER - number of icon
  10. Index 2: INTEGER - size type
  11. Index 3: INTEGER - octant of reported movement
  12. Index 4: STRING - marker time
  13. Index 5: OBJECT - marker creator
  14. Translated marker data format:
  15. Index 0: ARRAY - marker position
  16. Index 1: STRING - path to marker icon
  17. Index 2: STRING - path to marker size icon
  18. Index 3: STRING - direction of reported movement
  19. Index 4: ARRAY - marker color
  20. Index 5: STRING - marker time
  21. Index 6: STRING - text alignment
  22. Parameters:
  23. 0: ARRAY - Marker data
  24. Returns:
  25. ARRAY - Translated marker data
  26. Example:
  27. [[1714.35,5716.82],0,0,0,"12:00"] call cTab_fnc_translateUserMarker;
  28. */
  29. private ["_pos","_markerIcon","_texture1","_markerSize","_texture2","_markerDir","_dir","_text","_align"];
  30. _pos = _this select 0;
  31. _color = cTabColorRed;
  32. _markerIcon = _this select 1;
  33. _texture1 = call {
  34. if (_markerIcon == 0) exitWith {"\A3\ui_f\data\map\markers\nato\o_inf.paa"};
  35. if (_markerIcon == 1) exitWith {"\A3\ui_f\data\map\markers\nato\o_mech_inf.paa"};
  36. if (_markerIcon == 2) exitWith {"\A3\ui_f\data\map\markers\nato\o_motor_inf.paa"};
  37. if (_markerIcon == 3) exitWith {"\A3\ui_f\data\map\markers\nato\o_armor.paa"};
  38. if (_markerIcon == 4) exitWith {"\A3\ui_f\data\map\markers\nato\o_air.paa";};
  39. if (_markerIcon == 5) exitWith {"\A3\ui_f\data\map\markers\nato\o_plane.paa"};
  40. if (_markerIcon == 6) exitWith {"\A3\ui_f\data\map\markers\nato\o_unknown.paa"};
  41. if (_markerIcon == 7) exitWith {"\ClonecTab\img\o_inf_rifle.paa"};
  42. if (_markerIcon == 8) exitWith {"\ClonecTab\img\o_inf_mg.paa"};
  43. if (_markerIcon == 9) exitWith {"\ClonecTab\img\o_inf_at.paa"};
  44. if (_markerIcon == 10) exitWith {"\ClonecTab\img\o_inf_mmg.paa"};
  45. if (_markerIcon == 11) exitWith {"\ClonecTab\img\o_inf_mat.paa"};
  46. if (_markerIcon == 12) exitWith {"\ClonecTab\img\o_inf_mmortar.paa"};
  47. if (_markerIcon == 13) exitWith {"\ClonecTab\img\o_inf_aa.paa"};
  48. _color = cTabColorGreen;
  49. if (_markerIcon == 20) exitWith {"\A3\ui_f\data\map\markers\military\join_CA.paa"};
  50. if (_markerIcon == 21) exitWith {"\A3\ui_f\data\map\markers\military\circle_CA.paa"};
  51. if (_markerIcon == 22) exitWith {"\A3\ui_f\data\map\mapcontrol\Hospital_CA.paa"};
  52. if (_markerIcon == 23) exitWith {"\A3\ui_f\data\map\markers\military\warning_CA.paa"};
  53. _color = cTabColorBlue;
  54. if (_markerIcon == 30) exitWith {"\A3\ui_f\data\map\markers\nato\b_hq.paa"};
  55. if (_markerIcon == 31) exitWith {"\A3\ui_f\data\map\markers\military\end_CA.paa"};
  56. ""
  57. };
  58. _markerSize = _this select 2;
  59. _texture2 = call {
  60. if (_markerSize == 0) exitWith {""};
  61. if (_markerSize == 1) exitWith {"\A3\ui_f\data\map\markers\nato\group_0.paa"};
  62. if (_markerSize == 2) exitWith {"\A3\ui_f\data\map\markers\nato\group_1.paa"};
  63. if (_markerSize == 3) exitWith {"\A3\ui_f\data\map\markers\nato\group_2.paa"};
  64. if (_markerSize == 4) exitWith {"\A3\ui_f\data\map\markers\nato\group_3.paa"};
  65. ""
  66. };
  67. _markerDir = _this select 3;
  68. _dir = call {
  69. if (_markerDir == 0) exitWith {400};
  70. if (_markerDir == 1) exitWith {0};
  71. if (_markerDir == 2) exitWith {45};
  72. if (_markerDir == 3) exitWith {90};
  73. if (_markerDir == 4) exitWith {135};
  74. if (_markerDir == 5) exitWith {180};
  75. if (_markerDir == 6) exitWith {225};
  76. if (_markerDir == 7) exitWith {270};
  77. if (_markerDir == 8) exitWith {315};
  78. 700
  79. };
  80. _text = _this select 4;
  81. _align = if ((_dir > 0) && (_dir < 180)) then {"left"} else {"right"};
  82. [_pos,_texture1,_texture2,_dir,_color,_text,_align]