ready for dedi -- improvements to resupply, triageIcons too

This commit is contained in:
2024-02-06 17:36:01 -08:00
parent 0a64d9e170
commit 91b982e06e
44 changed files with 586 additions and 354 deletions

View File

@@ -14,6 +14,7 @@ if (isNull _battalionInfoCfg) exitWith {
"Null Battalion Config",
[]
] call EFUNC(common,log);
["Null Battalion Config"] call BIS_fnc_error;
};
private _battalionElementCfgs = [_battalionInfoCfg >> "Command"] call BIS_fnc_returnChildren;
@@ -24,6 +25,7 @@ if (count _battalionElementCfgs == 0) exitWith {
"ERROR: No battalion elements found. Check that the battalion config is correctly structured. See defines/BattalionInfo.hpp and framework/util/functions/getBattalionCfg.sqf.",
[]
] call EFUNC(common,log);
["ERROR: No battalion elements found. Check that the battalion config is correctly structured. See defines/BattalionInfo.hpp and framework/util/functions/getBattalionCfg.sqf."] call BIS_fnc_error;
};
////////////////////////////////////////
@@ -48,12 +50,12 @@ private _FREQ_TEXT_COLOR = "#CCCCCC";
reverse _battalionElementCfgs;
{
diag_log text format[
"[%1] <%2> Processing battalion element %3",
QUOTE(PREFIX),
_fnc_scriptName,
configName _x
];
[
LEVEL_TRACE,
QUOTE(COMPONENT),
format["Processing battalion element %1", configName _x],
[]
] call EFUNC(common,log);
// recursively generate diary text for all child elements of battalion-level elements
private _diaryTitleText = [_x, true] call FUNC(generateElementFrequencyRecordText);
[

View File

@@ -2,8 +2,6 @@
if ( !hasInterface ) exitWith {};
waitUntil { !isNil QGVARMAIN(complete) };
GVAR(recordTitleColor) = "#ff6666";
GVAR(recordTitleFont) = "PuristaMedium";
GVAR(recordTitleSize) = 20;
@@ -33,7 +31,7 @@ player createDiarySubject[GVAR(subjectAssetsGroundID), "FBCB2 Ground"];
// ]]
GVAR(diaryRecords) = createHashMap;
// run main inits - assets handled in that component
// run main inits
[] call FUNC(addFrequenciesRecord);
[] call FUNC(addSignalColorsRecord);
[] call FUNC(addEnvironmentRecord);
@@ -51,4 +49,6 @@ GVAR(diaryRecords) = createHashMap;
QUOTE(COMPONENT),
"postInit complete",
[]
] call EFUNC(common,log);
] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true];

View File

@@ -15,9 +15,16 @@ private _existingRecord = _subjectRecords getOrDefault [_recordTitle, diaryRecor
if (!isNull _existingRecord) then {
player setDiaryRecordText [[_subjectID, _existingRecord], [_recordTitle, _recordText, _recordIcon]];
if (DEBUG_ENABLED) then {
systemChat format ["Updated diary record: %1", _recordTitle];
};
[
LEVEL_DEBUG,
QUOTE(COMPONENT),
format ["Updated diary record: %1", _recordTitle],
[
["subjectID", _subjectID],
["recordTitle", _recordTitle]
]
] call EFUNC(common,log);
} else {
private _new = player createDiaryRecord [
_subjectID,
@@ -29,4 +36,14 @@ if (!isNull _existingRecord) then {
];
_subjectRecords set [_recordTitle, _new];
GVAR(diaryRecords) set [_subjectID, _subjectRecords];
[
LEVEL_DEBUG,
QUOTE(COMPONENT),
format ["Created diary record: %1", _recordTitle],
[
["subjectID", _subjectID],
["recordTitle", _recordTitle]
]
] call EFUNC(common,log);
};

View File

@@ -71,7 +71,8 @@ if (_shouldProcessChildCfgs) then {
[
LEVEL_TRACE,
QUOTE(COMPONENT),
"Processing child elements for battalion element %1"
"Processing child elements for battalion element %1",
[]
] call EFUNC(common,log);
[_battalionElement, {