defines battalion info, integrates FBCB2 freqs and callsigns

This commit is contained in:
2024-02-01 01:23:21 -08:00
parent 8c40b107a5
commit 2d6fbcfcef
8 changed files with 404 additions and 33 deletions

View File

@@ -1,35 +1,108 @@
// updated 2024-02-01 by IndigoFox
// now reads from the battalion config structure
_text = "
<font size='24' color='#ff0000'>=======------ Mission Data Set ------=======</font>
<br/><br/>
<font size='16' color='#4A86E8'>EXODUS</font>
<br/>
<font color='#FF0000'>6 - 45</font>
<br/>
<font color='#FF0000'>RTO - 45 / 35</font>
<br/><br/>
<font size='16' color='#6AA84F'>RIPTIDE</font>
<br/>
<font color='#FF0000'>Actual - 45 / 100</font>
<br/>
<font color='#FF0000'>Romeo - 45 / 35</font>
<br/>
<font color='#FF0000'>1 - 110 / 100</font>
<br/>
<font color='#FF0000'>2 - 120 / 100</font>
<br/>
<font color='#FF0000'>3 - 130 / 110</font>
<br/>
<font color='#FF0000'>Blackfoot - 150 / 100</font>
<br/><br/>
<font size='16' color='#F1C232'>ECHO</font>
<br/>
<font color='#FF0000'>Impaler - 45 / 35</font>
<br/>
<font color='#FF0000'>JTAC - 35 / 82</font>
<br/>
<font color='#FF0000'>IDF - 82 / 100</font>
<br/><br/>
";
private _formatElementForDiary = {
params ["_cfg", "_indentCount"];
player createDiaryRecord ["Status", ["MDS - INTEL - RADIO FREQS", _text]];
private _leadingSpace = [
format["<font size='%1'>| ", _ELEMENT_NAME_SIZE]
];
for "_i" from 1 to _indentCount do {
_leadingSpace pushBack "-";
};
_leadingSpace pushBack " | </font>";
// make header line
private _lines = [
format[
"<font size='%1' face='EtelkaMonospaceProBold' color='%2'>%3%4</font>",
_ELEMENT_NAME_SIZE,
getText(_cfg >> "textColor"),
_leadingSpace joinString "",
getText (_cfg >> "callsign")
]
];
// make frequency lines
private _freqLeadingSpace = [
format["<font size='%1'>| ", _ELEMENT_NAME_SIZE]
];
for "_i" from 1 to _indentCount + 4 do {
_freqLeadingSpace pushBack " ";
};
_freqLeadingSpace pushBack "</font>";
_freqLeadingSpace = _freqLeadingSpace joinString "";
{
_x params ["_role", "_sr", "_lr"];
private ["_srStr", "_lrStr"];
if (count _sr > 0) then {
_srStr = format["SR [%1]", _sr joinString "/"];
} else {
_srStr = "----";
};
if (count _lr > 0) then {
_lrStr = format["LR [%1]", _lr joinString "/"];
} else {
_lrStr = "----";
};
_lines pushBack format[
"%1<font size='%2' color='%3'>- %4%5%6 -</font>",
_freqLeadingSpace,
_ELEMENT_FREQ_SIZE,
_FREQ_TEXT_COLOR,
[_role, "right", " ", _FREQ_PAD_LENGTH] call milsim_fnc_padString,
[_srStr, "right", " ", _FREQ_PAD_LENGTH] call milsim_fnc_padString,
[_lrStr, "right", " ", 8] call milsim_fnc_padString
];
} forEach (getArray (_cfg >> "frequencies"));
_lines;
};
private _addToAllText = {
params [["_lines", []]];
_allText = format[
"%1%2<br/>",
_allText,
_lines joinString "<br/>"
];
};
private _recurseAddElements = {
params ["_cfg", ["_indentCount", 1]];
// add config
private _lines = [_cfg, _indentCount] call _formatElementForDiary;
[_lines] call _addToAllText;
// get children and recurse
_childCfgs = _cfg call BIS_fnc_returnChildren;
{
[_x, _indentCount+1] call _recurseAddElements;
} forEach _childCfgs;
};
////////////////////////////////////////
_allText = "
<font size='16' color='#ff0000'>=======------ Mission Data Set ------=======</font>
<font face='EtelkaMonospacePro'><br/><br/>";
private _battalionInfoCfgs = [call milsim_fnc_getBattalionCfg] call BIS_fnc_returnChildren;
private _ELEMENT_NAME_SIZE = 10;
private _ELEMENT_FREQ_SIZE = 8;
private _FREQ_PAD_LENGTH = 14;
private _FREQ_TEXT_COLOR = "#CCCCCC";
{
_x call _recurseAddElements;
} forEach _battalionInfoCfgs;
_allText = format["%1</font>", _allText];
player createDiaryRecord ["Status", ["MDS - INTEL - RADIO FREQS", _allText]];