• 0
Sign in to follow this  
Erzengel

close multiple dialogs

Question

Hey, iam curently working on an welcome message where i need to put in a "close all messages" button. when creating the button i did put in action = "closeDialogxxx;closeDialogxxxx;closeDialogxxxxx;";

xxx represents the unice dialog id.

when pressing the button ingame it just closes one of this 3 dialog windows.

i will quickly put in the button code

class s_buttonclose: RscButton
{
	idc = 1600;
	text = "CLOSE ALL MESSAGES"; //--- ToDo: Localize;
	x = 0.355625 * safezoneW + safezoneX;
	y = 0.731 * safezoneH + safezoneY;
	w = 0.28875 * safezoneW;
	h = 0.044 * safezoneH;
	colorBackground[] = {0,0,0,0.7};
	action = "closeDialog 99887766;closeDialog 998877662;closeDialog 998877663;";
};

can anyone tell me what i did wrong here ?

 

Edit: for those that say hey i might need to see your rpt.. log nothing. for those that say i need to see full script.. here it is: http://nonvirtual.de/welcome.rar

Edited by Erzengel

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0
4 hours ago, Erzengel said:

Hey, iam curently working on an welcome message where i need to put in a "close all messages" button. when creating the button i did put in action = "closeDialogxxx;closeDialogxxxx;closeDialogxxxxx;";

xxx represents the unice dialog id.

when pressing the button ingame it just closes one of this 3 dialog windows.

i will quickly put in the button code


class s_buttonclose: RscButton
{
	idc = 1600;
	text = "CLOSE ALL MESSAGES"; //--- ToDo: Localize;
	x = 0.355625 * safezoneW + safezoneX;
	y = 0.731 * safezoneH + safezoneY;
	w = 0.28875 * safezoneW;
	h = 0.044 * safezoneH;
	colorBackground[] = {0,0,0,0.7};
	action = "closeDialog 99887766;closeDialog 998877662;closeDialog 998877663;";
};

can anyone tell me what i did wrong here ?

 

Edit: for those that say hey i might need to see your rpt.. log nothing. for those that say i need to see full script.. here it is: http://nonvirtual.de/welcome.rar

closeDialog NUMBER is not the displayID, it's the exit code.

closeDialog just closes the upmost dialog, when this code runs, it closes the same dialog 3 times, because the dialog won't close until the next game tick.

0 just exits, without emulating a button press.
#define IDC_OK      1 //emulate "Ok" button
#define IDC_CANCEL  2 //emulate "Cancel" button

what you're looking for is closeDisplay.

//Find the display from it's ID, and then close it without emulating a button click.
(findDisplay 99887766) closeDisplay 0;
(findDisplay 998877662) closeDisplay 0;
(findDisplay 998877663) closeDisplay 0;

 

Edited by StokesMagee

Share this post


Link to post
Share on other sites
  • 0
14 minutes ago, StokesMagee said:

closeDialog NUMBER is not the displayID, it's the exit code.


0 just exits, without emulating a button press.
#define IDC_OK      1 //emulate "Ok" button
#define IDC_CANCEL  2 //emulate "Cancel" button

what you're looking for is closeDisplay.


//Find the display from it's ID, and then close it without emulating a button click.
(findDisplay 99887766) closeDisplay 0;
(findDisplay 998877662) closeDisplay 0;
(findDisplay 998877663) closeDisplay 0;

 

if i do understand that right, this will close the dialog right away not on button press, right ?

Share this post


Link to post
Share on other sites
Advertisement
  • 0
16 minutes ago, Erzengel said:

if i do understand that right, this will close the dialog right away not on button press, right ?

class s_buttonclose: RscButton
{
	idc = 1600;
	text = "CLOSE ALL MESSAGES"; //--- ToDo: Localize;
	x = 0.355625 * safezoneW + safezoneX;
	y = 0.731 * safezoneH + safezoneY;
	w = 0.28875 * safezoneW;
	h = 0.044 * safezoneH;
	colorBackground[] = {0,0,0,0.7};
	action = "(findDisplay 99887766) closeDisplay 0;(findDisplay 998877662) closeDisplay 0;(findDisplay 998877663) closeDisplay 0;";
};

Share this post


Link to post
Share on other sites
  • 0
18 minutes ago, StokesMagee said:

class s_buttonclose: RscButton
{
	idc = 1600;
	text = "CLOSE ALL MESSAGES"; //--- ToDo: Localize;
	x = 0.355625 * safezoneW + safezoneX;
	y = 0.731 * safezoneH + safezoneY;
	w = 0.28875 * safezoneW;
	h = 0.044 * safezoneH;
	colorBackground[] = {0,0,0,0.7};
	action = "(findDisplay 99887766) closeDisplay 0;(findDisplay 998877662) closeDisplay 0;(findDisplay 998877663) closeDisplay 0;";
};

okay, thanks for your fast reply, but now it does not even close one of the dialogs ...

Share this post


Link to post
Share on other sites
  • 0
33 minutes ago, Erzengel said:

okay, thanks for your fast reply, but now it does not even close one of the dialogs ...

change the displayID to something smaller maybe? like 42069...

Share this post


Link to post
Share on other sites
  • 0
49 minutes ago, StokesMagee said:

change the displayID to something smaller maybe? like 42069...

allright! thats it. thank u so much <3

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.