Page MenuHomeFeedback Tracker

[Feature Request] New scripting command: diag_allEventhandlers
New, NormalPublic

Description

We got the diag_allMissionEventHandlers which is nice, so why not same for other types of events?

diag_allEventHandlers <target>

<target> could be object, display or control. Would return all eventhandlers added with any of the addEventHandler family commands to the given target.
Would return a array of arrays [[<eh type>, <handle>], [<eh type>, <handle>], ...[<eh type>, <handle>]] for more convenient use with the remove event commands.

A layman boob would assume that this shouldn't be that hard to achieve since the handles are already stored by type somewhere since the ehs can be removed with said params? 🤔

Of course a massively awesome bonus would be if the returned data would also contain where the event was added, but that's probably asking a bit much:
[<eh type>, <handle>, <function that added it>]

<function that added it> could be either a filename (sqf script, fsm) or in case of compiled function the function name. If added inside some event return empty string (unless the event code can be somehow identified?)

So something like

//someSqf.sqf script
player addEventHandler ["killed", {systemChat "died"}];

//someOtherSqf.sqf
diag_allEventHandlers player; //would return events like the one added above: ["killed", 4, "someSqf.sqf"]

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7
Category
Engine

Event Timeline

h- created this task.Aug 31 2020, 7:15 PM
DrSova added a subscriber: DrSova.Sep 4 2020, 3:01 PM