Jump to content
Sign in to follow this  
M1ke_SK

check if _control exist

Recommended Posts

I have created control in mission:
with uiNamespace do 
{
	[] spawn 
	{
		waitUntil {!isNull findDisplay 46};
		disableSerialization;
		_ctrl = findDisplay 46 ctrlCreate ["RscStructuredText", -1];
		_ctrl ctrlSetPosition [x, y, w, h];
		_ctrl ctrlCommit 0;

		while { true } do 
		{ 
			_ctrl ctrlSetStructuredText parseText format ["myText: %1", valueFromSomeWhere];
		}; 

	};
};
Problem: Every time, when I reset game this control is created again and again and it is over-placing previous control.
Question: Is there a way to check if control exist and if not, create new one?
 
Note: should I set id (-1 in this case) of this control ?

Share this post


Link to post
Share on other sites

By reset you mean pressing restart button? Mission display 46 does not reset when you press restart button. You have to go back to editor and start preview again.

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  

×