change root level folder name to framework, update resupply+vehicleflags
tested locally
This commit is contained in:
28
framework/fbcb2/util/fn_createOrUpdateDiaryRecord.sqf
Normal file
28
framework/fbcb2/util/fn_createOrUpdateDiaryRecord.sqf
Normal file
@@ -0,0 +1,28 @@
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
params [
|
||||
["_subjectID", milsim_fbcb2_subjectStatusID, [""]],
|
||||
["_recordTitle", "", [""]],
|
||||
["_recordText", "", [""]],
|
||||
["_recordIcon", "", [""]]
|
||||
];
|
||||
|
||||
// Check if already created
|
||||
private _subjectRecords = milsim_fbcb2_diaryRecords getOrDefault [_subjectID, createHashMap, true];
|
||||
private _existingRecord = _subjectRecords getOrDefault [_recordTitle, diaryRecordNull, true];
|
||||
|
||||
if (!isNull _existingRecord) then {
|
||||
player setDiaryRecordText [[_subjectID, _existingRecord], [_recordTitle, _recordText, _recordIcon]];
|
||||
systemChat format ["Updated diary record: %1", _recordTitle];
|
||||
} else {
|
||||
private _new = player createDiaryRecord [
|
||||
_subjectID,
|
||||
[
|
||||
_recordTitle,
|
||||
_recordText,
|
||||
_recordIcon
|
||||
]
|
||||
];
|
||||
_subjectRecords set [_recordTitle, _new];
|
||||
milsim_fbcb2_diaryRecords set [_subjectID, _subjectRecords];
|
||||
};
|
||||
Reference in New Issue
Block a user