Jump to content
Safkon

GUI dialog CT_OBJECT_CONTAINER

Recommended Posts

Hi!
I have problems with CT_OBJECT_CONTAINER. I try to create GUI with in-game object like tablet ("Land_Tablet_02_F") and I don't understand how to use 'class Areas'.
I read wiki: https://community.bistudio.com/wiki/DialogControls-Objects

But I think not all objects can be used with CT_OBJECT_CONTAINER. In Areas I must declare separate parts (each with his own class) with controls and set selection of object which would be used for rendering controls.

So, I use 'selectionNames object' (https://community.bistudio.com/wiki/selectionNames) and get values: ['Camo_1', 'Camo_2'], but no one works. Wiki says: "For an object with selections one can use user texture. For example "\A3\Misc_F\Helpers\UserTexture1m.p3d" has selections: usertexture, usertexture TL,usertexture TR, usertexture BL". I know that tablet has texture for display, but usertexture not working.

Is it possible?

GUI code:

Spoiler

 


class UI_Tablet
{
	idd = 999; // Display identification
	enableSimulation = 1; // 1 (true) to allow world simulation to be running in the background, 0 to freeze it
	enableDisplay = 0; // 1 (true) to allow scene rendering in the background

	class Objects // UI objects
	{
		class _CT_OBJECT_CONTAINER
		{
			access = 0; // Control access (0 - ReadAndWrite, 1 - ReadAndCreate, 2 - ReadOnly, 3 - ReadOnlyVerified)
			idc = CT_OBJECT_CONTAINER; // Control identification (without it, the control won't be displayed)
			type = CT_OBJECT_CONTAINER; // Type
			style = ST_LEFT; // Style
			blinkingPeriod = 0; // Time in which control will fade out and back in. Use 0 to disable the effect.

			model = "\A3\Props_F_Exp_A\Military\Equipment\Tablet_02_F.p3d"; // Displayed model
			scale = 6; // Model scale

			x = 20 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal coordinates
			y = 10 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical coordinates
			z = 1; // Depth coordinates

			xBack = 25 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X; // Horizontal background coordinates
			yBack = 12 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y; // Vertical background coordinates
			zBack = 1; // Depth background coordinates

			enableZoom = 0; // Allow foreground/background transformation
			zoomDuration = 0.5; // Speed of foreground/background transformation
			inBack = 0; // Start in back (Back coordinates are used)

			direction[] = {0, -0.35, 0}; // Model vector dir
			up[] = {0, 0.65, -0.35}; // Model vector up

			tooltip = "CT_OBJECT"; // Tooltip text
			tooltipColorShade[] = {0,0,0,1}; // Tooltip background color
			tooltipColorText[] = {1,1,1,1}; // Tooltip text color
			tooltipColorBox[] = {1,1,1,1}; // Tooltip frame color

			class Areas // Configurable UI areas. Normally interactive controls (buttons, listboxes, ...) are not interactive here.
			{
				class UserTexture
				{
					selection = "Camo_2"; // Model selection on which the UI will be rendered usertexture, usertexture TL,usertexture TR, usertexture BL
					class Controls
					{
						class _ST_PICTURE_video
						{
							type = CT_STATIC;
							idc = ST_PICTURE + 1000;
							style = ST_PICTURE;
							
							text = "\A3\Missions_F_Bootcamp\video\VR_BOOT.ogv";
							sizeEx = GUI_GRID_CENTER_H;
							font = GUI_FONT_NORMAL;
							lineSpacing = 1;
							colorText[] = {1,1,1,1};
							colorBackground[] = {1,0.5,0,1};
							
							x = 0; //1 * GUI_GRID_CENTER_W + GUI_GRID_CENTER_X;
							y = 0; //1 * GUI_GRID_CENTER_H + GUI_GRID_CENTER_Y;
							w = 20 * GUI_GRID_CENTER_W;
							h = 20 * GUI_GRID_CENTER_H;
					
							autoplay = 1;
							loops = 1;
						};
					};
				};
			};
		};
	};
};


P.S. this example with model "\A3\Misc_F\Helpers\UserTexture1m.p3d"  and selection = "usertexture" works fine.

P.P.S. I know workaround - using picture of tablet like background, but it's less interesting

Also I have VBS dialog example, but there are not "class Areas"

Share this post


Link to post
Share on other sites

Hey man, I recently was trying to do this myself and ran into the same issue. Stumbled upon your post here, were you ever able to figure out a solution? I'd love to be able to play a video on a 3D GUI object like the tablet.

 

I can confirm that this works with the UserTexture helper but I can't get it working with the tablet.

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

×