Jump to content
Sign in to follow this  
By-Jokese

[HELP] Dialog - Send data to script

Recommended Posts

I have a custom dialog, with an edit box and a button. I need to send the text entered by the user to a custom script.

 

What do I have to put in the action parameter for sending that data to the script.

 

Thank you.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks! Will try it and see if I have any problems. @HazJ

 

EDIT: is this correct?

action = "[ctrlText 100] execVM 'Scripts/script_name.sqf'";

 

Share this post


Link to post
Share on other sites

@By-Jokese

action = "[] execVM 'Scripts/script_name.sqf'";

In script_name.sqf

disableSerialization;

_display = uiNamespace getVariable "something";
// OR
_display = findDisplay IDD;

_inputText = ctrlText (_display displayCtrl 100);

systemChat format [":: %1", _inputText];

I personally don't use action anymore. How I would do it is using ButtonClick EH.

https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onButtonClick

disableSerialization;
_display = findDisplay IDD;
(_display displayCtrl 100) ctrlAddEventHandler ["ButtonClick",
{
	params ["_button"];
	_inputText = ctrlText (findDisplay IDD displayCtrl _button);
	systemChat format [":: %1", _inputText];
}];

 

  • Like 1

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  

×