Jump to content
Sign in to follow this  
eagledude4

addEventhandler not calling function

Recommended Posts

I call the function with a handler:

shopKeyHandler = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call ED4_fnc_onKeyPressShop"];

"checkInput" isn't writing to chat.

//By Eagledude4

systemChat "checkInput";

_key = _this select 1;
_keylist = [
11, //0 key
2, //1 key
3, //2 key
4, //3 key
5, //4 key
6, //5 key
7, //6 key
8, //7 key
9, //8 key
10, //9 key

82, //num 0
79, //num 1
80, //num 2
81, //num 3
75, //num 4
76, //num 5
77, //num 6
71, //num 7
72, //num 8
73 //num 9
];

_control = (findDisplay 2003) displayCtrl 1;
_cursel = lbCurSel _control;

if (!(_key in _keylist)) exitWith {
false
};

if (_key in [11, 82]) exitwith {
if (ctrlText 2 == "") then {
	_data 	= lbData [_control, _cursel];
	_data	= call compile _data;
	_item 	= _data select 0;
	systemChat format ["You must buy atleast 1 %1", _item];
	false
};
};

[_control, _cursel] call ED4_fnc_buyDialogUpdate;

true

Edited by eagledude4

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×