Closed ampersand38 closed 3 years ago
ctrlEventHandlers
added by the ModuleStrategicMapORBAT_F
module via BIS_fnc_moduleStrategicMapORBAT
:
//--- Add event handlers
_fnc_addHandlers = {
{
_x spawn {
disableserialization;
waituntil {!isnull (finddisplay _this displayctrl 51)};
_control = finddisplay _this displayctrl 51;
_control ctrladdeventhandler ["draw","_this call BIS_fnc_moduleStrategicMapORBAT_draw;"];
_control ctrladdeventhandler ["mousemoving","_this call BIS_fnc_moduleStrategicMapORBAT_mouse;"];
_control ctrladdeventhandler ["mouseholding","_this call BIS_fnc_moduleStrategicMapORBAT_mouse;"];
_control ctrladdeventhandler ["mousebuttonclick","['BIS_fnc_moduleStrategicMapORBAT',_this] spawn BIS_fnc_strategicMapMouseButtonClick;"];
};
} foreach [
getnumber (configfile >> "RscDisplayMainMap" >> "idd"),
getnumber (configfile >> "RscDisplayGetReady" >> "idd"),
getnumber (configfile >> "RscDisplayClientGetReady" >> "idd"),
getnumber (configfile >> "RscDisplayServerGetReady" >> "idd")
];
};
[] spawn _fnc_addHandlers;
Appear to get overwritten by ALiVE here: https://github.com/ALiVEOS/ALiVE.OS/blob/c98722e646913bcbcd5c64a7aa477ea8b6e4ffb7/addons/sys_marker/fnc_marker.sqf#L303
&
As a temporary fix, throw this into the init of the ORBAT Module:
[] spawn {
sleep 10;
_control = finddisplay 12 displayctrl 51;
_control ctrladdeventhandler ["mousebuttonclick","['BIS_fnc_moduleStrategicMapORBAT',_this] spawn BIS_fnc_strategicMapMouseButtonClick;"];
};
Control Event Handlers are stackable and are processed in reverse order (i.e. last added: processed first, first added: processed last).
In our instance, ALiVEs EH's are processed first as they're declared last. This seems to work fine if the EH's within BIS_fnc_moduleStrategicMapORBAT
are processed first.
Inverting the following return value to false
allows secondary EH's to be fired:
Works after #719, can probably close this now.
Prerequisites
Description
Having ALiVE Required module with Disable Adv Markers set to No, base-game ORBAT Viewer does not open on map click.
Steps to Reproduce
configfile >> "CfgORBAT" >> "BIS" >> "B_1"
Expected behavior: ORBAT Viewer to open
Actual behavior: ORBAT Viewer fails to open
https://youtu.be/Y47Nuqmi5hs