Skip to content

Commit

Permalink
Revert inventory monitoring PFH switch to CBA loadout EH
Browse files Browse the repository at this point in the history
  • Loading branch information
jonpas committed Sep 14, 2023
1 parent d6fa737 commit 4bbb8eb
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion addons/ace_interact/XEH_postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ if (!hasInterface) exitWith {};

["ace_arsenal_displayClosed", {
EGVAR(sys_core,arsenalOpen) = false;
[] call DFUNC(monitorRadiosHandler);
}] call CBA_fnc_addEventHandler;

["ace_arsenal_rightPanelFilled", {
Expand Down
4 changes: 2 additions & 2 deletions addons/api/fnc_setItemRadioReplacement.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: ACRE2Team
* DEPRECATED
* DEPRECATED! Replaced by CBA Setting.
* Set the radio type to replace "ItemRadio" in unit inventories. By default this is the "ACRE_PRC343"
*
* Arguments:
Expand All @@ -13,7 +13,7 @@
* Example:
* ["ACRE_PRC148"] call acre_api_fnc_setItemRadioReplacement;
*
* Public: No
* Public: Yes
*/

ACRE_DEPRECATED(QFUNC(setItemRadioReplacement),"2.12","CBA Setting")
Expand Down
2 changes: 0 additions & 2 deletions addons/sys_core/fnc_arsenalClose.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ private _weapons = [acre_player] call EFUNC(sys_core,getGear);
ACRE_ARSENAL_RADIOS = [];
GVAR(arsenalRadios) = [];
GVAR(arsenalOpen) = false;

[] call EFUNC(sys_radio,monitorRadiosHandler);
1 change: 0 additions & 1 deletion addons/sys_gui/fnc_inventoryListMouseUp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ params ["", "_button"];
if (_button == 1) then {
LOG("inventoryListMouseUp");
ACRE_HOLD_OFF_ITEMRADIO_CHECK = false;
[] call EFUNC(sys_radio,monitorRadiosHandler);
};
2 changes: 1 addition & 1 deletion addons/sys_radio/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PREP(monitorRadios);
PREP(monitorRadiosHandler);
PREP(monitorRadiosPFH);
PREP(setActiveRadio);

PREP(openRadio);
Expand Down
4 changes: 2 additions & 2 deletions addons/sys_radio/fnc_monitorRadios.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "script_component.hpp"
/*
* Author: ACRE2Team
* Sets up the CBA loadout event handler for monitoring the local player inventory for changes.
* Sets up the per frame event handler for monitoring the local player inventory for changes.
*
* Arguments:
* None
Expand All @@ -22,5 +22,5 @@ GVAR(requestingNewId) = false;
LOG("Monitor Inventory Starting");

[{ACRE_DATA_SYNCED && {(!isNil "ACRE_SERVER_INIT")} && {time >= 1}},{
["loadout", DFUNC(monitorRadiosHandler), true] call CBA_fnc_addPlayerEventHandler;
[DFUNC(monitorRadiosPFH), 0.25, []] call CBA_fnc_addPerFrameHandler;
},[]] call CBA_fnc_waitUntilAndExecute;
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* None
*
* Example:
* [] call acre_sys_radio_fnc_monitorRadiosHandler
* [] call acre_sys_radio_fnc_monitorRadiosPFH
*
* Public: No
*/
Expand Down Expand Up @@ -67,7 +67,8 @@ private _currentUniqueItems = [];
};
};

if (_radio call EFUNC(sys_radio,isUniqueRadio)) then {
private _isUnique = _radio call EFUNC(sys_radio,isUniqueRadio);
if (_isUnique) then {
if !([_radio] call EFUNC(sys_data,isRadioInitialized)) then {
WARNING_1("%1 was found in personal inventory but is uninitialized! Trying to collect new ID.",_radio);
private _baseRadio = BASECLASS(_radio);
Expand Down

0 comments on commit 4bbb8eb

Please sign in to comment.