// create diary records private _vehiclesByBase = call milsim_fbcb2_assets_fnc_getAssetsByBase; if (count _vehiclesByBase isEqualTo 0) exitWith {false}; private _vehicles = []; { _vehicles append (_x#1); } forEach _vehiclesByBase; if (count _vehicles isEqualTo 0) exitWith {false}; private _distinctVehiclesClassNames = []; { _distinctVehiclesClassNames pushBackUnique (typeOf _x); } forEach _vehicles; // ForEach unique vehicle class name, we'll find the first and gather its info { private _className = _x; private _vehiclesOfThisKind = _vehicles select {typeOf _x isEqualTo _className}; // This should never happen, but... if (count _vehiclesOfThisKind isEqualTo 0) then {continue}; // Take the first vehicle as a representative private _representativeVehicle = _vehiclesOfThisKind#0; private _vehicleCfg = configOf _representativeVehicle; // Process the vehicle for extended info // Exclusion list for display names if ( ((configOf _representativeVehicle) call BIS_fnc_displayName) in ["Helicopter"] ) then {continue}; // Get the vehicle data private _processed = [_representativeVehicle] call milsim_fbcb2_assets_fnc_getVehicleData; if (isNil "_processed") then {continue}; _processed params ["_vehicleCfg", "_displayName", "_diaryTextSections"]; _diaryTextSections params [ "_title", "_image", "_info", "_capacity" // "_weapons", // "_pylonWeapons", // "_inventory" ]; // Create the diary record private _recordText = []; // Add the title and image _recordText pushBack _title; _recordText pushBack _image; _recordText pushBack "
"; _recordText pushBack format[ "COUNT ACTIVE: %1", count _vehiclesOfThisKind ]; // Here, we'll create a link to show markers on the map for all vehicles of this kind private _randomColor = selectRandom [ ["ColorRed", "#FF0000", "Red"], ["ColorGreen", "#00FF00", "Green"], ["ColorBlue", "#0000FF", "Blue"], ["ColorYellow", "#FFFF00", "Yellow"], ["ColorWhite", "#FFFFFF", "White"] ]; private _vehicleCfg = configFile >> "CfgVehicles" >> _className; // get 'picture' for record private _icon = getText(_vehicleCfg >> "picture"); // determine marker type private _markerType = "mil_dot"; switch (true) do { case (_representativeVehicle isKindOf "Helicopter"): { _markerType = "loc_heli"; }; case (_representativeVehicle isKindOf "Air"): { _markerType = "loc_plane"; }; default { _markerType = "loc_truck"; }; }; _recordText pushBack format[ "SHOW MARKERS at vehicle positions (in %5)", _className, _markerType, _randomColor#0, (_vehiclesOfThisKind apply {getPosASL _x}), format["%2", _randomColor#1, _randomColor#2] ]; // Link to hide markers _recordText pushBack "REMOVE ALL MARKERS showing asset positions" + "
"; // Link to update asset diary entries _recordText pushBack "UPDATE ENTRIES for all assets" + "
"; // Add info and capacity sections _recordText pushBack _info; _recordText pushBack _capacity; [ milsim_fbcb2_subjectAssetsID, format[ "%1x %2", count _vehiclesOfThisKind, (configOf _representativeVehicle) call BIS_fnc_displayName ], _recordText joinString "
", _icon ] call milsim_fnc_createOrUpdateDiaryRecord; // "\A3\ui_f\data\igui\cfg\simpleTasks\types\car_ca.paa" } forEach _distinctVehiclesClassNames; true;