Page MenuHomeFeedback Tracker

3DEN Editor - Unable to Add Event Handler (With Workaround)
Confirmed Internally, NormalPublic

Description

Trying to add an event handler to the EDEN Editor map control and defining the control before the event handler itself is added, results in a failure to add the event - it will output no errors and behave as if nothing happened.

See this example;

0 spawn {
	disableSerialization;
	_mapControl = (findDisplay 313 displayCtrl 51);
	_mapControl ctrlAddEventHandler ["MouseButtonUp", {
		params ["_display", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
			_coords = _display ctrlMapScreenToWorld [_xPos, _yPos];
			[format["X: %1 | Y: %2", (_coords select 0), (_coords select 1)], 0] call BIS_fnc_3DENNotification;
	}];
};

However, if you instead use a display event handler and define the control within the code - it does work. Like this;

0 spawn {
	disableSerialization;
	_mapControl = (findDisplay 313);
	_mapControl displayAddEventHandler ["MouseButtonUp", {
		params ["_display", "_button", "_xPos", "_yPos", "_shift", "_ctrl", "_alt"];
			_coords = (_display displayCtrl 51) ctrlMapScreenToWorld [_xPos, _yPos];
			[format["X: %1 | Y: %2", (_coords select 0), (_coords select 1)], 0] call BIS_fnc_3DENNotification;
	}];
};

I'm not entirely sure if this behaviour is to be expected with how the EDEN Editor works, but the former example works during mission play if you use display 12(ingame map).

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
10.0.19041
Category
Eden Editor
Steps To Reproduce

Paste the above code examples into the debug console whilst in the EDEN Editor.

Event Timeline

Dealman created this task.Dec 20 2020, 2:51 PM
R3vo changed the task status from New to Confirmed Internally.Jun 24 2021, 8:39 AM
R3vo added a subscriber: R3vo.

Confirmed in v2.04.