Jump to content

Recommended Posts

Soo.... I'm having 2 issues, one of them is that I cannot seem to import my saved GUI data from my dialogs.hpp (to edit ingame). The second issue is that I cannot load the dialog ingame using a script. These are the scripts:

_handle=createdialog "gunShop_dialog";

To execute the Dialog

class gunShop_dialog
{
    idd=1;
    movingenable=false;

    class controls {

      ////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT START (by [HP] James, v1.063, #Vynuxo)
////////////////////////////////////////////////////////

class left_frame: RscFrame
{
	idc = 1800;
	x = 0.29375 * safezoneW + safezoneX;
	y = 0.225 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.55 * safezoneH;
	colorBackground[] = {-0,-0,-0,-0};
	colorActive[] = {-0,-0,-0,-0};
};
class middle_frame: RscFrame
{
	idc = 1801;
	x = 0.479375 * safezoneW + safezoneX;
	y = 0.225 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.55 * safezoneH;
	colorBackground[] = {-0,-0,-0,-0};
	colorActive[] = {-0,-0,-0,-0};
};
class right_frame: RscFrame
{
	idc = 1803;
	x = 0.665 * safezoneW + safezoneX;
	y = 0.225 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.55 * safezoneH;
	colorBackground[] = {-0,-0,-0,-0};
	colorActive[] = {-0,-0,-0,-0};
};
class weapon_image: RscPicture
{
	idc = 1200;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.555 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.165 * safezoneH;
};
class weapon_information: RscStructuredText
{
	idc = 1100;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.599 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.121 * safezoneH;
};
class weapon_information_text: RscText
{
	idc = 1000;
	text = "Weapon information"; //--- ToDo: Localize;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.555 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.044 * safezoneH;
};
class left_top_frame: RscFrame
{
	idc = 1804;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.225 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.022 * safezoneH;
};
class right_top_frame: RscFrame
{
	idc = 1805;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.225 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.066 * safezoneH;
};
class bottom_left_frame: RscFrame
{
	idc = 1806;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.72 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.055 * safezoneH;
};
class bottom_right_frame: RscFrame
{
	idc = 1807;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.72 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.055 * safezoneH;
};
class small_weapon_pic1: RscPicture
{
	idc = 1201;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.291 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic2: RscPicture
{
	idc = 1202;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.335 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic3: RscPicture
{
	idc = 1203;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.379 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic4: RscPicture
{
	idc = 1204;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.423 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic5: RscPicture
{
	idc = 1205;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.467 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic6: RscPicture
{
	idc = 1206;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.335 * safezoneW + safezoneX;
	y = 0.511 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class small_weapon_pic_bar6: RscFrame
{
	idc = 1809;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.544 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class small_weapon_pic_bar5: RscFrame
{
	idc = 1808;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.5 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class small_weapon_pic_bar4: RscFrame
{
	idc = 1810;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.456 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class small_weapon_pic_bar3: RscFrame
{
	idc = 1811;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.412 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class small_weapon_pic_bar2: RscFrame
{
	idc = 1812;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.368 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class small_weapon_pic_bar1: RscFrame
{
	idc = 1813;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.324 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class sell_weapon_button: RscButton
{
	idc = 1600;
	text = "Sell Weapon"; //--- ToDo: Localize;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.467 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.055 * safezoneH;
};
class sell_under_frame: RscFrame
{
	idc = 1814;
	x = 22 * GUI_GRID_W + GUI_GRID_X;
	y = 13.5 * GUI_GRID_H + GUI_GRID_Y;
	w = 14 * GUI_GRID_W;
	h = 2 * GUI_GRID_H;
};
class sell_weapon_small_pic1: RscPicture
{
	idc = 1207;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.291 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_bar_pic1: RscFrame
{
	idc = 1802;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.324 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class sell_weapon_small_pic2: RscPicture
{
	idc = 1208;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.335 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_bar_pic2: RscFrame
{
	idc = 1815;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.368 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class sell_weapon_small_pic3: RscPicture
{
	idc = 1209;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.379 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_bar_pic3: RscFrame
{
	idc = 1816;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.412 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class sell_weapon_small_pic4: RscPicture
{
	idc = 1210;
	text = "#(argb,8,8,3)color(1,1,1,1)";
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.423 * safezoneH + safezoneY;
	w = 0.04125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_bar_pic4: RscFrame
{
	idc = 1817;
	x = 0.520625 * safezoneW + safezoneX;
	y = 0.456 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.011 * safezoneH;
};
class buy_weapon_text1: RscText
{
	idc = 1001;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.291 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class buy_weapon_button: RscButton
{
	idc = 1601;
	text = "Buy Weapon"; //--- ToDo: Localize;
	x = 0.335 * safezoneW + safezoneX;
	y = 0.247 * safezoneH + safezoneY;
	w = 0.144375 * safezoneW;
	h = 0.044 * safezoneH;
};
class buy_weapon_text2: RscText
{
	idc = 1002;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.335 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class buy_weapon_text3: RscText
{
	idc = 1003;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.379 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class buy_weapon_text4: RscText
{
	idc = 1004;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.423 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class buy_weapon_text5: RscText
{
	idc = 1005;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.467 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class buy_weapon_text6: RscText
{
	idc = 1006;
	x = 0.37625 * safezoneW + safezoneX;
	y = 0.511 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_tex1: RscText
{
	idc = 1007;
	x = 0.561875 * safezoneW + safezoneX;
	y = 0.291 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_tex2: RscText
{
	idc = 1008;
	x = 0.561875 * safezoneW + safezoneX;
	y = 0.335 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_tex3: RscText
{
	idc = 1009;
	x = 0.561875 * safezoneW + safezoneX;
	y = 0.379 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class sell_weapon_tex4: RscText
{
	idc = 1010;
	x = 0.561875 * safezoneW + safezoneX;
	y = 0.423 * safezoneH + safezoneY;
	w = 0.103125 * safezoneW;
	h = 0.033 * safezoneH;
};
class RscControlsGroup_2300: RscControlsGroup
{
	idc = 2300;
	x = 17 * GUI_GRID_W + GUI_GRID_X;
	y = 3 * GUI_GRID_H + GUI_GRID_Y;
	w = 1 * GUI_GRID_W;
	h = 12.5 * GUI_GRID_H;
	class controls
	{
	};
};
class RscControlsGroup_2301: RscControlsGroup
{
	idc = 2301;
	x = 35 * GUI_GRID_W + GUI_GRID_X;
	y = 3 * GUI_GRID_H + GUI_GRID_Y;
	w = 1 * GUI_GRID_W;
	h = 8 * GUI_GRID_H;
	class controls
	{
	};
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
////////////////////////////////////////////////////////


    };

};

Dialogs.hpp

// Control types
#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_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_GROUP_BOX       96
#define ST_GROUP_BOX2      112
#define ST_ROUNDED_CORNER  ST_GROUP_BOX + ST_CENTER
#define ST_ROUNDED_CORNER2 ST_GROUP_BOX2 + ST_CENTER

#define ST_TYPE           0xF0
#define ST_SINGLE         0x00
#define ST_MULTI          0x10
#define ST_TITLE_BAR      0x20
#define ST_PICTURE        0x30
#define ST_FRAME          0x40
#define ST_BACKGROUND     0x50
#define ST_GROUP_BOX      0x60
#define ST_GROUP_BOX2     0x70
#define ST_HUD_BACKGROUND 0x80
#define ST_TILE_PICTURE   0x90
#define ST_WITH_RECT      0xA0
#define ST_LINE           0xB0

#define ST_SHADOW         0x100
#define ST_NO_RECT        0x200
#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

// progress bar
#define ST_VERTICAL       0x01
#define ST_HORIZONTAL     0

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

// Tree styles
#define TR_SHOWROOT       1
#define TR_AUTOCOLLAPSE   2

// MessageBox styles
#define MB_BUTTON_OK      1
#define MB_BUTTON_CANCEL  2
#define MB_BUTTON_USER    4


////////////////
//Base Classes//
////////////////

class RscText
{
    access = 0;
    idc = -1;
    type = CT_STATIC;
    style = ST_MULTI;
    linespacing = 1;
    colorBackground[] = {0,0,0,0};
    colorText[] = {1,1,1,1};
    text = "";
    shadow = 0;
    font = "PuristaLight";
    SizeEx = 0.02300;
    fixedWidth = 0;
    x = 0;
    y = 0;
    h = 0;
    w = 0;

};

class RscPicture
{
    access = 0;
    idc = -1;
    type = CT_STATIC;
    style = ST_PICTURE;
    colorBackground[] = {0,0,0,0};
    colorText[] = {1,1,1,1};
    font = "PuristaLight";
    sizeEx = 0;
    lineSpacing = 0;
    text = "";
    fixedWidth = 0;
    shadow = 0;
    x = 0;
    y = 0;
    w = 0.2;
    h = 0.15;
};

class RscButton
{

   access = 0;
    type = CT_BUTTON;
    text = "";
    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};
    soundEnter[] = {"\ca\ui\data\sound\onover",0.09,1};
    soundPush[] = {"\ca\ui\data\sound\new1",0,0};
    soundClick[] = {"\ca\ui\data\sound\onclick",0.07,1};
    soundEscape[] = {"\ca\ui\data\sound\onescape",0.09,1};
    style = 2;
    x = 0;
    y = 0;
    w = 0.055589;
    h = 0.039216;
    shadow = 2;
    font = "PuristaLight";
    sizeEx = 0.03921;
    offsetX = 0.003;
    offsetY = 0.003;
    offsetPressedX = 0.002;
    offsetPressedY = 0.002;
    borderSize = 0;
};

class RscFrame
{
    type = CT_STATIC;
    idc = -1;
    style = ST_FRAME;
    shadow = 2;
    colorBackground[] = {1,1,1,1};
    colorText[] = {1,1,1,0.9};
    font = "PuristaLight";
    sizeEx = 0.03;
    text = "";
};
class Box
{
    type = CT_STATIC;
    idc = -1;
    style = ST_CENTER;
    shadow = 2;
    colorBackground[] = { 0.2,0.9,0.5, 0.9};
    colorText[] = {1,1,1,0.9};
    font = "PuristaLight";
    sizeEx = 0.03;
    text = "";
};

Defines.hpp

 

 

Anyone got a clue as to what i'm doing wrong? :)

 

Also, since i've already made a post, how can I make a scrollbar for my GUI? Thanks for your help!

Share this post


Link to post
Share on other sites

I'm about to head out for work, so I can't test yours right now. I'll take a look when I get home but until then you could check out the tutorial I made.

 https://forums.bistudio.com/topic/189494-gui-tutorial-and-simple-vehicle-selector-release/

You'll see that I do it a different way. In the dialog.hpp, I define the backgrounds, controls, and objects by their names first and then the have the controls with size, type etc after.

Check out the tut and send me a pm with any questions you have, and I'll read them later. 

Share this post


Link to post
Share on other sites

I'm about to head out for work, so I can't test yours right now. I'll take a look when I get home but until then you could check out the tutorial I made.

 https://forums.bistudio.com/topic/189494-gui-tutorial-and-simple-vehicle-selector-release/

You'll see that I do it a different way. In the dialog.hpp, I define the backgrounds, controls, and objects by their names first and then the have the controls with size, type etc after.

Check out the tut and send me a pm with any questions you have, and I'll read them later. 

Thanks a lot for the video, it has all I need, I will check it out fully tomorrow (since my brain is overheated and tired atm). :D

Share this post


Link to post
Share on other sites

You are missing RscStructuredText and RscControlsGroup, in the defines.

class RscStructuredText {
  idc = -1; 
  type = CT_STRUCTURED_TEXT;  
  style = ST_LEFT;            
  colorBackground[] = { 1, 1, 1, 1 }; 
  x = 0.1; 
  y = 0.1; 
  w = 0.3; 
  h = 0.1; 
  size = 0.018;
  text = "";
  class Attributes {
    font = "TahomaB";
    color = "#000000";
    align = "center";
    valign = "middle";
    shadow = false;
    shadowColor = "#ff0000";
    size = "1";
  };
};
class RscControlsGroup
{
	deletable = 0;
	fade = 0;
	class VScrollbar
	{
		color[] =
		{
			1,
			1,
			1,
			1
		};
		width = 0.021;
		autoScrollEnabled = 1;
	};
	class HScrollbar
	{
		color[] =
		{
			1,
			1,
			1,
			1
		};
		height = 0.028;
	};
	class Controls
	{
	};
	type = 15;
	idc = -1;
	x = 0;
	y = 0;
	w = 1;
	h = 1;
	shadow = 0;
	style = 16;
};

Share this post


Link to post
Share on other sites

I havent done this in a fair few months but it looks like you also havent included your defines.hpp in the dialog.hpp.

If anyone knows more then correct me but I would have this...

ie:

#include <defines.hpp>

class gunShop_dialog
{ yada yada

Share this post


Link to post
Share on other sites

I don't seem to be able to change the color of the rsc_frames :(. I'm trying to make the frames have the background color of black but it isn't working, i'm using {0.0.0.1}

Share this post


Link to post
Share on other sites

I don't seem to be able to change the color of the rsc_frames :(. I'm trying to make the frames have the background color of black but it isn't working, i'm using {0.0.0.1}

 

I had a similar problem, but with using IGUIBack it worked for me.

class IGUIBack
{
	type = 0;
	idc = 124;
	style = 128;
	text = "";
	colorText[] =
	{
		0,
		0,
		0,
		0
	};
	font = "RobotoCondensed";
	sizeEx = 0;
	shadow = 0;
	x = 0.1;
	y = 0.1;
	w = 0.1;
	h = 0.1;
	colorbackground[] =
	{
		"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])",
		"(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])",
		"(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])",
		"(profilenamespace getvariable ['IGUI_BCG_RGB_A',0.8])"
	};
};

Its just a work around. If it works it works ;).

Share this post


Link to post
Share on other sites

Where do i put this? :/ And how do i connect it to my all of my frames?

 

You would put this in the defines.hpp , and use IGUIBack as parent. 

Share this post


Link to post
Share on other sites

Thank you! I tested this as well and something weird happend, some of my frames became black and some didn't, I used "IGUIBack" as a parent on all of them but it still, flipped out. 

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

×