diff --git a/addons/bft/CfgWeapons.hpp b/addons/bft/CfgWeapons.hpp index 829c4209e5..2e07172cad 100644 --- a/addons/bft/CfgWeapons.hpp +++ b/addons/bft/CfgWeapons.hpp @@ -1,6 +1,6 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class ACE_bftItemBase: ACE_ItemCore { author = "$STR_ACE_Common_ACETeam"; scope = 2; @@ -15,7 +15,7 @@ class CfgWeapons { // Magazine type for unique IDs. This is the magazine classname by which this item will be replaced. Will be replaced once BI implements unique Ids for items. GVAR(magazineItem) = "ACE_bftMagazineBase"; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 1; }; }; diff --git a/addons/bft/XEH_postInit.sqf b/addons/bft/XEH_postInit.sqf index a75e027e33..a32dee42a3 100644 --- a/addons/bft/XEH_postInit.sqf +++ b/addons/bft/XEH_postInit.sqf @@ -1,27 +1,27 @@ #include "script_component.hpp" -["bft_itemCreated", FUNC(handleItemCreated)] call EFUNC(common,addEventHandler); -["bft_addDeviceData", FUNC(handleAddDeviceData)] call EFUNC(common,addEventHandler); -["bft_updateDeviceOwner", FUNC(handleUpdateDeviceOwner)] call EFUNC(common,addEventHandler); -["bft_updateDeviceGroup", FUNC(handleUpdateDeviceGroup)] call EFUNC(common,addEventHandler); -["bft_updateDeviceElementType", FUNC(handleUpdateDeviceElementType)] call EFUNC(common,addEventHandler); -["bft_updateDeviceCallsign", FUNC(handleUpdateDeviceCallsign)] call EFUNC(common,addEventHandler); -["bft_updateDeviceKeys", FUNC(handleUpdateDeviceKeys)] call EFUNC(common,addEventHandler); -["bft_updateDeviceAppData", FUNC(handleUpdateDeviceAppData)] call EFUNC(common,addEventHandler); +["bft_itemCreated", FUNC(handleItemCreated)] call CBA_fnc_addEventHandler; +["bft_addDeviceData", FUNC(handleAddDeviceData)] call CBA_fnc_addEventHandler; +["bft_updateDeviceOwner", FUNC(handleUpdateDeviceOwner)] call CBA_fnc_addEventHandler; +["bft_updateDeviceGroup", FUNC(handleUpdateDeviceGroup)] call CBA_fnc_addEventHandler; +["bft_updateDeviceElementType", FUNC(handleUpdateDeviceElementType)] call CBA_fnc_addEventHandler; +["bft_updateDeviceCallsign", FUNC(handleUpdateDeviceCallsign)] call CBA_fnc_addEventHandler; +["bft_updateDeviceKeys", FUNC(handleUpdateDeviceKeys)] call CBA_fnc_addEventHandler; +["bft_updateDeviceAppData", FUNC(handleUpdateDeviceAppData)] call CBA_fnc_addEventHandler; -["bft_syncedArrayDelete", FUNC(handleSyncedArrayDelete)] call EFUNC(common,addEventHandler); -["bft_syncedArrayPushback", FUNC(handleSyncedArrayPushback)] call EFUNC(common,addEventHandler); -["bft_syncedArrayUpdate", FUNC(handleSyncedArrayUpdate)] call EFUNC(common,addEventHandler); +["bft_syncedArrayDelete", FUNC(handleSyncedArrayDelete)] call CBA_fnc_addEventHandler; +["bft_syncedArrayPushback", FUNC(handleSyncedArrayPushback)] call CBA_fnc_addEventHandler; +["bft_syncedArrayUpdate", FUNC(handleSyncedArrayUpdate)] call CBA_fnc_addEventHandler; -["bft_vehicleDeviceKilled", FUNC(handleVehicleDeviceKilled)] call EFUNC(common,addEventHandler); +["bft_vehicleDeviceKilled", FUNC(handleVehicleDeviceKilled)] call CBA_fnc_addEventHandler; -if(!isServer) then { +if (!isServer) then { ["PlayerJip", { diag_log text format["[ACE] * JIP BFT Data Synchronization initialized"]; - ["bft_requestAllData", [player]] call EFUNC(common,serverEvent); - }] call EFUNC(common,addEventHandler); + ["bft_requestAllData", [ace_player]] call CBA_fnc_serverEvent; + }] call CBA_fnc_addEventHandler; } else { - ["bft_requestAllData", FUNC(handleRequestAllData)] call EFUNC(common,addEventHandler); + ["bft_requestAllData", FUNC(handleRequestAllData)] call CBA_fnc_addEventHandler; /*[QGVAR(messages), [0, "Message content!"]] call FUNC(syncedArrayPushback); [QGVAR(messages), ["0/1", "Message content!"]] call FUNC(syncedArrayPushback); @@ -42,12 +42,13 @@ if(!isServer) then { if (!hasInterface) exitWith {}; -["playerInventoryChanged", FUNC(validateInventory)] call EFUNC(common,addEventHandler); -["playerChanged", FUNC(validateInventory)] call EFUNC(common,addEventHandler); +["loadout", FUNC(validateInventory)] call CBA_fnc_addPlayerEventHandler; +["unit", FUNC(validateInventory)] call CBA_fnc_addPlayerEventHandler; +["vehicle", {[ACE_player, objNull] call FUNC(validateInventory)}] call CBA_fnc_addPlayerEventHandler; // Necessary? -["bft_deviceDataChanged", FUNC(handleDeviceDataChanged)] call EFUNC(common,addEventHandler); -["bft_registeredEncryptionKeysChanged", FUNC(handleRegisteredEncryptionKeysChanged)] call EFUNC(common,addEventHandler); -["bft_registeredModeChanged", FUNC(handleRegisteredModeChanged)] call EFUNC(common,addEventHandler); -["bft_colorFilteringChanged", FUNC(handleColorFilteringChanged)] call EFUNC(common,addEventHandler); -["bft_deviceOpened", FUNC(handleDeviceOpened)] call EFUNC(common,addEventHandler); -["bft_deviceClosed", FUNC(handleDeviceClosed)] call EFUNC(common,addEventHandler); +["bft_deviceDataChanged", FUNC(handleDeviceDataChanged)] call CBA_fnc_addEventHandler; +["bft_registeredEncryptionKeysChanged", FUNC(handleRegisteredEncryptionKeysChanged)] call CBA_fnc_addEventHandler; +["bft_registeredModeChanged", FUNC(handleRegisteredModeChanged)] call CBA_fnc_addEventHandler; +["bft_colorFilteringChanged", FUNC(handleColorFilteringChanged)] call CBA_fnc_addEventHandler; +["bft_deviceOpened", FUNC(handleDeviceOpened)] call CBA_fnc_addEventHandler; +["bft_deviceClosed", FUNC(handleDeviceClosed)] call CBA_fnc_addEventHandler; diff --git a/addons/bft/functions/fnc_checkItem.sqf b/addons/bft/functions/fnc_checkItem.sqf index 5711de2656..d6d57476d3 100644 --- a/addons/bft/functions/fnc_checkItem.sqf +++ b/addons/bft/functions/fnc_checkItem.sqf @@ -45,7 +45,7 @@ if (isText (configFile >> "CfgWeapons" >> _item >> QGVAR(deviceType)) && {getTex if (_magID != "") then { GVAR(pendingIdAssignmentList) pushback _magID; - ["bft_itemCreated", [_unit, _item, _magazine, _magID]] call EFUNC(common,serverEvent); + ["bft_itemCreated", [_unit, _item, _magazine, _magID]] call CBA_fnc_serverEvent; }; }; }; diff --git a/addons/bft/functions/fnc_handleAddDeviceData.sqf b/addons/bft/functions/fnc_handleAddDeviceData.sqf index e9c0238d47..8a93fc95aa 100644 --- a/addons/bft/functions/fnc_handleAddDeviceData.sqf +++ b/addons/bft/functions/fnc_handleAddDeviceData.sqf @@ -40,4 +40,4 @@ if (local (_this select 5)) then { diag_log format["handleAdd - not the owner of device: %1", (_this select 5)]; }; -["bft_deviceDataChanged", [_this, true]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_this, true]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleItemCreated.sqf b/addons/bft/functions/fnc_handleItemCreated.sqf index a901d2298c..ca3df223dd 100644 --- a/addons/bft/functions/fnc_handleItemCreated.sqf +++ b/addons/bft/functions/fnc_handleItemCreated.sqf @@ -95,5 +95,5 @@ _deviceInformation = [_magID, [_deviceSide, _deviceEncryptionKeys], _assignableI diag_log format["Prep raising bft_addDeviceData _deviceInformation with: %1", _deviceInformation]; [{ diag_log format["exec bft_addDeviceData _deviceInformation with: %1", _this]; - ["bft_addDeviceData", _this] call EFUNC(common,globalEvent); -}, _deviceInformation, 1] call EFUNC(common,waitAndExecute); + ["bft_addDeviceData", _this] call CBA_fnc_globalEvent; +}, _deviceInformation, 1] call CBA_fnc_waitAndExecute; diff --git a/addons/bft/functions/fnc_handleKilled.sqf b/addons/bft/functions/fnc_handleKilled.sqf index 26ac208b36..df1e30ca98 100644 --- a/addons/bft/functions/fnc_handleKilled.sqf +++ b/addons/bft/functions/fnc_handleKilled.sqf @@ -22,5 +22,5 @@ private _ownedDevices = _object getvariable [QGVAR(ownedDevices), []]; { systemChat format["raising event vehicleDeviceKilled: %1 ", _x]; diag_log format["raising event vehicleDeviceKilled: %1 ", _x]; - ["bft_vehicleDeviceKilled", [_x]] call EFUNC(common,globalEvent); + ["bft_vehicleDeviceKilled", [_x]] call CBA_fnc_globalEvent; } forEach _ownedDevices; diff --git a/addons/bft/functions/fnc_handleRequestAllData.sqf b/addons/bft/functions/fnc_handleRequestAllData.sqf index 8127e0d804..aebcb026d5 100644 --- a/addons/bft/functions/fnc_handleRequestAllData.sqf +++ b/addons/bft/functions/fnc_handleRequestAllData.sqf @@ -19,7 +19,7 @@ diag_log format["handleRequestAllData: Request from Origin: %1", _origin]; { diag_log format["handleRequestAllData: Add Device Data to origin: %1", _x]; - ["bft_addDeviceData", _origin, _x] call EFUNC(common,targetEvent); + ["bft_addDeviceData", _origin, _x] call CBA_fnc_targetEvent; } forEach GVAR(deviceData); // Alternative: @@ -35,7 +35,7 @@ diag_log format["handleRequestAllData: Request from Origin: %1", _origin]; { diag_log format["handleRequestAllData: Add synced array variable (%1) value: %2", _varName, _x]; - ["bft_syncedArrayPushback", _origin, [_varName, _x]] call EFUNC(common,targetEvent); + ["bft_syncedArrayPushback", _origin, [_varName, _x]] call CBA_fnc_targetEvent; } forEach _variable; // Alternative: diff --git a/addons/bft/functions/fnc_handleSyncedArrayDelete.sqf b/addons/bft/functions/fnc_handleSyncedArrayDelete.sqf index d0ef72c1a3..24d11a38a8 100644 --- a/addons/bft/functions/fnc_handleSyncedArrayDelete.sqf +++ b/addons/bft/functions/fnc_handleSyncedArrayDelete.sqf @@ -26,7 +26,7 @@ _variable = missionNamespace getvariable [_varName, []]; diag_log format["handleSyncedArrayDelete deleting- %1", _x]; private ["_removedElement"]; _removedElement = _variable deleteAt _foreachIndex; - ["bft_syncedArrayChanged", [2, _removedElement]] call EFUNC(common,localEvent); + ["bft_syncedArrayChanged", [2, _removedElement]] call CBA_fnc_localEvent; }; } forEach _variable; diff --git a/addons/bft/functions/fnc_handleSyncedArrayPushback.sqf b/addons/bft/functions/fnc_handleSyncedArrayPushback.sqf index fee5e984d3..e1ba306826 100644 --- a/addons/bft/functions/fnc_handleSyncedArrayPushback.sqf +++ b/addons/bft/functions/fnc_handleSyncedArrayPushback.sqf @@ -25,7 +25,7 @@ _variable = missionNamespace getvariable [_varName, []]; _variable pushback _data; missionNamespace setvariable [_varName, _variable]; -["bft_syncedArrayChanged", [0, _data]] call EFUNC(common,localEvent); +["bft_syncedArrayChanged", [0, _data]] call CBA_fnc_localEvent; systemChat format["handleSyncedArrayPushback %1 - %2", _varName, _variable]; diag_log format["handleSyncedArrayPushback %1 - %2", _varName, _variable]; diff --git a/addons/bft/functions/fnc_handleSyncedArrayUpdate.sqf b/addons/bft/functions/fnc_handleSyncedArrayUpdate.sqf index b1fcfa94d8..38649c108c 100644 --- a/addons/bft/functions/fnc_handleSyncedArrayUpdate.sqf +++ b/addons/bft/functions/fnc_handleSyncedArrayUpdate.sqf @@ -29,7 +29,7 @@ _variable = missionNamespace getvariable [_varName, []]; _compareID = if (typeName _x == "ARRAY") then {_x select 0} else {_x}; if (_compareID isEqualTo _elementID) exitwith { _variable set[_forEachIndex, _data]; - ["bft_syncedArrayChanged", [1, _data, _x]] call EFUNC(common,localEvent); + ["bft_syncedArrayChanged", [1, _data, _x]] call CBA_fnc_localEvent; }; } forEach _variable; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceAppData.sqf b/addons/bft/functions/fnc_handleUpdateDeviceAppData.sqf index 9b99ff3397..322283bad6 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceAppData.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceAppData.sqf @@ -20,4 +20,4 @@ private ["_data"]; _data = [_deviceID] call FUNC(getDeviceData); _data set [3, _newData]; -// ["bft_deviceDataChanged", [_data, false]] call EFUNC(common,localEvent); +// ["bft_deviceDataChanged", [_data, false]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceCallsign.sqf b/addons/bft/functions/fnc_handleUpdateDeviceCallsign.sqf index 163255ebfb..965c3af479 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceCallsign.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceCallsign.sqf @@ -21,4 +21,4 @@ _data = [_deviceID] call FUNC(getDeviceData); _deviceAssignableInfo = _data select 2; _deviceAssignableInfo set [2, _callsign]; -["bft_deviceDataChanged", [_data, false]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_data, false]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceElementType.sqf b/addons/bft/functions/fnc_handleUpdateDeviceElementType.sqf index 012c389b93..bf187d90d5 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceElementType.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceElementType.sqf @@ -22,4 +22,4 @@ _assignableInformation = _data select 2; _assignableInformation set [0, _elementType select 0]; _assignableInformation set [1, _elementType select 1]; -["bft_deviceDataChanged", [_data, false]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_data, false]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceGroup.sqf b/addons/bft/functions/fnc_handleUpdateDeviceGroup.sqf index 1cb93f4c70..878b1f98a1 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceGroup.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceGroup.sqf @@ -21,4 +21,4 @@ _data = [_deviceID] call FUNC(getDeviceData); _previousGroup = _data select 2; _previousGroup set [3, _groupID]; -["bft_deviceDataChanged", [_data, false]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_data, false]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceKeys.sqf b/addons/bft/functions/fnc_handleUpdateDeviceKeys.sqf index 5b718aabdd..8068190948 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceKeys.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceKeys.sqf @@ -21,4 +21,4 @@ _data = [_deviceID] call FUNC(getDeviceData); _encryption = _data select 1; _encryption set [1, _keys]; -["bft_deviceDataChanged", [_data, false]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_data, false]] call CBA_fnc_localEvent; diff --git a/addons/bft/functions/fnc_handleUpdateDeviceOwner.sqf b/addons/bft/functions/fnc_handleUpdateDeviceOwner.sqf index 8b3aba14be..3ef71170bb 100644 --- a/addons/bft/functions/fnc_handleUpdateDeviceOwner.sqf +++ b/addons/bft/functions/fnc_handleUpdateDeviceOwner.sqf @@ -25,7 +25,7 @@ _data = [_deviceID] call FUNC(getDeviceData); _previousOwner = _data select 5; _data set [5, _newOwner]; -["bft_deviceDataChanged", [_data, isNull _previousOwner]] call EFUNC(common,localEvent); +["bft_deviceDataChanged", [_data, isNull _previousOwner]] call CBA_fnc_localEvent; systemChat format["handleUpdateDeviceOwner - setting new owner from %1 to %2", _previousOwner, _newOwner]; diag_log format["handleUpdateDeviceOwner - setting new owner from %1 to %2", _previousOwner, _newOwner]; diff --git a/addons/bft/functions/fnc_setDeviceAppData.sqf b/addons/bft/functions/fnc_setDeviceAppData.sqf index b44977e889..d6a49c45c5 100644 --- a/addons/bft/functions/fnc_setDeviceAppData.sqf +++ b/addons/bft/functions/fnc_setDeviceAppData.sqf @@ -22,4 +22,4 @@ _data = [_deviceID] call FUNC(getDeviceData); if (count _data == 0) exitwith {}; if (_deviceData isEqualTo (_data select 3)) exitwith {}; -["bft_updateDeviceData", [_deviceID, _deviceData]] call EFUNC(common,globalEvent); +["bft_updateDeviceData", [_deviceID, _deviceData]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_setDeviceCallsign.sqf b/addons/bft/functions/fnc_setDeviceCallsign.sqf index 67dd6cff96..4310a70d5e 100644 --- a/addons/bft/functions/fnc_setDeviceCallsign.sqf +++ b/addons/bft/functions/fnc_setDeviceCallsign.sqf @@ -23,4 +23,4 @@ if (count _data < 3) exitwith {}; if (count (_data select 2) < 3) exitwith {}; if (_callsign isEqualTo (_data select 2) select 2) exitwith {}; -["bft_updateDeviceCallsign", [_deviceID, _callsign]] call EFUNC(common,globalEvent); +["bft_updateDeviceCallsign", [_deviceID, _callsign]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_setDeviceElementType.sqf b/addons/bft/functions/fnc_setDeviceElementType.sqf index fa42a33eb6..e64b0ad36a 100644 --- a/addons/bft/functions/fnc_setDeviceElementType.sqf +++ b/addons/bft/functions/fnc_setDeviceElementType.sqf @@ -24,4 +24,4 @@ if (count (_data select 2) < 2) exitwith {}; if ((_elementType select 0) isEqualTo (_data select 2) select 0) exitwith {}; if ((_elementType select 1) isEqualTo (_data select 2) select 1) exitwith {}; -["bft_updateDeviceElementType", [_deviceID, _elementType]] call EFUNC(common,globalEvent); +["bft_updateDeviceElementType", [_deviceID, _elementType]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_setDeviceGroup.sqf b/addons/bft/functions/fnc_setDeviceGroup.sqf index be6cae07df..8a91e9c7fc 100644 --- a/addons/bft/functions/fnc_setDeviceGroup.sqf +++ b/addons/bft/functions/fnc_setDeviceGroup.sqf @@ -23,4 +23,4 @@ if (count _data < 3) exitwith {}; if (count (_data select 2) < 4) exitwith {}; if (_groupID isEqualTo (_data select 2) select 3) exitwith {}; -["bft_updateDeviceGroup", [_deviceID, _groupID]] call EFUNC(common,globalEvent); +["bft_updateDeviceGroup", [_deviceID, _groupID]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_setDeviceKeys.sqf b/addons/bft/functions/fnc_setDeviceKeys.sqf index 744fb0d6db..8cc17a74f8 100644 --- a/addons/bft/functions/fnc_setDeviceKeys.sqf +++ b/addons/bft/functions/fnc_setDeviceKeys.sqf @@ -23,4 +23,4 @@ if (count _data < 2) exitwith {}; if (count (_data select 1) < 2) exitwith {}; if (_keys isEqualTo (_data select 1) select 1) exitwith {}; -["bft_updateDeviceKeys", [_deviceID, _keys]] call EFUNC(common,globalEvent); +["bft_updateDeviceKeys", [_deviceID, _keys]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_setDeviceOwner.sqf b/addons/bft/functions/fnc_setDeviceOwner.sqf index c4137d8057..aad596ec50 100644 --- a/addons/bft/functions/fnc_setDeviceOwner.sqf +++ b/addons/bft/functions/fnc_setDeviceOwner.sqf @@ -22,4 +22,4 @@ _data = [_deviceID] call FUNC(getDeviceData); if (count _data < 6) exitwith {}; if (_newOwner isEqualTo (_data select 5)) exitwith {}; -["bft_updateDeviceOwner", [_deviceID, _newOwner]] call EFUNC(common,globalEvent); +["bft_updateDeviceOwner", [_deviceID, _newOwner]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_syncedArrayDelete.sqf b/addons/bft/functions/fnc_syncedArrayDelete.sqf index b08e79a75d..d12108ab34 100644 --- a/addons/bft/functions/fnc_syncedArrayDelete.sqf +++ b/addons/bft/functions/fnc_syncedArrayDelete.sqf @@ -16,4 +16,4 @@ params ["_varName", "_dataID"]; -["bft_syncedArrayDelete", [_varName, _dataID]] call EFUNC(common,globalEvent); +["bft_syncedArrayDelete", [_varName, _dataID]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_syncedArrayPushback.sqf b/addons/bft/functions/fnc_syncedArrayPushback.sqf index 34ece14627..f12dd105ad 100644 --- a/addons/bft/functions/fnc_syncedArrayPushback.sqf +++ b/addons/bft/functions/fnc_syncedArrayPushback.sqf @@ -18,4 +18,4 @@ params ["_varName", "_data"]; if (typeName _data == "ARRAY" && {(count _data == 0)}) exitwith {}; -["bft_syncedArrayPushback", [_varName, _data]] call EFUNC(common,globalEvent); +["bft_syncedArrayPushback", [_varName, _data]] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_syncedArrayUpdate.sqf b/addons/bft/functions/fnc_syncedArrayUpdate.sqf index 48eff1f3f3..7a405ad1dd 100644 --- a/addons/bft/functions/fnc_syncedArrayUpdate.sqf +++ b/addons/bft/functions/fnc_syncedArrayUpdate.sqf @@ -18,4 +18,4 @@ params ["_varName", "_data"]; if (typeName _data == "ARRAY" && (count _data == 0)) exitwith {}; -["bft_syncedArrayUpdate", _this] call EFUNC(common,globalEvent); +["bft_syncedArrayUpdate", _this] call CBA_fnc_globalEvent; diff --git a/addons/bft/functions/fnc_updateRegisteredEncryptionKeys.sqf b/addons/bft/functions/fnc_updateRegisteredEncryptionKeys.sqf index 01bd711e91..2eedaffe9f 100644 --- a/addons/bft/functions/fnc_updateRegisteredEncryptionKeys.sqf +++ b/addons/bft/functions/fnc_updateRegisteredEncryptionKeys.sqf @@ -22,12 +22,12 @@ params ["_keys", "_add"]; if (isNil "_add") then { if !(GVAR(registeredEncyptionKeys) isEqualTo _keys) then { GVAR(registeredEncyptionKeys) = _keys; - ["bft_registeredEncryptionKeysChanged", [_keys,nil]] call EFUNC(common,localEvent); + ["bft_registeredEncryptionKeysChanged", [_keys,nil]] call CBA_fnc_localEvent; }; } else { private ["_changed"]; _changed = false; - + if (_add) then { // figure out the real difference _keys = _keys - GVAR(registeredEncyptionKeys); @@ -44,8 +44,8 @@ if (isNil "_add") then { }; }; if (_changed) then { - ["bft_registeredEncryptionKeysChanged", [_keys,_add]] call EFUNC(common,localEvent); + ["bft_registeredEncryptionKeysChanged", [_keys,_add]] call CBA_fnc_localEvent; }; }; -true \ No newline at end of file +true diff --git a/addons/bft/functions/fnc_updateRegisteredModes.sqf b/addons/bft/functions/fnc_updateRegisteredModes.sqf index b39ce7a218..a930d6778a 100644 --- a/addons/bft/functions/fnc_updateRegisteredModes.sqf +++ b/addons/bft/functions/fnc_updateRegisteredModes.sqf @@ -22,12 +22,12 @@ params ["_modes", "_add"]; if (isNil "_add") then { if !(GVAR(registeredViewModes) isEqualTo _modes) then { GVAR(registeredViewModes) = _modes; - ["bft_registeredModeChanged", [_modes,nil]] call EFUNC(common,localEvent); + ["bft_registeredModeChanged", [_modes,nil]] call CBA_fnc_localEvent; }; } else { private ["_changed"]; _changed = false; - + if (_add) then { // figure out the real difference _modes = _modes - GVAR(registeredViewModes); @@ -44,8 +44,8 @@ if (isNil "_add") then { }; }; if (_changed) then { - ["bft_registeredModeChanged", [_modes,_add]] call EFUNC(common,localEvent); + ["bft_registeredModeChanged", [_modes,_add]] call CBA_fnc_localEvent; }; }; -true \ No newline at end of file +true diff --git a/addons/bft/functions/fnc_validateInventory.sqf b/addons/bft/functions/fnc_validateInventory.sqf index c078220343..47fcc84e7e 100644 --- a/addons/bft/functions/fnc_validateInventory.sqf +++ b/addons/bft/functions/fnc_validateInventory.sqf @@ -39,7 +39,7 @@ _matchedIDs = []; if (!(_magId in GVAR(pendingIdAssignmentList))) then { _magazine = (magazines _unit) select _forEachIndex; if (getText (configFile >> "CfgMagazines" >> _magazine >> QGVAR(type)) != "") then { - ["bft_itemCreated", [_unit, getText (configFile >> "CfgMagazines" >> _magazine >> QGVAR(type)), _magazine, _magID]] call EFUNC(common,serverEvent); + ["bft_itemCreated", [_unit, getText (configFile >> "CfgMagazines" >> _magazine >> QGVAR(type)), _magazine, _magID]] call CBA_fnc_serverEvent; }; }; }; @@ -49,7 +49,7 @@ _unMatchedDevices = _ownedDevices - _matchedIDs; { systemChat format["validate - no longer has ID: %1 %2", _unit, _x]; diag_log format["validate - no longer has ID: %1 %2", _unit, _x]; - ["bft_updateDeviceOwner", [_x, objNull]] call EFUNC(common,globalEvent); + ["bft_updateDeviceOwner", [_x, objNull]] call CBA_fnc_globalEvent; systemChat format["Dropped a bft device: %1 - %2", _unit, _X]; diag_log format["Dropped a bft device: %1 - %2", _unit, _X]; } forEach _unMatchedDevices; diff --git a/addons/bft/functions/fnc_vehicleInit.sqf b/addons/bft/functions/fnc_vehicleInit.sqf index e6e4eb1321..cd8b5a4d83 100644 --- a/addons/bft/functions/fnc_vehicleInit.sqf +++ b/addons/bft/functions/fnc_vehicleInit.sqf @@ -27,7 +27,7 @@ systemChat format["VehicleInit devices: %1",_device]; diag_log format["VehicleInit devices: %1",_device]; if (isClass (configFile >> "ACE_BFT" >> "Devices" >> _device)) then { - ["bft_itemCreated", [_vehicle, _device, "", format["%1/%2",_vehicle, _device], STATE_OFFLINE]] call EFUNC(common,serverEvent); + ["bft_itemCreated", [_vehicle, _device, "", format["%1/%2",_vehicle, _device], STATE_OFFLINE]] call CBA_fnc_serverEvent; }; true diff --git a/addons/bft_device_dk10/CfgWeapons.hpp b/addons/bft_device_dk10/CfgWeapons.hpp index 7af770b5d6..ca90046a6d 100644 --- a/addons/bft_device_dk10/CfgWeapons.hpp +++ b/addons/bft_device_dk10/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class EGVAR(bft_devices,ItemCore); // DK10 BLUFOR @@ -8,7 +8,7 @@ class CfgWeapons { displayName = CSTRING(DK10_itemName_b); model = QUOTE(PATHTOF(data\DK10.p3d)); picture = QUOTE(PATHTOF(UI\inventory\DK10_icon.paa)); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 40; }; EGVAR(bft,deviceType) = "DK10_b"; diff --git a/addons/bft_device_gd300/CfgWeapons.hpp b/addons/bft_device_gd300/CfgWeapons.hpp index 251be8aaea..3e3f00bda7 100644 --- a/addons/bft_device_gd300/CfgWeapons.hpp +++ b/addons/bft_device_gd300/CfgWeapons.hpp @@ -1,5 +1,5 @@ class CfgWeapons { - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class EGVAR(bft_devices,ItemCore); // GD300 BLUFOR @@ -8,7 +8,7 @@ class CfgWeapons { displayName = CSTRING(GD300_itemName_b); model = QUOTE(PATHTOF(data\GD300.p3d)); picture = QUOTE(PATHTOF(UI\inventory\GD300_icon.paa)); - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 5; }; EGVAR(bft,deviceType) = "GD300_b"; diff --git a/addons/bft_devices/CfgWeapons.hpp b/addons/bft_devices/CfgWeapons.hpp index 12d72d5499..4791b2cc32 100644 --- a/addons/bft_devices/CfgWeapons.hpp +++ b/addons/bft_devices/CfgWeapons.hpp @@ -1,9 +1,9 @@ class CfgWeapons { class ACE_ItemCore; - class InventoryItem_Base_F; + class CBA_MiscItem_ItemInfo; class GVAR(ItemCore): ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); scope = 2; // cannot do ItemGPS as long as we do have to use magazines for unique items // simulation = "ItemGPS"; @@ -27,12 +27,12 @@ class CfgWeapons { };*/ class ACE_HelmetCam: ACE_ItemCore { - author = "$STR_ACE_Common_ACETeam"; + author = ECSTRING(common,ACETeam); descriptionShort = CSTRING(HelmetCam_itemDescription); displayName = CSTRING(HelmetCam_itemName); picture = QUOTE(PATHTOF(UI\inventory\HelmetCam_icon.paa)); scope = 2; - class ItemInfo: InventoryItem_Base_F { + class ItemInfo: CBA_MiscItem_ItemInfo { mass = 4; }; }; diff --git a/addons/bft_devices/XEH_clientInit.sqf b/addons/bft_devices/XEH_clientInit.sqf index f900485a4d..e0bdcdd83b 100644 --- a/addons/bft_devices/XEH_clientInit.sqf +++ b/addons/bft_devices/XEH_clientInit.sqf @@ -44,23 +44,23 @@ GVAR(UAVlist) = []; GVAR(hCamList) = []; // Define default settings for interface property groups -GVAR(settings) = HASH_CREATE; +GVAR(settings) = [] call CBA_fnc_hashCreate; private ["_tempHash"]; // COMMON settings -_tempHash = HASH_CREATE; -HASH_SET(_tempHash,"mode","BFT"); -HASH_SET(_tempHash,"mapScaleMin",0.1); -HASH_SET(_tempHash,"mapScaleMax",2 ^ round(sqrt(GVAR(worldSize) / 1024))); -HASH_SET(GVAR(settings),"COMMON",_tempHash); +_tempHash = [] call CBA_fnc_hashCreate; +[_tempHash, "mode", "BFT"] call CBA_fnc_hashSet; +[_tempHash, "mapScaleMin", 0.1] call CBA_fnc_hashSet; +[_tempHash, "mapScaleMax", 2 ^ round(sqrt(GVAR(worldSize) / 1024))] call CBA_fnc_hashSet; +[GVAR(settings), "COMMON", _tempHash] call CBA_fnc_hashSet; // when main map is opened, close any open interface -["visibleMapChanged",{ +["visibleMap",{ params ["", "_mapIsVisible"]; if (_mapIsVisible) then { [] call FUNC(ifClose); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addPlayerEventHandler; #include "initKeybinds.sqf" diff --git a/addons/bft_devices/XEH_preInit.sqf b/addons/bft_devices/XEH_preInit.sqf index 9ab890b535..675169fcf1 100644 --- a/addons/bft_devices/XEH_preInit.sqf +++ b/addons/bft_devices/XEH_preInit.sqf @@ -22,6 +22,6 @@ GVAR(mapScaleFactor) = GVAR(worldSize) / 2666.65; // still need to figure out if this is really required and how I actually got to this number (too long ago!) GVAR(mapScaleFactor) = GVAR(worldSize) / 2666.65; }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; ADDON = true; diff --git a/addons/bft_devices/functions/fnc_getInterfaceSettingsFromConfig.sqf b/addons/bft_devices/functions/fnc_getInterfaceSettingsFromConfig.sqf index c2ad96227d..e670036935 100644 --- a/addons/bft_devices/functions/fnc_getInterfaceSettingsFromConfig.sqf +++ b/addons/bft_devices/functions/fnc_getInterfaceSettingsFromConfig.sqf @@ -26,7 +26,7 @@ private _configToHash = { params ["_config"]; private _configProperties = configProperties [_config]; - private _configHash = HASH_CREATE; + private _configHash = [] call CBA_fnc_hashCreate; { private _key = configName _x; @@ -47,7 +47,7 @@ private _configToHash = { nil }; if !(isNil "_value") then { - HASH_SET(_configHash,_key,_value); + [_configHash, _key, _value] call CBA_fnc_hashSet; }; } forEach _configProperties; diff --git a/addons/bft_devices/functions/fnc_getSettings.sqf b/addons/bft_devices/functions/fnc_getSettings.sqf index 2c933f7bbf..a7c7e12f4c 100644 --- a/addons/bft_devices/functions/fnc_getSettings.sqf +++ b/addons/bft_devices/functions/fnc_getSettings.sqf @@ -33,22 +33,23 @@ private ["_property"]; params ["_interfaceID", ["_property", ""]]; // Fetch common and device specific property hashes -private _commonProperties = HASH_GET(GVAR(settings),"COMMON"); -private _deviceAppData = HASH_GET(GVAR(settings),_interfaceID); +private _commonProperties = [GVAR(settings), "COMMON"] call CBA_fnc_hashGet; +private _deviceAppData = [GVAR(settings), _interfaceID] call CBA_fnc_hashGet; // Return value of requested property if (_property != "") exitWith { - private _value = HASH_GET(_deviceAppData,_property); + private _value = [_deviceAppData, _property] call CBA_fnc_hashGet; if (isNil "_value") then { - _value = HASH_GET(_commonProperties,_property); + _value = [_commonProperties, _property] call CBA_fnc_hashGet; }; if (isNil "_value") then {nil} else {_value} }; // Return list of all property hashes private _combinedProperties = +_commonProperties; +systemChat format ["Device app data %1", _deviceAppData]; { - HASH_SET(_combinedProperties,_x,(_deviceAppData select 1) select _forEachIndex); -} forEach (_deviceAppData select 0); + [_combinedProperties, _x, (_deviceAppData select 2) select _forEachIndex] call CBA_fnc_hashSet; +} forEach (_deviceAppData select 1); _combinedProperties diff --git a/addons/bft_devices/functions/fnc_ifOnLBSelChanged.sqf b/addons/bft_devices/functions/fnc_ifOnLBSelChanged.sqf index 96f3a5d817..9c821ec296 100644 --- a/addons/bft_devices/functions/fnc_ifOnLBSelChanged.sqf +++ b/addons/bft_devices/functions/fnc_ifOnLBSelChanged.sqf @@ -25,8 +25,9 @@ // ignore function call if the interface has not finished setup if (GVAR(ifOpenStart) || I_CLOSED) exitWith {true}; -params ["_function"]; -_function params ["_control", "_selectedIndex"]; +params ["_function", "_controlArguments"]; +_controlArguments params ["_control", "_selectedIndex"]; +systemChat format ["this %1 _control %2 _selectedIndex %3", _this, _control, _selectedIndex]; private _display = ctrlParent _control; private _interfaceID = I_GET_ID; diff --git a/addons/bft_devices/functions/fnc_ifOnLoad.sqf b/addons/bft_devices/functions/fnc_ifOnLoad.sqf index 9c4d6b14fb..f1c3bf1cf6 100644 --- a/addons/bft_devices/functions/fnc_ifOnLoad.sqf +++ b/addons/bft_devices/functions/fnc_ifOnLoad.sqf @@ -28,10 +28,10 @@ uiNamespace setVariable [I_GET_NAME, _display]; private _mapTypes = [I_GET_ID,"mapTypes"] call FUNC(getSettings); { 0 = [_display displayCtrl _x] call EFUNC(bft_drawing,doBFTDraw); -} count (_mapTypes select 1); +} count (_mapTypes select 2); // send "bft_deviceOpened" event -["bft_deviceOpened",[I_GET_DEVICE]] call EFUNC(common,localEvent); +["bft_deviceOpened",[I_GET_DEVICE]] call CBA_fnc_localEvent; GVAR(ifOpenStart) = false; diff --git a/addons/bft_devices/functions/fnc_ifOnUnload.sqf b/addons/bft_devices/functions/fnc_ifOnUnload.sqf index e7cd4a8c22..645bbd9500 100644 --- a/addons/bft_devices/functions/fnc_ifOnUnload.sqf +++ b/addons/bft_devices/functions/fnc_ifOnUnload.sqf @@ -42,9 +42,9 @@ if !(I_CLOSED) then { if (!isNil "_playerKilledEhId") then {_player removeEventHandler ["killed",_playerKilledEhId]}; if (!isNil "_vehicleGetOutEhId") then {_vehicle removeEventHandler ["GetOut",_vehicleGetOutEhId]}; if (!isNil "_draw3dEhId") then {removeMissionEventHandler ["Draw3D",_draw3dEhId]}; - if (!isNil "_aceUnconciousEhId") then {["medical_onUnconscious",_aceUnconciousEhId] call EFUNC(common,removeEventHandler)}; - if (!isNil "_aceUpdateDeviceOwnerEhId") then {["bft_updateDeviceOwner",_aceUpdateDeviceOwnerEhId] call EFUNC(common,removeEventHandler)}; - if (!isNil "_acePlayerChangedEhId") then {["playerChanged",_acePlayerChangedEhId] call EFUNC(common,removeEventHandler)}; + if (!isNil "_aceUnconciousEhId") then {["medical_onUnconscious",_aceUnconciousEhId] call CBA_fnc_removeEventHandler}; + if (!isNil "_aceUpdateDeviceOwnerEhId") then {["bft_updateDeviceOwner",_aceUpdateDeviceOwnerEhId] call CBA_fnc_removeEventHandler}; + if (!isNil "_acePlayerChangedEhId") then {["playerChanged",_acePlayerChangedEhId] call CBA_fnc_removeEventHandler}; // remove notification system related PFHs if !(isNil QGVAR(processNotificationsPFH)) then { @@ -56,7 +56,7 @@ if !(I_CLOSED) then { if (!GVAR(ifOpenStart)) then { if (_isDialog) then { // convert mapscale to km - _mapScale = GVAR(mapScale) * GVAR(mapScaleFactor) / 0.86 * (safezoneH * 0.8); + private _mapScale = GVAR(mapScale) * GVAR(mapScaleFactor) / 0.86 * (safezoneH * 0.8); // get the current position of the background control private _backgroundPosition = [_displayName] call FUNC(getBackgroundPosition); @@ -84,11 +84,11 @@ if !(I_CLOSED) then { // if the device is a personal device, save settings to device appData store if (_deviceOwner isKindOf "ParachuteBase" || _deviceOwner isKindOf "CAManBase") then { - [_deviceID,[-1,HASH_GET(GVAR(settings),_interfaceID)]] call EFUNC(bft,handleUpdateDeviceAppData); + [_deviceID,[-1, [GVAR(settings),_interfaceID] call CBA_fnc_hashGet]] call EFUNC(bft,handleUpdateDeviceAppData); }; // send "bft_deviceClosed" event - ["bft_deviceClosed",[_deviceID]] call EFUNC(common,localEvent); + ["bft_deviceClosed",[_deviceID]] call CBA_fnc_localEvent; uiNamespace setVariable [_displayName, displayNull]; GVAR(ifOpen) = nil; diff --git a/addons/bft_devices/functions/fnc_ifOpen.sqf b/addons/bft_devices/functions/fnc_ifOpen.sqf index dae036273a..e6b8cf0bb8 100644 --- a/addons/bft_devices/functions/fnc_ifOpen.sqf +++ b/addons/bft_devices/functions/fnc_ifOpen.sqf @@ -135,7 +135,7 @@ GVAR(ifOpen) set [11, if (_this select 0 == ACE_player && _this select 1) then { [] call FUNC(ifClose); }; - }] call EFUNC(common,addEventHandler) + }] call CBA_fnc_addEventHandler ]; // Register with ACE bft_updateDeviceOwner event @@ -145,14 +145,12 @@ GVAR(ifOpen) set [12, if ((_this select 0 == I_GET_DEVICE) && (_this select 1 != ACE_player)) then { [] call FUNC(ifClose); }; - }] call EFUNC(common,addEventHandler) + }] call CBA_fnc_addEventHandler ]; // Register with ACE playerChanged event GVAR(ifOpen) set [13, - ["playerChanged",{ - _this call FUNC(onPlayerChanged); - }] call EFUNC(common,addEventHandler) + ["unit", FUNC(onPlayerChanged)] call CBA_fnc_addPlayerEventHandler ]; // get device owner @@ -163,15 +161,15 @@ private _deviceAppData = D_GET_APP_DATA(_deviceData); // if the device is a personal device, get settings from device appData store if (!(_deviceAppData isEqualTo []) && (_deviceOwner isKindOf "ParachuteBase" || _deviceOwner isKindOf "CAManBase")) then { // write settings to local cache - HASH_SET(GVAR(settings),_interfaceID,_deviceAppData); + [GVAR(settings), _interfaceID, _deviceAppData] call CBA_fnc_hashSet; } else { // if vehicle device, see if device app data is already cached, if not, retrieve from config - if !(HASH_HASKEY(GVAR(settings),_interfaceID)) then { + if !([GVAR(settings), _interfaceID] call CBA_fnc_hashHasKey) then { // read from config _deviceAppData = [_interfaceConfigName] call FUNC(getInterfaceSettingsFromConfig); // write to cache - HASH_SET(GVAR(settings),_interfaceID,_deviceAppData); + [GVAR(settings), _interfaceID, _deviceAppData] call CBA_fnc_hashSet; }; }; diff --git a/addons/bft_devices/functions/fnc_ifUpdate.sqf b/addons/bft_devices/functions/fnc_ifUpdate.sqf index 78820ac647..f2b0d6ec98 100644 --- a/addons/bft_devices/functions/fnc_ifUpdate.sqf +++ b/addons/bft_devices/functions/fnc_ifUpdate.sqf @@ -44,7 +44,7 @@ if (isNil "_settings") then { _interfaceInit = true; }; -private _mode = HASH_GET(_settings,"mode"); +private _mode = [_settings, "mode"] call CBA_fnc_hashGet; if (isNil "_mode") then { _mode = [_interfaceID,"mode"] call FUNC(getSettings); // do not show "Loading" control since we are not switching modes @@ -59,7 +59,7 @@ if (isNil "_mode") then { { call { - private _value = (_settings select 1) select _forEachIndex; + private _value = (_settings select 2) select _forEachIndex; if (isNil "_value") exitWith {}; // ------------ DISPLAY POSITION ------------ @@ -139,7 +139,7 @@ if (isNil "_mode") then { // call brightness adjustment if this is outside of interface init if (!_interfaceInit) then { private _brightness = [_interfaceID,"brightness"] call FUNC(getSettings); - HASH_SET(_settings,"brightness",_brightness); + [_settings, "brightness", _brightness] call CBA_fnc_hashSet; }; }; }; @@ -197,7 +197,7 @@ if (isNil "_mode") then { if (_mode == "BFT") exitWith { private _mapTypes = [_interfaceID,"mapTypes"] call FUNC(getSettings); private _mapType = [_interfaceID,"mapType"] call FUNC(getSettings); - private _mapIDC = HASH_GET(_mapTypes,_mapType); + private _mapIDC = [_mapTypes, _mapType] call CBA_fnc_hashGet; _displayItemsToShow pushBack _mapIDC; @@ -222,9 +222,9 @@ if (isNil "_mode") then { if (!_interfaceInit) then { if (_isDialog) then { private _mapScale = [_interfaceID,"mapScaleDlg"] call FUNC(getSettings); - HASH_SET(_settings,"mapScaleDlg",_mapScale); + [_settings, "mapScaleDlg", _mapScale] call CBA_fnc_hashSet; private _mapWorldPos = [_interfaceID,"mapWorldPos"] call FUNC(getSettings); - HASH_SET(_settings,"mapWorldPos",_mapWorldPos); + [_settings, "mapWorldPos", _mapWorldPos] call CBA_fnc_hashSet; }; }; }; @@ -233,7 +233,7 @@ if (isNil "_mode") then { private _mapTypes = [_interfaceID,"mapTypes"] call FUNC(getSettings); if (count _mapTypes > 1) then { private _targetMapName = [_interfaceID,"mapType"] call FUNC(getSettings); - private _targetMapIDC = HASH_GET(_mapTypes,_targetMapName); + private _targetMapIDC = [_mapTypes, _targetMapName] call CBA_fnc_hashGet; _targetMapCtrl = _display displayCtrl _targetMapIDC; // If we find the map to be shown, we are switching away from BFT. Lets save map scale and position @@ -250,10 +250,10 @@ if (isNil "_mode") then { IDC_UAVMAP ]; _btnActCtrl ctrlSetTooltip "View Gunner Optics"; - HASH_SET(_settings,"uavListUpdate",true); + [_settings, "uavListUpdate", true] call CBA_fnc_hashSet; if (!_interfaceInit) then { private _uav = [_interfaceID,"uavCam"] call FUNC(getSettings); - HASH_SET(_settings,"uavCam",_uav); + [_settings, "uavCam", _uav] call CBA_fnc_hashSet; }; }; // ---------- HELMET CAM ----------- @@ -263,10 +263,10 @@ if (isNil "_mode") then { IDC_HCAMMAP ]; _btnActCtrl ctrlSetTooltip "Toggle Fullscreen"; - HASH_SET(_settings,"hCamListUpdate",true); + [_settings, "hCamListUpdate", true] call CBA_fnc_hashSet; if (!_interfaceInit) then { private _hCam = [_interfaceID,"hCam"] call FUNC(getSettings); - HASH_SET(_settings,"hCam",_hCam); + [_settings, "hCam", _hCam] call CBA_fnc_hashSet; }; }; // ---------- MESSAGING ----------- @@ -295,10 +295,10 @@ if (isNil "_mode") then { IDC_GROUP_HCAM, IDC_HCAMMAP ]; - HASH_SET(_settings,"hCamListUpdate",true); + [_settings, "hCamListUpdate", true] call CBA_fnc_hashSet; if (!_interfaceInit) then { private _hCam = [_interfaceID,"hCam"] call FUNC(getSettings); - HASH_SET(_settings,"hCam",_hCam); + [_settings, "hCam", _hCam] call CBA_fnc_hashSet; }; }; _btnActCtrl ctrlSetTooltip "Toggle Fullscreen"; @@ -365,19 +365,19 @@ if (isNil "_mode") then { // ------------ MAP TYPE ------------ if (_x == "mapType") exitWith { private _mapTypes = [_interfaceID,"mapTypes"] call FUNC(getSettings); - if ((count (_mapTypes select 0) > 1) && (_mode == "BFT")) then { + if ((count (_mapTypes select 1) > 1) && (_mode == "BFT")) then { private _targetMapName = _value; - private _targetMapIDC = HASH_GET(_mapTypes,_targetMapName); + private _targetMapIDC = [_mapTypes, _targetMapName] call CBA_fnc_hashGet; _targetMapCtrl = _display displayCtrl _targetMapIDC; if (!_interfaceInit && _isDialog) then { private _previousMapCtrl = controlNull; { - private _previousMapIDC = (_mapTypes select 1) select _forEachIndex; + private _previousMapIDC = (_mapTypes select 2) select _forEachIndex; _previousMapCtrl = _display displayCtrl _previousMapIDC; if (ctrlShown _previousMapCtrl) exitWith {}; _previousMapCtrl = controlNull; - } forEach (_mapTypes select 0); + } forEach (_mapTypes select 1); // See if _targetMapCtrl is already being shown if ((!ctrlShown _targetMapCtrl) && (_targetMapCtrl != _previousMapCtrl)) then { // Update _targetMapCtrl to scale and position of _previousMapCtrl @@ -389,9 +389,9 @@ if (isNil "_mode") then { // Hide all unwanted map types { if (_x != _targetMapName) then { - (_display displayCtrl ((_mapTypes select 1) select _forEachIndex)) ctrlShow false; + (_display displayCtrl ((_mapTypes select 2) select _forEachIndex)) ctrlShow false; }; - } forEach (_mapTypes select 0); + } forEach (_mapTypes select 1); // Update OSD element if it exists private _osdCtrl = _display displayCtrl IDC_OSD_MAP_TGGL; @@ -550,14 +550,14 @@ if (isNil "_mode") then { }; // ---------------------------------- }; -} forEach (_settings select 0); +} forEach (_settings select 1); // update scale and world position if we have to. If so, fill in the blanks and make the changes if ((!isNil "_targetMapScale") || (!isNil "_targetMapWorldPos")) then { if (isNull _targetMapCtrl) then { private _targetMapName = [_interfaceID,"mapType"] call FUNC(getSettings); private _mapTypes = [_interfaceID,"mapTypes"] call FUNC(getSettings); - private _targetMapIDC = HASH_GET(_mapTypes,_targetMapName); + private _targetMapIDC = [_mapTypes, _targetMapName] call CBA_fnc_hashGet; _targetMapCtrl = _display displayCtrl _targetMapIDC; }; if (isNil "_targetMapScale") then { @@ -581,7 +581,7 @@ if (!isNull _loadingCtrl) then { // delay moving the mouse cursor by one frame, for some reason its not working without [{ setMousePosition _this; - },_mousePos] call EFUNC(common,execNextFrame); + },_mousePos] call CBA_fnc_execNextFrame }; _loadingCtrl ctrlShow false; diff --git a/addons/bft_devices/functions/fnc_processNotifications.sqf b/addons/bft_devices/functions/fnc_processNotifications.sqf index e0f77d9c42..199b27afc4 100644 --- a/addons/bft_devices/functions/fnc_processNotifications.sqf +++ b/addons/bft_devices/functions/fnc_processNotifications.sqf @@ -33,13 +33,15 @@ if (isNil QGVAR(processNotificationsPFH) && !(I_CLOSED) && count GVAR(notificati // run every 4 seconds GVAR(processNotificationsPFH) = [{ params ["_args", "_idPFH"]; + systemChat format ["args %1", _args]; _args params ["_ctrl"]; if !(I_CLOSED) then { if (count GVAR(notificationCache) != 0) then { // grab and delete the oldest notification + systemChat format ["notification %1", GVAR(notificationCache)]; private _notification = GVAR(notificationCache) deleteAt 0; - _notification params ["_ctrl", "_time1", "_time2", "_decayTime", "_counter"]; + _notification params ["_type", "_time1", "_time2", "_decayTime", "_counter"]; private _currentTime = [] call FUNC(currentTime); // see if notification was issued in the same minute, if so, omit showing the time @@ -49,7 +51,7 @@ if (isNil QGVAR(processNotificationsPFH) && !(I_CLOSED) && count GVAR(notificati if (_counter > 1) then { _text = format ["%1 (x%2)",_text,_counter]; }; - + systemChat format ["%1 ctrlsettext %2", _type, _text]; // show the notification _ctrl ctrlSetText _text; // make the control visible (it might have had its fade set to 1 before) diff --git a/addons/bft_devices/functions/fnc_setInterfacePosition.sqf b/addons/bft_devices/functions/fnc_setInterfacePosition.sqf index ed9df579a1..968bdb55f8 100644 --- a/addons/bft_devices/functions/fnc_setInterfacePosition.sqf +++ b/addons/bft_devices/functions/fnc_setInterfacePosition.sqf @@ -23,7 +23,7 @@ disableSerialization; params ["_displayName", "_offset"]; _offset params ["_xOffset", "_yOffset"]; - +systemChat format ["offset %1 %2", _xOffset, _yOffset]; private _display = uiNamespace getVariable _displayName; private _isDialog = I_GET_ISDIALOG; diff --git a/addons/bft_devices/functions/fnc_setSettings.sqf b/addons/bft_devices/functions/fnc_setSettings.sqf index 49d0713f59..ceab500df8 100644 --- a/addons/bft_devices/functions/fnc_setSettings.sqf +++ b/addons/bft_devices/functions/fnc_setSettings.sqf @@ -31,44 +31,44 @@ params ["_interfaceID", "_properties", ["_updateInterface", true], ["_forceInterfaceUpdate", false] ]; -private _commonProperties = HASH_GET(GVAR(settings),"COMMON"); -private _deviceAppData = HASH_GET(GVAR(settings),_interfaceID); +private _commonProperties = [GVAR(settings), "COMMON"] call CBA_fnc_hashGet; +private _deviceAppData = [GVAR(settings), _interfaceID] call CBA_fnc_hashGet; // Write multiple property pairs. If they exist in _deviceAppData, write them there, else write them to COMMON. Only write if they exist and have changed. -private _commonPropertiesUpdate = HASH_CREATE; -private _combinedPropertiesUpdate = HASH_CREATE; +private _commonPropertiesUpdate = [] call CBA_fnc_hashCreate; +private _combinedPropertiesUpdate = [] call CBA_fnc_hashCreate; { private _key = _x select 0; private _value = _x select 1; call { - private _currentValue = HASH_GET(_deviceAppData,_key); + private _currentValue = [_deviceAppData, _key] call CBA_fnc_hashGet; if (!isNil "_currentValue") exitWith { call { if !(_currentValue isEqualTo _value) exitWith { - HASH_SET(_combinedPropertiesUpdate,_key,_value); - HASH_SET(_deviceAppData,_key,_value); + [_combinedPropertiesUpdate,_key,_value] call CBA_fnc_hashSet; + [_deviceAppData, _key, _value] call CBA_fnc_hashSet; }; if (_forceInterfaceUpdate) then { - HASH_SET(_combinedPropertiesUpdate,_key,_value); + [_combinedPropertiesUpdate, _key, _value] call CBA_fnc_hashSet; }; }; }; - _currentValue = HASH_GET(_commonProperties,_key); + _currentValue = [_commonProperties, _key] call CBA_fnc_hashGet; if (!isNil "_currentValue") then { call { if !(_currentValue isEqualTo _value) then { - HASH_SET(_commonPropertiesUpdate,_key,_value); - HASH_SET(_commonProperties,_key,_value); + [_commonPropertiesUpdate, _key, _value] call CBA_fnc_hashSet; + [_commonProperties, _key, _value] call CBA_fnc_hashSet; }; if (_forceInterfaceUpdate) then { - HASH_SET(_commonPropertiesUpdate,_key,_value); + [_commonPropertiesUpdate, _key, _value] call CBA_fnc_hashSet; }; }; }; }; } forEach _properties; -HASH_SET(GVAR(settings),_interfaceID,_deviceAppData); -HASH_SET(GVAR(settings),"COMMON",_commonProperties); +[GVAR(settings), _interfaceID, _deviceAppData] call CBA_fnc_hashSet; +[GVAR(settings), "COMMON", _commonProperties] call CBA_fnc_hashSet; // Finally, call an interface update for the updated properties, but only if the currently interface uses the same property group, if not, pass changed common properties only. if (!I_CLOSED) then { @@ -83,6 +83,6 @@ if (!I_CLOSED) then { }; }; -if (_combinedPropertiesUpdate isEqualTo HASH_CREATE && _combinedPropertiesUpdate isEqualTo HASH_CREATE) exitWith {false}; +if (_combinedPropertiesUpdate isEqualTo ([] call CBA_fnc_hashCreate) && {_combinedPropertiesUpdate isEqualTo ([] call CBA_fnc_hashCreate)}) exitWith {false}; true diff --git a/addons/bft_devices/functions/fnc_toggleMapType.sqf b/addons/bft_devices/functions/fnc_toggleMapType.sqf index fad5b9ef16..b5d0b4b7c4 100644 --- a/addons/bft_devices/functions/fnc_toggleMapType.sqf +++ b/addons/bft_devices/functions/fnc_toggleMapType.sqf @@ -20,15 +20,23 @@ params ["_interfaceID"]; -private _mapTypes = [_interfaceID,"mapTypes"] call FUNC(getSettings); -_mapTypes params ["_mapTypesIndexes"]; +private _mapTypesHash = [_interfaceID, "mapTypes"] call FUNC(getSettings); -private _currentMapType = [_interfaceID,"mapType"] call FUNC(getSettings); -private _currentMapTypeIndex = _mapTypesIndexes find _currentMapType; -if (_currentMapTypeIndex == count _mapTypesIndexes - 1) then { - [_interfaceID,[["mapType", _mapTypesIndexes select 0]]] call FUNC(setSettings); +private _mapTypes = _mapTypesHash select 1; +private _mapTypesIndexes = _mapTypesHash select 2; +systemChat format ["mapTypes %1", _mapTypes]; +systemChat format ["mapTypesIndexes %1", _mapTypesIndexes]; + +private _currentMapType = [_interfaceID, "mapType"] call FUNC(getSettings); +private _currentMapTypeIndex = _mapTypes find _currentMapType; + +systemChat format ["currentMapType %1", _currentMapType]; +systemChat format ["currentMapIndex %1", _currentMapTypeIndex]; + +if (_currentMapTypeIndex == (count _mapTypesIndexes) - 1) then { + [_interfaceID, [["mapType", _mapTypes select 0]]] call FUNC(setSettings); } else { - [_interfaceID,[["mapType", _mapTypesIndexes select (_currentMapTypeIndex + 1)]]] call FUNC(setSettings); + [_interfaceID, [["mapType", _mapTypes select (_currentMapTypeIndex + 1)]]] call FUNC(setSettings); }; true diff --git a/addons/bft_drawing/XEH_clientInit.sqf b/addons/bft_drawing/XEH_clientInit.sqf index a02d015c68..b8e34977e5 100644 --- a/addons/bft_drawing/XEH_clientInit.sqf +++ b/addons/bft_drawing/XEH_clientInit.sqf @@ -9,9 +9,9 @@ if (!hasInterface) exitWith {}; /* // register with reporting channels when map is opened -["visibleMapChanged",{ +["visibleMap",{ params ["", "_mapIsVisible"]; - + if (_mapIsVisible) then { // set icon size back to default [1] call FUNC(updateDrawSize); @@ -25,4 +25,4 @@ if (!hasInterface) exitWith {}; } else { [false] call EFUNC(bft,updateAvailableDevicesPosition); }; -}] call EFUNC(common,addEventHandler);*/ +}] call CBA_fnc_addPlayerEventHandler;*/ diff --git a/addons/bft_drawing/XEH_preInit.sqf b/addons/bft_drawing/XEH_preInit.sqf index 3590ef9bb3..9b1fe29e79 100644 --- a/addons/bft_drawing/XEH_preInit.sqf +++ b/addons/bft_drawing/XEH_preInit.sqf @@ -14,7 +14,7 @@ GVAR(selection) = ["",[]]; // register drawing with all main-maps (including briefing) // ToDo: make stuff here switchable via module settings -["mapDisplayLoaded",{ +["mapDisplayLoaded", { [(_this select 0) displayCtrl 51] call FUNC(doBFTDraw); // if we are loading the briefing screens set up encryption keys and register reporting channels if ((_this select 1) != "Ingame") then { @@ -22,12 +22,12 @@ GVAR(selection) = ["",[]]; if (isNull (findDisplay 12)) then { [[player] call EFUNC(bft,getEncryptionKey)] call EFUNC(bft,updateRegisteredEncryptionKeys); [EGVAR(bft,allReportingModes)] call EFUNC(bft,updateRegisteredModes); - [true,5] call FUNC(updateAvailableDevicesPosition); + [true,5] call EFUNC(bft,updateAvailableDevicesPosition); }; } else { // once the main map loads in (i.e. briefing is done with), shut down the positional update loop - [false] call FUNC(updateAvailableDevicesPosition); + [false] call EFUNC(bft,updateAvailableDevicesPosition); }; -}] call EFUNC(common,addEventHandler); +}] call CBA_fnc_addEventHandler; ADDON = true; diff --git a/addons/common/RscInfoType.hpp b/addons/common/RscInfoType.hpp index 97d4b325e9..be349cf684 100644 --- a/addons/common/RscInfoType.hpp +++ b/addons/common/RscInfoType.hpp @@ -116,3 +116,21 @@ class RscInGameUI { onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscStanceInfo"",'IGUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_2('ace_infoDisplayChanged', [ARR_2(_this select 0, 'Stance')])] call CBA_fnc_localEvent;); }; }; + +// map +class RscDisplayMainMap { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); +}; + +class RscDisplayGetReady: RscDisplayMainMap { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); +}; + +class RscDisplayServerGetReady: RscDisplayGetReady { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); +}; + + +class RscDisplayClientGetReady: RscDisplayGetReady { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); +};