Jump to content
Sign in to follow this  
raptor 6 actual

Dialog creation questions

Recommended Posts

Hello all!

I see that there are a lot of threads out there about dialog creation, and then, the fact that there is a great tutorial that has helped me learn the GUI editor in A3. However, neither the threads created already, nor the tutorial answers questions that may fall between the gaps.

1) I have a pretty complex dialog in the works. The user can select different menu options on screen, but does every menu creation I have created, need to be onscreen all at once, and only made opaque once it's needed?

2) Leading off of the first question...can someone explain to me the concept of Parent and Child dependencies on dialogs? The wiki doesn't really help. Is it a matter of inheritance, because I understand that, and am using it to much satisfaction.

3) I have an empty_checkbox.paa as a class RscPicture. In the middle of that checkbox, I created a button. The idea was that when the user clicked on the button, that I could use this line of code in the ACTION field of that button class, like this action = "ctrlSetText [2503,"data\checkedBox.paa"];" However, I keep crashing to desktop when I load the mission. The error says something about "/" encountered instead of "=". I can get the exact codes for you if needed. But, long story short, is there a better way to have the dialog pop up with an empty checkbox, allow the user to click on that box, and change the empty checkbox to one with a check mark in it? Is there a certain way that I need to layer these buttons?

4) Can someone explain in "retard style" what disableSerialization is for. Again, the wiki for this particular function is worded in a novice level, and I'm still a noob. Do I need it for a complex dialog?

I know this is a lot of vague information, but I don't know that I'm at a point where I can upload the info on here without it confusing someone more...but I'll be happy to send it in a PM.

If anyone can be so kind as to look over these questions and help me figure out the answers, I'd be very grateful.

Share this post


Link to post
Share on other sites

Ill try my best to answer some of these:

1) Generally, when you load a dialog, all controls are shown - you can however hide certain controls using a few methods:

a) onLoad display handler - you specify in your dialog class a handler for when the display is loaded, hiding your controls in preferably a separate script:

class myDialog {
onLoad = "_this execVM 'onLoadInit.sqf'";
//... etc
}


onLoadInit.sqf
_display = _this select 0; // onload sends [display] as argument

ctrlShow[3001, false]; // assuming that the idc of the control you want to hide is 3001
// keep doing this for all other controls
// or
{
  ctrlShow[_x, false];
} foreach [3001, 3002, 3003, 3004, ...];

b) In the script that creates the dialog - immediately after creating the dialog, you can use ctrlShow to hide the specified controls there, this would probably be easier, but you might see the controls flicker when you open up the dialog. (onLoad handler executes just before the gui is displayed, where as hiding it after createDialog causes the gui to show first, then hide the controls)

2) Parent is simply that - the parent of the control/class. A parent can be the base class you are inheriting from, or it can be the class that contains the child class.

Example:

class Parent
{
    class Child {}; 
}; 

class Parent2
{
    class controls {
           class myControl {}; // this is a child of Parent2 - because Parent2 contains myControl within itself
    };
};

class Parent3 {};

class Child2 : Parent3 {};

3) from what I understand, the problem here is that action is a string, so you have to use "" "" or ' ' to wrap nested strings inside:

action = "ctrlSetText [2503,'data\checkedBox.paa'];"

4) this command exists as a workaround to the limitations of variable assignment/setVariable for control and display types. From what I understand, controls and displays cannot be serialized within the engine (but I assume all other data types can be) so in order for the engine to communicate with your script, it needs to be able to read these values. By specifying disableSerialization; in your code, you tell the engine to:

a) NOT serialize these variables

b) Do not save these script variables when the mission is saved

c) when the mission loads, whatever state the script was in is not saved. (may require restarting the script)

however be warned - you cannot use setVariable for control or display types - the game will warn you that these types are not serializable, however you can store the control or display in an array. I dont know why -[control]- works and -control- doesn't, but I think its because the dialog aspect is not feature complete in the engine.

Do you need disableSerialization? Only if you plan to use variables to reference control and display types (idd and idc numbers dont count)

Edited by Igneous01

Share this post


Link to post
Share on other sites

Thank you for those answers. I'll try and work on it, and when I get it progressed more, I will record it in a video or something, so that you have a better idea of what the final result will be.

Share this post


Link to post
Share on other sites

New question...

I have spent hours designing this initial background and getting it into the right position, so that it covers my entire screen. However, on a friend's screen, it doesn't cover it. I have found "SafeZone" in the BI wiki and it states some of the code I should be using. My current Video Display settings on a 40" monitor are:

Display Mode: Fullscreen Window

Resolution: 1768 x 992

Aspect Ratio: Custom

VSYNC: Enabled

Interface Size: Large

My code for the background image which covers the full screen for me is:

class TEST_BACK: Test_backgroundBase
	{
		idc = 2200;
		text = "testImage.paa";
		x = -0.85;
		y = -1.19;
		w = 2.7;
		h = 3.375;
	};

The image itself is 2048 pixels x 2048 pixels.

What should the end result be to ensure that no matter what resolution or aspect ratio a person is using, that the image will not allow any gaps on the sides?

Share this post


Link to post
Share on other sites

Go back in the GUI editor and paste a new background up. Then go into the properties and save as safeZone, not absolute or GUI GRID (bottom left of the properties dialog). That should account for full screen. Not sure how this works on multiple monitor setups but you can look at using safezoneABS manually after you save. That should account for different sized screens

Sorry, I'm at work so can't check on a PC but hit me up if you get stuck.

Share this post


Link to post
Share on other sites

I'm getting a friend to try out the newest version per your suggestions (can't trust my own monitor obviously). I will report back when he tells me how it went. Thanks for the help.

Share this post


Link to post
Share on other sites

For entire screen on any monitor, try no safeZone.

x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH; 

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  

×