Jump to content
reggaeman007jah

Initiate script on dialog exit?

Recommended Posts

Hello good folks, I was hoping to get some guidance on a syntax issue I am having with a basic dialog project.

 

I have a button (in dialogs.hpp) to close the dialog (which works as intended), but I would like to also trigger a simple script as well, when the 'action' is triggered.

 

This is what I have in the class, which works fine as it is:

 

class exitButton: RscButton
        {
            idc = 1601;
            x = 0.335 * safezoneW + safezoneX;
            y = 0.600 * safezoneH + safezoneY;
            w = 0.099 * safezoneW;
            h = 0.077 * safezoneH;
            action = "closeDialog 0";
        };

 

What I would like to do, is to execVM a script as part of the action. So // closeDialog 0 + execVM "myscript.sqf"; // 

 

I sadly lack the basic knowledge to string these things together, and was hoping someone could advise on the syntax to do this?

 

Cheers

RM

 

 

Share this post


Link to post
Share on other sites

Example:

class someDialog
{
	idd = 12345;
	onLoad = "uiNamespace setVariable [""someDialog"", (_this select 0)];";
	onUnload = "uiNamespace setVariable [""someDialog"", nil];";
	class Controls
	{

Use this one if you want to do it when you click a button:

action = ""; // on button control

If you have any further questions, just ask! (:

Share this post


Link to post
Share on other sites
action = "closeDialog 0; nul = [] execVM 'myScript.sqf'";

 

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

×