fn_drawMarkers.sqf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Name: cTab_fnc_drawMarkers
  3. Author(s):
  4. Gundy
  5. Description:
  6. Draw map markers provided by allMapMarkers.
  7. Parameters:
  8. 0: OBJECT - Map control to draw BFT icons on
  9. Returns:
  10. BOOLEAN - Always TRUE
  11. Example:
  12. [_ctrlScreen] call cTab_fnc_drawMarkers;
  13. */
  14. private ["_ctrlScreen","_marker","_pos","_type","_size","_icon","_colorType","_color","_brush","_brushType","_shape","_alpha","_dir","_text"];
  15. _ctrlScreen = _this select 0;
  16. {
  17. _marker = _x;
  18. _pos = getMarkerPos _marker;
  19. _type = getMarkerType _marker;
  20. _size = getMarkerSize _marker;
  21. _icon = getText(configFile/"CfgMarkers"/_type/"Icon");
  22. _colorType = getMarkerColor _marker;
  23. if (_icon != "" && {_colorType == "Default"}) then {
  24. _color = getArray(configFile/"CfgMarkers"/_type/"color");
  25. } else {
  26. _color = getArray(configFile/"CfgMarkerColors"/_colorType/"color");
  27. };
  28. if (typeName (_color select 0) == "STRING") then {
  29. _color = [
  30. call compile (_color select 0),
  31. call compile (_color select 1),
  32. call compile (_color select 2),
  33. call compile (_color select 3)
  34. ];
  35. };
  36. _brushType = markerBrush _marker;
  37. _brush = getText(configFile/"CfgMarkerBrushes"/_brushType/"texture");
  38. _shape = markerShape _marker;
  39. _alpha = markerAlpha _marker;
  40. _dir = markerDir _marker;
  41. _text = markerText _marker;
  42. switch (_shape) do {
  43. case "ICON": {
  44. _ctrlScreen drawIcon [_icon,_color,_pos,(_size select 0) * cTabIconSize,(_size select 1) * cTabIconSize,_dir,_text,0,cTabTxtSize,"TahomaB","right"];
  45. };
  46. case "RECTANGLE": {
  47. _ctrlScreen drawRectangle [_pos,_size select 0,_size select 1,_dir,_color,_brush];
  48. };
  49. case "ELLIPSE": {
  50. _ctrlScreen drawEllipse [_pos,_size select 0,_size select 1,_dir,_color,_brush];
  51. };
  52. };
  53. } forEach allMapMarkers;
  54. true