Page MenuHomeFeedback Tracker

Allow ctrlAddEventHandler to pass arguements
Need More Info, WishlistPublic

Description

ctrlAddEventHandler is very useful, but when using in scripts, the only way to pass an arguement into the handler is to create a global variable and return the global variable from inside the handler code. This can cause errors when using the handler multiple times when the global variables are overwritten.

Please can you add the functionality to pass arguements to the ctrlAddEventHandler command

Details

Legacy ID
3627237949
Severity
None
Resolution
Open
Reproducibility
Unable To Reproduce
Category
Scripting

Event Timeline

Bohemia set Category to Scripting.Feb 27 2015, 2:16 PM
Bohemia set Reproducibility to Unable To Reproduce.
Bohemia set Severity to None.
Bohemia set Resolution to Open.
Bohemia set Legacy ID to 3627237949.May 8 2016, 11:33 AM

Can you give an example of what you have in mind because I'm pretty sure there is a way to do it, maybe not exactly how you imagined it.

SaOk added a subscriber: SaOk.May 8 2016, 11:33 AM
SaOk added a comment.Mar 4 2015, 7:48 PM

You can use format to get any parameters in, and in draw update the parameter with functions. e.g.
_id = (findDisplay 12 displayCtrl 51) ctrlAddEventHandler ["Draw",format ["
(_this select 0) drawIcon [

		'%4',
		%3,
		(%1 call FUPCOR),
		21,
		21,
		0,
		'%2',
		2,
		0.035,
		'TahomaB',
		'right'

]
",_pos1,_text,_color,_icon]];