Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radio - Replace inventory PFH with CBA loadout handler #1015

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/ace_interact/XEH_postInitClient.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if (!hasInterface) exitWith {};

["ace_arsenal_displayClosed", {
EGVAR(sys_core,arsenalOpen) = false;
[] call DFUNC(monitorRadiosHandler);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving a note here: We have to think about API for this, copy-pasting those lines is far from ideal.

}] call CBA_fnc_addEventHandler;

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

[] call EFUNC(sys_radio,monitorRadiosHandler);
Freddo3000 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions addons/sys_gui/fnc_inventoryListMouseUp.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ 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(monitorRadiosPFH);
PREP(monitorRadiosHandler);
PREP(setActiveRadio);

PREP(openRadio);
Expand Down
3 changes: 2 additions & 1 deletion 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 per frame event handler for monitoring the local player inventory for changes.
* Sets up the CBA loadout event handler for monitoring the local player inventory for changes.
*
* Arguments:
* None
Expand All @@ -27,4 +27,5 @@ LOG("Monitor Inventory Starting");
{time >= 1}
}, {
[DFUNC(monitorRadiosPFH), 0.25, []] call CBA_fnc_addPerFrameHandler;
["loadout", DFUNC(monitorRadiosHandler), true] call CBA_fnc_addPlayerEventHandler;
}, []] 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_monitorRadiosPFH
* [] call acre_sys_radio_fnc_monitorRadiosHandler
*
* Public: No
*/
Expand Down