// updated 2024-02-01 by IndigoFox // now reads from the battalion config structure to generate the diary entries //////////////////////////////////////// // Get info from missionConfigFile //////////////////////////////////////// private _battalionInfoCfg = call milsim_fnc_getBattalionCfg; private _battalionElementCfgs = [_battalionInfoCfg >> "Command"] call BIS_fnc_returnChildren; //////////////////////////////////////// // Define formatting constants //////////////////////////////////////// private _ELEMENT_NAME_SIZE = 10; private _ELEMENT_NAME_FONT = "EtelkaMonospaceProBold"; private _ELEMENT_FREQ_SIZE = 9; private _ELEMENT_FREQ_FONT = "EtelkaMonospacePro"; private _FREQ_INDENT_CONSTANT = 6; private _FREQ_PAD_LENGTH = 17; private _FREQ_TEXT_COLOR = "#CCCCCC"; // Note: Element colors are defined in the battalion config //////////////////////////////////////// // ADD DIARY ENTRIES //////////////////////////////////////// // First is all the battalion-level elements beneath command // To have the records listed in the order they appear in the battalion config, we need to reverse the array // Since each entry is added to the top of the list, this will result in the entries being added in the correct order reverse _battalionElementCfgs; { // recursively generate diary text for all child elements of battalion-level elements private _diaryTitleText = [_x, true] call milsim_fnc_generateElementFrequencyRecordText; [ milsim_fbcb2_subjectFrequenciesID, _diaryTitleText#0, _diaryTitleText#1 ] call milsim_fnc_createOrUpdateDiaryRecord; } forEach _battalionElementCfgs; // add the battalion command to the top of the list // don't process child elements private _diaryTitleText = [_battalionInfoCfg >> "Command", false] call milsim_fnc_generateElementFrequencyRecordText; [ milsim_fbcb2_subjectFrequenciesID, _diaryTitleText#0, _diaryTitleText#1 ] call milsim_fnc_createOrUpdateDiaryRecord; true;