Jump to content
ShadowRanger24

Closing EG Spectator Menu

Recommended Posts

So I'm trying to make it possible to close the EG Spectator Mode with having it initialized via a script (not the debug console in the escape menu). Currently the main way of closing it is just to click the 'Spectator' button in the debug console. But if your mission has the debug console disabled and you're initializing the spectator menu via a script, how are you meant to close it? I know that you can use '["Terminate"] call BIS_fnc_EGSpectator' but how can you call this through a key press if KeyPressed does not run while a player is in the spectator menu? Thanks in advance.

  • Like 1

Share this post


Link to post
Share on other sites

Nevermind guys, figured out a few ways to do it. I just needed to add a KeyDown event handler to the EG spectator dialog for it to detect key presses. Thanks anyways.

  • Like 1

Share this post


Link to post
Share on other sites
On 3/22/2017 at 7:44 PM, ShadowRanger24 said:

Nevermind guys, figured out a few ways to do it. I just needed to add a KeyDown event handler to the EG spectator dialog for it to detect key presses. Thanks anyways.

 

Hey, I'm trying to do this too, could you share how you did it? I cant seem to get it working

 

Share this post


Link to post
Share on other sites
20 hours ago, thegamerscat said:

 

Hey, I'm trying to do this too, could you share how you did it? I cant seem to get it working

 

DS_egKeyDown = (findDisplay 60492) displayAddEventHandler ["KeyDown", {
	_handled = false;

	switch (_this select 1) do {
		case 68: {
			(findDisplay 60492) displayRemoveEventHandler ["KeyDown", DS_egKeyDown];
			["Terminate"] call BIS_fnc_EGSpectator;

			_handled = true;
		};

	_handled
}];

 

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

×