fn_updateMission.sqf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. private ["_this", "_type", "_title", "_code", "_notif", "_description", "_hint", "_marker", "_markers", "_pos", "_x", "_cur", "_new", "_marker_marker", "_marker_icon"];
  2. _type = _this select 0;
  3. _title = switch (_type) do
  4. {
  5. case "tactical": { "Tactical" };
  6. case "ghost": { "Ghost" };
  7. case "sub": { "Sub-Objective" };
  8. case "priority": { "Priority" };
  9. };
  10. _code = _this select 1;
  11. _notif = "";
  12. _description = "";
  13. _hint = [];
  14. _marker = "";
  15. _markers = [];
  16. _pos = [];
  17. {
  18. switch (_x select 0) do
  19. {
  20. case "notification": { _notif = _x select 1; };
  21. case "description": { _description = _x select 1; };
  22. case "hint": { _hint = _x select 1; };
  23. case "marker": { _marker = _x select 1; };
  24. case "pos": { _pos = _x select 1; };
  25. };
  26. } forEach (_this select 2);
  27. if (_notif != "") then
  28. {
  29. [["type", format["%1_updated", _type]], ["message", format["UPDATE: %1", _notif]]] call AW_fnc_showNotification;
  30. };
  31. if (_description != "") then
  32. {
  33. _cur = _code call BIS_fnc_taskDescription;
  34. _new = format["%1<br/><br/>UPDATE: %2", (_cur select 0), _description];
  35. [_code, [_new, (_cur select 1), (_cur select 2)]] call BIS_fnc_taskSetDescription;
  36. };
  37. if ((count _hint) > 0) then
  38. {
  39. [[_hint, 15], "BIS_fnc_advHint", true, false] call BIS_fnc_MP;
  40. };
  41. if (_marker != "" && (count _pos) > 0) then
  42. {
  43. _marker_marker = [format["%1MarkerUpdate", _type], format["%1_update", _code], _pos] call AW_fnc_createJIPstateMarker;
  44. _marker_icon = [format["%1MarkerUpdateIcon", _type], format["%1_update_icon", _code], _pos, format["%1 Update: %2", _title, _marker]] call AW_fnc_createJIPstateMarker;
  45. _markers = [_marker_marker, _marker_icon];
  46. } else {
  47. _markers = ["", ""];
  48. };
  49. _markers