riten 153 Posted March 15, 2016 I was using hint to display informations, but now I'd like to put all of those variables in my dialog. hint parseText format[" <t size='4' align='left'><img image='pilot\img\pilot.jpg'/></t> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Experience points:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %1</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Pilot:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %3</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Health:</t><t size='1' align='right' font='puristaMedium'> %7</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Aircraft:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %4</t><br/> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Rank:</t><t size='1.25' align='right' font='puristaMedium' color='#FFFF00'> %2</t> <br/> <t size='1' align='center' font='puristaMedium' color='#ffffff'>(Points for next rank: %6)</t> <br/> <t size='1.35' align='center'>%5</t> ",pilotpkt,ranga,name player,pojazd,stars,rankup,zdrowie]; I was trying (pilotranking.sqf file): ctrlSetText [1100,format [" <t size='4' align='left'><img image='pilot\img\pilot.jpg'/></t> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Experience points:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %1</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Pilot:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %3</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Health:</t><t size='1' align='right' font='puristaMedium'> %7</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Aircraft:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %4</t><br/> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Rank:</t><t size='1.25' align='right' font='puristaMedium' color='#FFFF00'> %2</t> <br/> <t size='1' align='center' font='puristaMedium' color='#ffffff'>(Points for next rank: %6)</t> <br/> <t size='1.35' align='center'>%5</t> ",pilotpkt,ranga,name player,pojazd,stars,rankup,zdrowie]]; but it simply doesn't works correct, it's not possible to line break. I've also tried with "ctrlSetStructuredText", but I have no idea how to check my control. Any ideas how I could display variables in my dialog? Defines & Dialog defines class RscStructuredText { access = 0; idc = -1; type = CT_STATIC; style = ST_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.1; fixedWidth = 0; x = 0; y = 0; h = 0; w = 0; }; dialog: class DCAM_STRUCTURED: RscStructuredText { access = 0; idc = 1100; x = 0.650937 * safezoneW + safezoneX; y = 0.206 * safezoneH + safezoneY; w = 0.091875 * safezoneW; h = 0.168 * safezoneH; onLoad = "execVM 'pilot\pilotranking.sqf';"; }; Share this post Link to post Share on other sites
HallyG 239 Posted March 15, 2016 change ...ctrlSetText [1100, format ["FORMATTED TEXT HERE"]]; to ...ctrlSetStructuredText [1100, parseText format ["FORMATTED TEXT HERE"]]; Share this post Link to post Share on other sites
riten 153 Posted March 15, 2016 @up Tried this, doesn't works (it says need "control #ctrlSetStructuredText"). I have found some threads on bi forum but noone works. I have no idea how to find my dialog control name, can't find anything helpful on wiki. Share this post Link to post Share on other sites
HallyG 239 Posted March 15, 2016 Well, what I provided will allow the formatted text to be displayed, provided there is a display.To display it as a dialog you first need to define your dialog. Have you defined your dialog, if so where? Share this post Link to post Share on other sites
riten 153 Posted March 15, 2016 To display it as a dialog you first need to define your dialog. Have you defined your dialog, if so where? I don't know how, could you tell me more what exactly should I do to display ctrlSetStructuredText? there is my whole definies file: // 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_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {0.3,0.6,0.4,.8}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.02100; fixedWidth = 0; x = 0; y = 0; h = 0; w = 0; }; class RscStructuredText { access = 0; idc = -1; type = CT_STATIC; style = ST_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.04; 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; idc = -1; type = CT_BUTTON; text = ""; colorText[] = {1,1,1,1}; colorDisabled[] = {1,0.502,0,0.9}; colorBackground[] = {1,0.502,0,0.9}; colorBackgroundDisabled[] = {1,0.502,0,0.9}; colorBackgroundActive[] = {1,0.502,0,0.9}; colorShadow[] = {1,1,1,1}; colorFocused[] = {1,1,1,1}; colorBorder[] = {1,1,1,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 = ST_CENTER; x = 0; y = 0; w = 0.055589; h = 0.039216; shadow = 0; font = "PuristaLight"; sizeEx = 0.04; offsetX = 0; offsetY = 0; offsetPressedX = 0; offsetPressedY = 0; borderSize = 0; }; class RscFrame { type = CT_STATIC; idc = -1; style = ST_FRAME; shadow = 2; colorBackground[] = {0,0,0,1}; colorText[] = {1,1,1,0.9}; font = "PuristaLight"; sizeEx = 0.04; text = ""; }; class BOX { type = CT_STATIC; idc = -1; style = ST_CENTER; shadow = 2; colorText[] = {1,1,1,1}; font = "PuristaLight"; sizeEx = 0.02; colorBackground[] = {0,0,0,0.7}; text = ""; }; class RscListBox { idc = -1; access = 0; type = 5; style = 0 + 0x10; font = "PuristaLight"; sizeEx = 0.03; rowHeight = 0.05; colorText[] = {1,1,1,1}; colorScrollbar[] = {1,1,1,1}; colorSelect[] = {0,0,0,1}; colorSelect2[] = {1,1,1,1}; colorSelectBackground[] = {1,1,1,1}; colorSelectBackground2[] = {1,1,1,1}; colorBackground[] = {0,0,0,1}; colorDisabled[] = {}; soundSelect[] = {"",0.1,1}; period = 0; maxHistoryDelay = 1.0; autoScrollSpeed = -1; autoScrollDelay = 5; autoScrollRewind = 0; shadow = 0; class ListScrollBar //ListScrollBar is class name required for Arma 3 { color[] = {1,1,1,0.6}; colorActive[] = {1,1,1,1}; colorDisabled[] = {1,1,1,0.3}; thumb = "#(argb,8,8,3)color(1,1,1,1)"; arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; border = "#(argb,8,8,3)color(1,1,1,1)"; shadow = 0; }; }; Share this post Link to post Share on other sites
HallyG 239 Posted March 15, 2016 Where is your dialog defined? Share this post Link to post Share on other sites
riten 153 Posted March 15, 2016 You mean this? Desription.ext #include "dialog\defines.hpp" #include "dialog\dialogs.hpp" dialog.hpp class DCAM_DIALOG { idd = -1; movingenable = 1; onLoad = "ExecVM 'dialog\listboxes.sqf';"; class Controls { class DCAM_BOX: BOX { idc = -1; x = 0.244062 * safezoneW + safezoneX; y = 0.164 * safezoneH + safezoneY; w = 0.511875 * safezoneW; h = 0.672 * safezoneH; }; class DCAM_FRAME: RscFrame { idc = -1; text = "Dynamic Air Combat Missions - menu"; //--- ToDo: Localize; x = 0.244062 * safezoneW + safezoneX; y = 0.164 * safezoneH + safezoneY; w = 0.511875 * safezoneW; h = 0.672 * safezoneH; }; class DCAM_BUTTONNO: RscButton { action = "closeDialog 0;"; idc = -1; text = "CLOSE"; //--- ToDo: Localize; x = 0.703437 * safezoneW + safezoneX; y = 0.78 * safezoneH + safezoneY; w = 0.0398808 * safezoneW; h = 0.040476 * safezoneH; }; class DCAM_LISTBOX: RscListbox { idc = 1500; x = 0.257187 * safezoneW + safezoneX; y = 0.234 * safezoneH + safezoneY; w = 0.13125 * safezoneW; h = 0.238 * safezoneH; onLBSelChanged = systemChat str [_this select 0, (_this select 0) lbText (_this select 1), (_this select 0) lbData (_this select 1)]; onLBDblClick = this = [[lbText [1500,(lbCurSel 1500)]]] execVM 'pilot\Aircrafts_class.sqf'; }; class DCAM_VAR1: RscStructuredText { access = 0; idc = 1100; x = 0.572187 * safezoneW + safezoneX; y = 0.206 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,1] ExecVM 'dialog\text.sqf';"; }; class DCAM_VAR2: RscStructuredText { idc = 1101; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,2] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.262 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_VAR3: RscStructuredText { idc = 1102; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,3] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.318 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_VAR4: RscStructuredText { idc = 1103; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,4] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.374 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_VAR5: RscStructuredText { idc = 1104; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,5] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.43 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_VAR6: RscStructuredText { idc = 1105; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,6] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.486 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_VAR7: RscStructuredText { idc = 1106; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,7] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.542 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; class DCAM_SELECT_JET_BTN: RscButton { idc = -1; text = "select"; //--- ToDo: Localize; x = 0.335938 * safezoneW + safezoneX; y = 0.486 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; action = "this = [[lbText [1500,(lbCurSel 1500)]]] execVM 'pilot\Aircrafts_class.sqf';" }; class DCAM_LISTBOX_MISSIONS: RscListbox { idc = 1002; x = 0.257187 * safezoneW + safezoneX; y = 0.528 * safezoneH + safezoneY; w = 0.13125 * safezoneW; h = 0.126 * safezoneH; onLBSelChanged = "systemChat str [_this select 0, (_this select 0) lbText (_this select 1), (_this select 0) lbData (_this select 1)]"; onLBDblClick = "this = [[lbText [1002,(lbCurSel 1002)]]] execVM 'pilot\MissionType.sqf'"; }; class DCAM_SELECT_MISSION_BTN: RscButton { idc = -1; text = "select"; //--- ToDo: Localize; x = 0.335938 * safezoneW + safezoneX; y = 0.668 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; action = "this = [[lbText [1002,(lbCurSel 1002)]]] execVM 'pilot\MissionType.sqf';"; }; }; }; and to create dialog (for now) i'm using this: player addAction ["<t color='#FF0000'>Dialog</t>","createDialog 'DCAM_DIALOG'"]; sorry if it's not what you're asking for... Share this post Link to post Share on other sites
beno_83au 1362 Posted March 15, 2016 Dialogs can be pretty confusing. This is where i started, and then experimented and expanded from there: https://forums.bistudio.com/topic/136734-dialog-tutorial-for-noobs-by-a-noob/ Share this post Link to post Share on other sites
riten 153 Posted March 15, 2016 @beno_83au I've seen this (that is how I started). Just got problem understanding this command: https://community.bistudio.com/wiki/ctrlSetStructuredText, I have no idea how to get my control (it's not well explained on wiki in my opinion or I'm too noob for this). Share this post Link to post Share on other sites
beno_83au 1362 Posted March 15, 2016 Lol, ok yeah. That one took me a while, and I just end up referencing something I've already done. So, maybe someone will have a better way to explain/do it, but for now; Change your dialog.hpp to this: class DCAM_DIALOG { idd = -1; movingenable = 1; onLoad = "ExecVM 'dialog\listboxes.sqf'; uiNamespace setVariable ['ritens_dialog', _this select 0]"; //Add the setVariable command, and change ritens_dialog to whatever you want //Also, I assume you can run two lines in onLoad. I've never done it, but I would think it'd work Then, to change what you need to change, use: ((uiNamespace getVariable "ritens_dialog") displayCtrl _idcNumber) ctrlSetStructuredText _newText; _idcNumber is the number that's assigned to the part of the dialog that you want to change. So below, the idc is 1106. class DCAM_VAR7: RscStructuredText { idc = 1106; onLoad = "execVM 'pilot\pilotranking.sqf'; this = [_this,7] ExecVM 'dialog\text.sqf';"; x = 0.572187 * safezoneW + safezoneX; y = 0.542 * safezoneH + safezoneY; w = 0.170625 * safezoneW; h = 0.056 * safezoneH; }; Hope that helps, it took me ages to figure out dialogs, with plenty of trial and error, and I'm still noobed pretty hard by them. 1 Share this post Link to post Share on other sites
riten 153 Posted March 16, 2016 @beno_83au I've seen this method even before I posted this thread, but somehow couldn't make it works. I'll tell you what I've done now. My dialog.hpp class DCAM_DIALOG { idd = -1; movingenable = 1; onLoad = "ExecVM 'dialog\listboxes.sqf'; uiNamespace setVariable ['ritens_dialog', _this select 0]"; class Controls { class DCAM_BOX: BOX { idc = -1; x = 0.244062 * safezoneW + safezoneX; y = 0.164 * safezoneH + safezoneY; w = 0.511875 * safezoneW; h = 0.672 * safezoneH; }; class DCAM_FRAME: RscFrame { idc = -1; text = "Dynamic Air Combat Missions - menu"; //--- ToDo: Localize; x = 0.244062 * safezoneW + safezoneX; y = 0.164 * safezoneH + safezoneY; w = 0.511875 * safezoneW; h = 0.672 * safezoneH; }; class DCAM_BUTTONNO: RscButton { action = "closeDialog 0;"; idc = -1; text = "CLOSE"; //--- ToDo: Localize; x = 0.703437 * safezoneW + safezoneX; y = 0.78 * safezoneH + safezoneY; w = 0.0398808 * safezoneW; h = 0.040476 * safezoneH; }; class DCAM_LISTBOX: RscListbox { idc = 1500; x = 0.257187 * safezoneW + safezoneX; y = 0.234 * safezoneH + safezoneY; w = 0.13125 * safezoneW; h = 0.238 * safezoneH; onLBSelChanged = systemChat str [_this select 0, (_this select 0) lbText (_this select 1), (_this select 0) lbData (_this select 1)]; onLBDblClick = this = [[lbText [1500,(lbCurSel 1500)]]] execVM 'pilot\Aircrafts_class.sqf'; }; class DCAM_VARS_DISP: RscStructuredText { access = 0; idc = 1100; x = 0.427813 * safezoneW + safezoneX; y = 0.206 * safezoneH + safezoneY; w = 0.308437 * safezoneW; h = 0.476 * safezoneH; onLoad = "execVM 'pilot\pilotranking.sqf';"; text = "selectselectselectselectselectselectselectselectselectselectselectselect"; }; class DCAM_SELECT_JET_BTN: RscButton { idc = -1; text = "select"; //--- ToDo: Localize; x = 0.335938 * safezoneW + safezoneX; y = 0.486 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; action = "this = [[lbText [1500,(lbCurSel 1500)]]] execVM 'pilot\Aircrafts_class.sqf';" }; class DCAM_LISTBOX_MISSIONS: RscListbox { idc = 1002; x = 0.257187 * safezoneW + safezoneX; y = 0.528 * safezoneH + safezoneY; w = 0.13125 * safezoneW; h = 0.126 * safezoneH; onLBSelChanged = "systemChat str [_this select 0, (_this select 0) lbText (_this select 1), (_this select 0) lbData (_this select 1)]"; onLBDblClick = "this = [[lbText [1002,(lbCurSel 1002)]]] execVM 'pilot\MissionType.sqf'"; }; class DCAM_SELECT_MISSION_BTN: RscButton { idc = -1; text = "select"; //--- ToDo: Localize; x = 0.335938 * safezoneW + safezoneX; y = 0.668 * safezoneH + safezoneY; w = 0.0525 * safezoneW; h = 0.028 * safezoneH; action = "this = [[lbText [1002,(lbCurSel 1002)]]] execVM 'pilot\MissionType.sqf';"; }; }; }; my pilotranking.sqf file: if (pilotpkt<0) then {pilotpkt=0;}; // Classnamy samolotow if (vehicle player isKindOf "B_PLANE_CAS_01_F") then {pojazd=format ["A-164 Wipeout (CAS)",_this select 0];}; if (vehicle player isKindOf "RU_PAKFA_F") then {pojazd=format ["PAK-FA",_this select 0];}; if (vehicle player isKindOf "Peral_A10C") then {pojazd=format ["A-10C Thunderbolt II",_this select 0];}; if (vehicle player isKindOf "I_Plane_Fighter_03_AA_F") then {pojazd=format ["A-143 Buzzard (AA)",_this select 0];}; if (vehicle player isKindOf "I_Plane_Fighter_03_CAS_F") then {pojazd=format ["A-143 Buzzard (CAS)",_this select 0];}; if (vehicle player isKindOf "Cha_AV8B_AGM") then {pojazd=format ["AV-8B Harrier II",_this select 0];}; if (vehicle player isKindOf "FIR_F14D_Wardog") then {pojazd=format ["F14D Wardog",_this select 0];}; if (vehicle player isKindOf "FIR_F15C") then {pojazd=format ["F15C Eagle",_this select 0];}; if (vehicle player isKindOf "FIR_F16C") then {pojazd=format ["F16C Fighting Falcon",_this select 0];}; if (vehicle player isKindOf "JS_JC_FA18E") then {pojazd=format ["F/A 18E Super Hornet",_this select 0];}; if (vehicle player isKindOf "JS_S_FA18X") then {pojazd=format ["F/A 18X Black Wasp",_this select 0];}; if (vehicle player isKindOf "F_35C_S") then {pojazd=format ["F35C Stealth Thunder",_this select 0];}; if (vehicle player isKindOf "TCP_Su22") then {pojazd=format ["Su-22",_this select 0];}; if (vehicle player isKindOf "sab_SU34_O_AGM" ) then {pojazd=format ["Su-32",_this select 0];}; if (vehicle player isKindOf "sab_SU34_O_AGM_CRU") then {pojazd=format ["Su-34",_this select 0];}; if (vehicle player isKindOf "JS_JC_SU35") then {pojazd=format ["Su-35",_this select 0];}; if (vehicle player isKindOf "O_Plane_CAS_02_F") then {pojazd=format ["To-199",_this select 0];}; if (vehicle player isKindOf "EAWS_EF2000_ITA_CAS") then {pojazd=format ["EF-2000",_this select 0];}; if (!(vehicle player isKindOf "AIR")) then {pojazd=format ["You are not in plane",_this select 0];}; // rangi if (pilotpkt<15) then { rankup=15-pilotpkt; ranga=format ["PRIVATE",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=15) then { rankup=25-pilotpkt; ranga=format ["CORPORAL",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=25) then { rankup=35-pilotpkt; ranga=format ["SERGEANT",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=35) then { rankup=45-pilotpkt; ranga=format ["LIEUTENANT",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=45) then { rankup=65-pilotpkt; ranga=format ["CAPTAIN",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=65) then { rankup=125-pilotpkt; ranga=format ["MAJOR",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; if (pilotpkt>=125) then { rankup=format ["You're elite.",_this select 0]; ranga=format ["VETERAN",_this select 0]; stars=format ["<img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/><img image='pilot\img\star.jpg'/>",_this select 0];}; // zdrowie if ((damage player)==0) then {zdrowie=format ["<t color='#FFFF00'>Good condition</t>",_this select 0];}; if ((damage player)> 0 and (damage player)<= 0.5) then {zdrowie=format ["<t color='#FFBF00'>Small wounds</t>",_this select 0];}; if ((damage player)>= 0.5 and (damage player)<= 0.8) then {zdrowie=format ["<t color='#58FA58'>You need medic!</t>",_this select 0];}; if ((damage player)>= 0.8) then {zdrowie=format ["<t color='#FF0000'>Heavily injured</t>",_this select 0];}; // Hint ((uiNamespace getVariable "ritens_dialog") displayCtrl 1100) ctrlSetStructuredText parseText format[" <t size='4' align='left'><img image='pilot\img\pilot.jpg'/></t> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Experience points:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %1</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Pilot:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %3</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Health:</t><t size='1' align='right' font='puristaMedium'> %7</t><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Aircraft:</t> <t size='1' align='right' font='puristaMedium' color='#FFFF00'> %4</t><br/> <br/><br/> <t size='1.25' align='left' font='puristaMedium' color='#ffffff'>Rank:</t><t size='1.25' align='right' font='puristaMedium' color='#FFFF00'> %2</t> <br/> <t size='1' align='center' font='puristaMedium' color='#ffffff'>(Points for next rank: %6)</t> <br/> <t size='1.35' align='center'>%5</t> ",pilotpkt,ranga,name player,pojazd,stars,rankup,zdrowie]; my defines.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_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {0.3,0.6,0.4,.8}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.02100; fixedWidth = 0; x = 0; y = 0; h = 0; w = 0; }; class RscStructuredText { access = 0; idc = -1; type = CT_STATIC; style = ST_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.04; 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; idc = -1; type = CT_BUTTON; text = ""; colorText[] = {1,1,1,1}; colorDisabled[] = {1,0.502,0,0.9}; colorBackground[] = {1,0.502,0,0.9}; colorBackgroundDisabled[] = {1,0.502,0,0.9}; colorBackgroundActive[] = {1,0.502,0,0.9}; colorShadow[] = {1,1,1,1}; colorFocused[] = {1,1,1,1}; colorBorder[] = {1,1,1,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 = ST_CENTER; x = 0; y = 0; w = 0.055589; h = 0.039216; shadow = 0; font = "PuristaLight"; sizeEx = 0.04; offsetX = 0; offsetY = 0; offsetPressedX = 0; offsetPressedY = 0; borderSize = 0; }; class RscFrame { type = CT_STATIC; idc = -1; style = ST_FRAME; shadow = 2; colorBackground[] = {0,0,0,1}; colorText[] = {1,1,1,0.9}; font = "PuristaLight"; sizeEx = 0.04; text = ""; }; class BOX { type = CT_STATIC; idc = -1; style = ST_CENTER; shadow = 2; colorText[] = {1,1,1,1}; font = "PuristaLight"; sizeEx = 0.02; colorBackground[] = {0,0,0,0.7}; text = ""; }; class RscListBox { idc = -1; access = 0; type = 5; style = 0 + 0x10; font = "PuristaLight"; sizeEx = 0.03; rowHeight = 0.05; colorText[] = {1,1,1,1}; colorScrollbar[] = {1,1,1,1}; colorSelect[] = {0,0,0,1}; colorSelect2[] = {1,1,1,1}; colorSelectBackground[] = {1,1,1,1}; colorSelectBackground2[] = {1,1,1,1}; colorBackground[] = {0,0,0,1}; colorDisabled[] = {}; soundSelect[] = {"",0.1,1}; period = 0; maxHistoryDelay = 1.0; autoScrollSpeed = -1; autoScrollDelay = 5; autoScrollRewind = 0; shadow = 0; class ListScrollBar //ListScrollBar is class name required for Arma 3 { color[] = {1,1,1,0.6}; colorActive[] = {1,1,1,1}; colorDisabled[] = {1,1,1,0.3}; thumb = "#(argb,8,8,3)color(1,1,1,1)"; arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; border = "#(argb,8,8,3)color(1,1,1,1)"; shadow = 0; }; }; and I just get empty box in dialog. Share this post Link to post Share on other sites
beno_83au 1362 Posted March 16, 2016 Try defining your structured text before you run ctrlSetStructuredText. _text = parseText format[" //structured text ",var1,var2,......]; ((uiNamespace getVariable "ritens_dialog") displayCtrl 1100) ctrlSetStructuredText _text; But start small and basic for your structured text and make sure you're getting it right. When I got my stuff worked out it took a (embarrassingly) long time to understand how to change the text/picture on a dialog. Also, have you seen the switch command, to help reduce all those if-thens? Sorry if this doesn't help fix it. I'd be in struggle street if I was this far into building it and couldn't get it going. Share this post Link to post Share on other sites
riten 153 Posted March 16, 2016 First thing I did was define it like u did, failed. Anyway thanks I'll try to find solution. Share this post Link to post Share on other sites
Deadfast 43 Posted March 16, 2016 Wherever you copied the base classes from (in post #5) it is wrong. Try changing... class RscStructuredText { access = 0; idc = -1; type = CT_STATIC; style = ST_CENTER; linespacing = 1; colorBackground[] = {0,0,0,0}; colorText[] = {1,1,1,1}; text = ""; shadow = 2; font = "PuristaLight"; SizeEx = 0.04; fixedWidth = 0; x = 0; y = 0; h = 0; w = 0; }; ...to... 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"; }; }; 2 Share this post Link to post Share on other sites
riten 153 Posted March 16, 2016 Now it works perfect! Thank you very much especially beno_83au & deadfast! Share this post Link to post Share on other sites
MarkCode82 21 Posted March 16, 2016 Hm this might have solved my HUD problem. Share this post Link to post Share on other sites
beno_83au 1362 Posted March 17, 2016 Looks good mate, glad it worked out for you. Share this post Link to post Share on other sites