Jump to content
Sign in to follow this  
paranoid_giraffe

Dialog Doesn't Appear

Recommended Posts

I have no idea why my dialog doesn't show up. I have been at it for two days, just trying to get something to appear. I have read practically all I could about dialogs on the wiki and I still don't understand why it doesn't show up. I even tried the Noob's guide to Dialogs by a Noob, and I can't get it to appear there either. It just doesn't appear. Here are my files:

description.ext

author="Paranoid_Giraffe";
OnLoadName="CQB Training Facility";
OnLoadMission="A dynamic CQB training facility with different scenarios and AI placement created for JTF2.";
respawn = BASE;
respawndelay = 10;
disabledAI = true;

#include "cqbmenu\dialogs.hpp"

cqbmenu\dialogs.hpp

#include "defines.hpp"

class CQB_DIALOG {

idd=-1
movingenable = true;
enableSimulation = true;
controlsbackground[] = { };
objects[] = { };
controls[] = {
	CQB_FRAME,
	CQB_B1,
	CQB_B2,
	CQB_B3,
	CQB_B4,
	CQB_B5
};

class RscFrame {
idc = 1801;
text = "CQB Facility"; //--- ToDo: Localize;
w = 10 * GUI_GRID_W;
h = 13 * GUI_GRID_H;
sizeEx = 1.25 * GUI_GRID_H;
type = CT_STATIC;      // constant
style = ST_LEFT;       // constant
font = FontM;
colorBackground[] = { 1, 1, 1, 0.3 };
colorText[] = { 0, 0, 0, 1 };
color[] = { 1, 1, 1, 1 };
colorActive[] = { 1, 0.2, 0.2, 1 };
};

class RscButton {
idc = 1601;
text = "Layout #1"; //--- ToDo: Localize;
w = 7 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
sizeEx = 1.25 * GUI_GRID_H;
type = CT_STATIC;      // constant
style = ST_LEFT;       // constant
font = FontM;

   colorText[] = {1,1,1,.9};
   colorDisabled[] = {0.4,0.4,0.4,0};
   colorBackground[] = {0.75,0.75,0.75,0.8};
   colorBackgroundDisabled[] = {0,0.0,0};
   colorBackgroundActive[] = {0.75,0.75,0.75,1};
   colorFocused[] = {0.75,0.75,0.75,.5};
   colorShadow[] = {0.023529,0,0.0313725,1};
   colorBorder[] = {0.023529,0,0.0313725,1};
};

class CQB_FRAME: RscFrame {
text = "CQB Facility"; //--- ToDo: Localize;
x = 2 * GUI_GRID_W + GUI_GRID_X;
y = 4 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B1: RscButton {
text = "Layout #1"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 6 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B2: RscButton {
text = "Layout #2"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 8 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B3: RscButton {
text = "Layout #3"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 10 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B4: RscButton {
text = "Layout #4"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 12 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B5: RscButton {
text = "Layout #5"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 14 * GUI_GRID_H + GUI_GRID_Y;
};
};
[code][/spoiler]
[b]cqbmenu\defines.hpp[/b]
[spoiler][code]
#define cqb_dialog_loaded true

#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_SLIDER 3
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_TOOLBOX 6
#define CT_CHECKBOXES 7
#define CT_PROGRESS 8
#define CT_HTML 9
#define CT_STATIC_SKEW      10
#define CT_ACTIVETEXT 11
#define CT_TREE 12
#define CT_STRUCTURED_TEXT 13
#define CT_CONTEXT_MENU 14
#define CT_CONTROLS_GROUP 15
#define CT_SHORTCUTBUTTON 16
#define CT_XKEYDESC 40
#define CT_XBUTTON          41
#define CT_XLISTBOX 42
#define CT_XSLIDER 43
#define CT_XCOMBO           44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT 80
#define CT_OBJECT_ZOOM 81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK 98
#define CT_ANIMATED_USER 99
#define CT_MAP              100
#define CT_MAP_MAIN 101
#define CT_LISTNBOX 102

// Static styles
#define ST_POS            0x0F
#define ST_HPOS           0x03
#define ST_VPOS           0x0C
#define ST_LEFT           0x00
#define ST_RIGHT          0x01
#define ST_CENTER         0x02
#define ST_DOWN           0x04
#define ST_UP             0x08
#define ST_VCENTER        0x0c

#define ST_TYPE           0xF0
#define ST_SINGLE         0
#define ST_MULTI          16
#define ST_TITLE_BAR      32
#define ST_PICTURE        48
#define ST_FRAME          64
#define ST_BACKGROUND     80
#define ST_GROUP_BOX      96
#define ST_GROUP_BOX2     112
#define ST_HUD_BACKGROUND 128
#define ST_TILE_PICTURE   144
#define ST_WITH_RECT      160
#define ST_LINE           176

#define ST_SHADOW         0x100
#define ST_NO_RECT        0x200 // this style works for CT_STATIC in conjunction with ST_MULTI
#define ST_KEEP_ASPECT_RATIO  0x800

#define ST_TITLE          ST_TITLE_BAR + ST_CENTER

// Slider styles
#define SL_DIR            0x400
#define SL_VERT           0
#define SL_HORZ           0x400

#define SL_TEXTURES       0x10

// Listbox styles
#define LB_TEXTURES       0x10
#define LB_MULTI          0x20

#define FontM             "PuristaMedium"

And then I have a radio trigger that runs the following script:

cqbmenu\open.sqf


_ok = createDialog "CQB_DIALOG";
if !(_ok) exitwith hint "Dialog did not open";
if (_ok) exitwith hint "Dialog did open";
disableSerialization;

ctrlShow [1601,false];
ctrlShow [1801,false];


//ctrlShow [1601,true];
//ctrlShow [1801,true];

The open.sqf does tell me that the dialog opens with the hint line, but I don't see it and I have rearranged a thousand things to see if it works, and I get nothing. Can someone help me? Please do not refer me to the guide or wiki, I have already checked those out.

Share this post


Link to post
Share on other sites

im not certain but don't u need the controls class?

try using all this code for your dialogs.hpp


#include "defines.hpp"

class CQB_DIALOG {

idd=-1
movingenable = true;
enableSimulation = true;
controlsbackground[] = { };
objects[] = { };
controls[] = {
CQB_FRAME,
CQB_B1,
CQB_B2,
CQB_B3,
CQB_B4,
CQB_B5
};
class Controls
   {
class RscFrame {
idc = 1801;
text = "CQB Facility"; //--- ToDo: Localize;
w = 10 * GUI_GRID_W;
h = 13 * GUI_GRID_H;
sizeEx = 1.25 * GUI_GRID_H;
type = CT_STATIC; // constant
style = ST_LEFT; // constant
font = FontM;
colorBackground[] = { 1, 1, 1, 0.3 };
colorText[] = { 0, 0, 0, 1 };
color[] = { 1, 1, 1, 1 };
colorActive[] = { 1, 0.2, 0.2, 1 };
};

class RscButton {
idc = 1601;
text = "Layout #1"; //--- ToDo: Localize;
w = 7 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
sizeEx = 1.25 * GUI_GRID_H;
type = CT_STATIC; // constant
style = ST_LEFT; // constant
font = FontM;

colorText[] = {1,1,1,.9};
colorDisabled[] = {0.4,0.4,0.4,0};
colorBackground[] = {0.75,0.75,0.75,0.8};
colorBackgroundDisabled[] = {0,0.0,0};
colorBackgroundActive[] = {0.75,0.75,0.75,1};
colorFocused[] = {0.75,0.75,0.75,.5};
colorShadow[] = {0.023529,0,0.0313725,1};
colorBorder[] = {0.023529,0,0.0313725,1};
};

class CQB_FRAME: RscFrame {
text = "CQB Facility"; //--- ToDo: Localize;
x = 2 * GUI_GRID_W + GUI_GRID_X;
y = 4 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B1: RscButton {
text = "Layout #1"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 6 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B2: RscButton {
text = "Layout #2"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 8 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B3: RscButton {
text = "Layout #3"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 10 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B4: RscButton {
text = "Layout #4"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 12 * GUI_GRID_H + GUI_GRID_Y;
};
class CQB_B5: RscButton {
text = "Layout #5"; //--- ToDo: Localize;
x = 3.5 * GUI_GRID_W + GUI_GRID_X;
y = 14 * GUI_GRID_H + GUI_GRID_Y;
};
};
};

Edit:

if it crashes try to remove your controls array

Edited by falconx1

Share this post


Link to post
Share on other sites

Not even that works. And yes, I did test it with the "exitWith" commented out on the open.sqf script. Do you know of any dialogs that would be easy to edit so I could make my own? I'm just so frustrated with the lack of usable info on the wiki right now.

Share this post


Link to post
Share on other sites
Not even that works. And yes, I did test it with the "exitWith" commented out on the open.sqf script. Do you know of any dialogs that would be easy to edit so I could make my own? I'm just so frustrated with the lack of usable info on the wiki right now.

hi

try to do it easy..

description.ext

class RscTitles
{
 class MY_superDialog
 {
   idd = -1;
   duration = 15;
   movingEnable = false;
   enableSimulation = false;
   controls[] = { "MY_superControl" };

   onLoad = "uiNamespace setVariable [""MY_superDialog_display"", _this select 0];";

   class MY_superControl
   {
     idc = 666;

     type = 13;
     style = 0;

     text = "It works!";
     size = 0.05;

     colorBackground[] = { 0, 0, 0, 1 };
     colorText[] = { 1, 1, 1, 1 };

     x = 0;
     y = 0;
     w = 1;
     h = 1;
   };
 };
};

init.sqf

onPreloadFinished "0 cutRsc ["MY_superDialog", "PLAIN", 1, false];";

Share this post


Link to post
Share on other sites

Kylania, I tried that already and it doesn't show up. I painstakingly went through that process like 5 times and it didn't work. And it wasn't made for Arma 3.

---------- Post added at 03:29 ---------- Previous post was at 02:15 ----------

I figured out my issue. For some reason it didn't like the fact that I was using GUI GRID coordinates, and doesn't bug out when I use safezone coordinates instead. Well, thank you for your time, everyone.

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  

×