ACE3/addons/arsenal/XEH_preInit.sqf
Grim 35ce8d1883
Common - Add variable to block item replacement temporarily (#9265)
* add blocking item replacement

* don't add if player changed

* re-curse instead of fake item

* compileFinal

* Update fnc_registerItemReplacement.sqf

* move to separate function

* remove fakeitem replacement

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-07-22 06:31:30 +03:00

75 lines
2.2 KiB
Plaintext

#include "script_component.hpp"
#include "defines.hpp"
#define TOOLS_TAB_ICON "\A3\ui_f\data\igui\cfg\actions\repair_ca.paa"
ADDON = false;
PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
// Arsenal events
[QGVAR(statsToggle), {
params ["_display", "_showStats"];
private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox;
private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage;
private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage;
private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage;
private _statsButtonCtrl = _display displayCtrl IDC_statsButton;
private _statsButtonCloseCtrl = _display displayCtrl IDC_statsButtonClose;
{
_x ctrlShow (GVAR(showStats) && {_showStats});
} forEach [
_statsCtrlGroupCtrl,
_statsPreviousPageCtrl,
_statsNextPageCtrl,
_statsCurrentPageCtrl,
_statsButtonCloseCtrl
];
_statsButtonCtrl ctrlShow (!GVAR(showStats) && {_showStats})
}] call CBA_fnc_addEventHandler;
[QGVAR(statsButton), {
_this call FUNC(buttonStats);
}] call CBA_fnc_addEventHandler;
[QGVAR(statsChangePage), {
_this call FUNC(buttonStatsPage);
}] call CBA_fnc_addEventHandler;
[QGVAR(displayStats), {
_this call FUNC(handleStats);
}] call CBA_fnc_addEventHandler;
// Compile sorts and stats
call FUNC(compileStats);
call FUNC(compileSorts);
[QUOTE(ADDON), {!isNil QGVAR(camera)}] call CBA_fnc_registerFeatureCamera;
// Compatibility with CBA scripted optics and disposable framework
[QGVAR(displayOpened), {
"CBA_optics_arsenalOpened" call CBA_fnc_localEvent;
"CBA_disposable_arsenalOpened" call CBA_fnc_localEvent;
EGVAR(common,blockItemReplacement) = true;
}] call CBA_fnc_addEventHandler;
[QGVAR(displayClosed), {
"CBA_optics_arsenalClosed" call CBA_fnc_localEvent;
"CBA_disposable_arsenalClosed" call CBA_fnc_localEvent;
EGVAR(common,blockItemReplacement) = false;
}] call CBA_fnc_addEventHandler;
// Setup Tools tab
[keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton);
ADDON = true;