develop #24

Merged
hizumi merged 13 commits from develop into main 2024-02-08 19:05:41 -06:00
15 changed files with 56 additions and 23 deletions
Showing only changes of commit 2db018103c - Show all commits

View File

@@ -12,7 +12,6 @@ class CfgFunctions {
class addRespawnChatHandler { postInit = 1; }; class addRespawnChatHandler { postInit = 1; };
}; };
}; };
class PREFIX { class PREFIX {
class ambience { class ambience {
@@ -38,6 +37,7 @@ class CfgFunctions {
class addCBASettings { preInit = 1; }; class addCBASettings { preInit = 1; };
class logMissionInfo {}; class logMissionInfo {};
class addPlayerInfoToArray {}; class addPlayerInfoToArray {};
class createOrUpdateDiaryRecord {};
class getApprovedAssetsCfg {}; class getApprovedAssetsCfg {};
class getBattalionCfg {}; class getBattalionCfg {};
class getNameOfBase {}; class getNameOfBase {};
@@ -84,7 +84,6 @@ class CfgFunctions {
}; };
class util { class util {
file = "framework\fbcb2_main\util"; file = "framework\fbcb2_main\util";
class createOrUpdateDiaryRecord {};
class formatRadioElementForDiary {}; class formatRadioElementForDiary {};
class generateElementFrequencyRecordText {}; class generateElementFrequencyRecordText {};
}; };

View File

@@ -3,12 +3,21 @@
if (!hasInterface) exitWith {}; if (!hasInterface) exitWith {};
params [ params [
["_subjectID", GVAR(subjectStatusID), [""]], ["_subjectID", "", [""]],
["_recordTitle", "", [""]], ["_recordTitle", "", [""]],
["_recordText", "", [""]], ["_recordText", "", [""]],
["_recordIcon", "", [""]] ["_recordIcon", "", [""]]
]; ];
// Check if all parameters are provided
if (
count _subjectID isEqualTo 0 ||
count _recordTitle isEqualTo 0 ||
count _recordText isEqualTo 0
) exitWith {
[LEVEL_ERROR, QUOTE(COMPONENT), "Not all parameters provided"] call EFUNC(common,log);
};
// Check if already created // Check if already created
private _subjectRecords = GVAR(diaryRecords) getOrDefault [_subjectID, createHashMap, true]; private _subjectRecords = GVAR(diaryRecords) getOrDefault [_subjectID, createHashMap, true];
private _existingRecord = _subjectRecords getOrDefault [_recordTitle, diaryRecordNull, true]; private _existingRecord = _subjectRecords getOrDefault [_recordTitle, diaryRecordNull, true];

View File

@@ -21,7 +21,7 @@ call FUNC(updateAssetDiary);
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);

View File

@@ -241,7 +241,7 @@ private _randomColors = [
], ],
_recordText joinString "<br/>", _recordText joinString "<br/>",
_icon _icon
] call EFUNC(fbcb2_main,createOrUpdateDiaryRecord); ] call EFUNC(common,createOrUpdateDiaryRecord);
// "\A3\ui_f\data\igui\cfg\simpleTasks\types\car_ca.paa" // "\A3\ui_f\data\igui\cfg\simpleTasks\types\car_ca.paa"
} forEach _distinctVehiclesClassNames; } forEach _distinctVehiclesClassNames;

View File

@@ -109,4 +109,4 @@ _text = _text joinString "<br/>";
GVAR(subjectIntelID), GVAR(subjectIntelID),
_recordTitle, _recordTitle,
_text _text
] call FUNC(createOrUpdateDiaryRecord); ] call EFUNC(common,createOrUpdateDiaryRecord);

View File

@@ -62,7 +62,7 @@ reverse _battalionElementCfgs;
GVAR(subjectFrequenciesID), GVAR(subjectFrequenciesID),
_diaryTitleText#0, _diaryTitleText#0,
_diaryTitleText#1 _diaryTitleText#1
] call FUNC(createOrUpdateDiaryRecord); ] call EFUNC(common,createOrUpdateDiaryRecord);
} forEach _battalionElementCfgs; } forEach _battalionElementCfgs;
// add the battalion command to the top of the list // add the battalion command to the top of the list
@@ -72,6 +72,6 @@ private _diaryTitleText = [_battalionInfoCfg >> "Command", false] call FUNC(gene
GVAR(subjectFrequenciesID), GVAR(subjectFrequenciesID),
_diaryTitleText#0, _diaryTitleText#0,
_diaryTitleText#1 _diaryTitleText#1
] call FUNC(createOrUpdateDiaryRecord); ] call EFUNC(common,createOrUpdateDiaryRecord);
true; true;

View File

@@ -56,4 +56,4 @@ _text = _text joinString "<br/><br/>";
GVAR(subjectIntelID), GVAR(subjectIntelID),
_recordTitle, _recordTitle,
_text _text
] call FUNC(createOrUpdateDiaryRecord); ] call EFUNC(common,createOrUpdateDiaryRecord);

View File

@@ -25,12 +25,6 @@ player createDiarySubject[GVAR(subjectAssetsFixedWingID), "FBCB2 Planes"];
player createDiarySubject[GVAR(subjectAssetsRotaryID), "FBCB2 Helicopters"]; player createDiarySubject[GVAR(subjectAssetsRotaryID), "FBCB2 Helicopters"];
player createDiarySubject[GVAR(subjectAssetsGroundID), "FBCB2 Ground"]; player createDiarySubject[GVAR(subjectAssetsGroundID), "FBCB2 Ground"];
// store records in format:
// [subject, [
// [title, diaryRecord]
// ]]
GVAR(diaryRecords) = createHashMap;
// run main inits // run main inits
[] call FUNC(addFrequenciesRecord); [] call FUNC(addFrequenciesRecord);
[] call FUNC(addSignalColorsRecord); [] call FUNC(addSignalColorsRecord);
@@ -47,7 +41,7 @@ GVAR(diaryRecords) = createHashMap;
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);

View File

@@ -24,7 +24,7 @@
[ [
LEVEL_INFO, LEVEL_INFO,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"Respawn chat handler registered", "respawn chat handler registered",
[player] call EFUNC(common,addPlayerInfoToArray) [player] call EFUNC(common,addPlayerInfoToArray)
] call EFUNC(common,log); ] call EFUNC(common,log);

View File

@@ -14,9 +14,17 @@ waitUntil {!isNil QGVARMAIN(complete)};
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups; ["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
// Initialize a holder for managing local diary records
// store records in format:
// [subject, [
// [title, diaryRecord]
// ]]
EGVAR(common,diaryRecords) = createHashMap;
// initialize other modules // initialize other modules
call EFUNC(mapcopy,initClient); call EFUNC(mapcopy,initClient);
call EFUNC(rasptools,initClient);
call EFUNC(reinsert,initClient); call EFUNC(reinsert,initClient);
call EFUNC(resupply,initClient); call EFUNC(resupply,initClient);
call EFUNC(triageIcons,initClient); call EFUNC(triageIcons,initClient);
@@ -28,8 +36,10 @@ call EFUNC(fbcb2_assets,initClient);
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true];
nil; nil;

View File

@@ -45,4 +45,13 @@ private _mapCopyAction =
} else { } else {
format["You need a map to copy onto!"] call CBA_fnc_notify; format["You need a map to copy onto!"] call CBA_fnc_notify;
}; };
}] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler;
[
LEVEL_DEBUG,
QUOTE(COMPONENT),
"initClient complete",
[]
] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true];

View File

@@ -47,6 +47,8 @@ if ((typeOf player) in ["B_Helipilot_F", "B_helicrew_F"]) then {
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true];

View File

@@ -7,7 +7,7 @@ call FUNC(addArsenalObjectSpawnBoxActions);
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);

View File

@@ -6,7 +6,8 @@ GVAR(drawTargets) = [];
[ [
LEVEL_DEBUG, LEVEL_DEBUG,
QUOTE(COMPONENT), QUOTE(COMPONENT),
"postInit complete", "initClient complete",
[] []
] call EFUNC(common,log); ] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true]; localNamespace setVariable [QGVAR(complete), true];

View File

@@ -98,4 +98,13 @@ private _flagCategoryCfgs = (_vehicleFlagsCfg >> "FlagCategories") call BIS_fnc_
} forEach _baseClassesToApplyActionsFor; } forEach _baseClassesToApplyActionsFor;
[
LEVEL_DEBUG,
QUOTE(COMPONENT),
"initClient complete",
[]
] call EFUNC(common,log);
localNamespace setVariable [QGVAR(complete), true];
nil; nil;