Jump to content
Marius1773

Game Crashes with Eventhandler "LBDblClick"

Recommended Posts

Hey everybody, 

 

so I got this little piece from @Larrow and wanted to edit the fnc_test, so that the selected Item going to be removed with removeItem.

It does work with the eventhandler "LBSelChanged" but If I do "LBDblClick" my game just crashes.

I hope someone can help me with this Issue 🙂

handle = [] spawn {
   fnc_test = { 
   	_idc = ctrlIDC (_this select 0);
   	_selectedIndex = _this select 1;
	_itemToRemove = lbData [_idc, _selectedIndex];
	player removeItem _itemToRemove;
   	false
   };
   while {true} do {
       waituntil {!(isnull (finddisplay 602))};
       hint "Double Click on Item to Remove";
       ((findDisplay 602) displayCtrl 633) ctrlSetEventHandler ["LBDblClick", "_this call fnc_test"];
       waituntil {isnull (finddisplay 602)};
   };
};  

 

Share this post


Link to post
Share on other sites

Try this: 
 

0 = [] spawn { 
	fnc_test = { 
  		Private _idc = ctrlIDC (_this select 0); 
  		Private _selectedIndex = _this select 1; 
  		Private _itemToRemove = lbData [_idc, _selectedIndex]; 

		(findDisplay 602) closeDisplay 1;
		_itemToRemove spawn {sleep 0.1; player removeItem _this};
		false 
	}; 
	while {true} do { 
		waitUntil {Sleep 0.1; !isNull (findDisplay 602)}; 
 		hint "Double Click on Item to Remove";
		{ 
  			((findDisplay 602) displayCtrl _x) ctrlSetEventHandler ["LBDblClick", "_this call fnc_test"]; 
		} ForEach [619,633,638];
  		waitUntil {Sleep 0.1; isNull (findDisplay 602)}; 
	}; 
};

 

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

×