Kingsley1997 39 Posted December 19, 2015 In our group we've had problems where if people click the random button in the virtual arsenal it will break ACRE and cause it to display a hint that doesn't go away (unless you spam empty hint commands every 0.0001 seconds...). Is it possible to disable the random button in the virtual arsenal? Share this post Link to post Share on other sites
Larrow 2828 Posted December 20, 2015 The code in this post but use this idc for the randomize button.. #define IDC_RSCDISPLAYARSENAL_CONTROLSBAR_BUTTONSAVE 44146 Share this post Link to post Share on other sites
Kingsley1997 39 Posted December 20, 2015 The code in this post but use this idc for the randomize button.. #define IDC_RSCDISPLAYARSENAL_CONTROLSBAR_BUTTONSAVE 44146 Cheers. Here's my final code, all works perfectly (just changed the IDC to the random button since 44146 is the save button). // Disable random button on Virtual Arsenal to prevent breaking ACRE [missionNamespace, "arsenalOpened", { disableSerialization; _display = _this select 0; (_display displayCtrl 44150) ctrlRemoveAllEventHandlers "buttonclick"; (_display displayCtrl 44150) ctrlEnable false; }] call BIS_fnc_addScriptedEventHandler; Share this post Link to post Share on other sites
Kingsley1997 39 Posted December 20, 2015 Just noticed a problem... Whilst the button is disabled, it is still possible to press Ctrl + R to do the random thing. Anyway to prevent this from happening? Here's the source code for that part... case (_key == DIK_R): { if (_ctrl) then { if (BIS_fnc_arsenal_type == 0) then { if (_shift) then { _soldiers = []; { _soldiers set [count _soldiers,configname _x]; } foreach ("isclass _x && getnumber (_x >> 'scope') > 1 && gettext (_x >> 'simulation') == 'soldier'" configclasses (configfile >> "cfgvehicles")); [_center,_soldiers call bis_fnc_selectrandom] call bis_fnc_loadinventory; ["ListSelectCurrent",[_display]] call bis_fnc_arsenal; }else { ['buttonRandom',[_display]] call bis_fnc_arsenal; }; } else { ['buttonRandom',[_display]] call bis_fnc_garage; }; }; }; Share this post Link to post Share on other sites
Kingsley1997 39 Posted December 20, 2015 Never mind I fixed it with: _display displayAddEventHandler ["KeyDown", "if ((_this select 1) in [19,29]) then {true}"]; Share this post Link to post Share on other sites