Jump to content

Sign in to follow this  
Schatten

Display EH doesn't work

Recommended Posts

Hi!

Doesn't work this display EH:

(findDisplay 49) displayAddEventHandler ["onLoad", {_this call onLoadMultiplayerMenu}];

Even doesn't work this simple display EH:

(findDisplay 49) displayAddEventHandler ["onLoad", {hint "It works!"}];

No errors in RPT file.

What's the problem?

Share this post


Link to post
Share on other sites

If you're trying to get the display for the main game (right when you load the mission), that's because the game uses display 46.

Share this post


Link to post
Share on other sites
  DreadedEntity said:
If you're trying to get the display for the main game (right when you load the mission), that's because the game uses display 46.

I know, but I'm trying to get display for multiplayer menu that opens by pressing Esc.

I'm using this code and it's works fine:

disableSerialization;

while {true} do {
waitUntil {
	sleep 0.1;

	!(isNull (findDisplay 49))
};

...
};

Share this post


Link to post
Share on other sites

In your GUI definition, add onLoad = "uiNamespace setVariable ['escMenu', (_this select 0)]";

Then when you try to add your display event handler you should be able (in theory) to call it with (findDisplay (uiNamespace getVariable "escMenu")) displayAddEventHandler [stuff];

Share this post


Link to post
Share on other sites
  DreadedEntity said:
In your GUI definition, add onLoad = "uiNamespace setVariable ['escMenu', (_this select 0)]";

How? Is it possible to edit BI's GUI definitions? Display with IDD 49 is standard menu that opens by pressing Esc in multiplayer or singleplayer.

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  

×