ALiVEOS / ALiVE.OS

ALiVE Open Source GPL v2
http://alivemod.com/
Other
157 stars 80 forks source link

[sys_marker] Fix for stacked Ctrl EventHandlers #719

Closed trapw0w closed 3 years ago

trapw0w commented 4 years ago

718

Summary: Control Event Handlers are stackable and are processed in reverse order (i.e. last added: processed first, first added: processed last). In this instance, ALiVEs EH's are processed first as they're declared last. Issue is that as soon as one of the processed event handlers returns a true response, no further stacked executions take place.

Replication Code


fnc_test1 = {
 diag_log "[ALiVE-TEST] - Test 1 - Success!";
 _result = true;
 _result;
};

fnc_test2 = {
 diag_log "[ALiVE-TEST] - Test 2 - Success!";
};

_control = finddisplay 12 displayctrl 51; 

_control ctrladdeventhandler ["mousebuttonclick","[] call fnc_test2"];
_control ctrladdeventhandler ["mousebuttonclick","[] call fnc_test1"]; 

Replication Output

17:37:23 "[ALiVE-TEST] - Test 1 - Success!"
17:37:23 [ACRE] (sys_io) INFO: Pipe error: Read CreateFileA WinErrCode: 2
17:37:28 ALiVE has hooked abort button: B Alpha 1-3:1 (Trap)
17:37:28 ALiVE has hooked abort button: B Alpha 1-3:1 (Trap)

Commits