chuiby 1 Posted July 17, 2012 Is there any way to design and display user interface only using a .sqf ? A simple yes or no is required. If yes, how can I create one? Thanks Share this post Link to post Share on other sites
riouken 15 Posted July 17, 2012 It is not as simple as yes or no. Here is how they are created: http://community.bistudio.com/wiki/Dialog_Control Share this post Link to post Share on other sites
chuiby 1 Posted July 17, 2012 It is not as simple as yes or no.Here is how they are created: http://community.bistudio.com/wiki/Dialog_Control Okay thanks, I'll look into that. Perhaps, do you know if a Dialog can be contained in a single file or does it have to be in multiple files? Share this post Link to post Share on other sites
riouken 15 Posted July 17, 2012 Yes if it is a really simple dialog then it can be all defined in the description.ext of the mission or in the config.cpp of an addon. Dialog's are some of the more difficult things to code in Arma. Its not a simple yes or no, firstly dialog's don't go in .sqf files they go in .hpp files, or included in the file types as I stated above. Second unless it is an extremely simple dialog it is going to get messing fast putting it all into the description.ext or config.cpp and is generally considered bad practice. The preferred way is to separate the dialog from its base classes and put them in their own .hpp files and then using #preprocssor commands include them in the description.ext or config.cpp. With dialog's it is very important to use inheritance to help reduce the amount of code you have to write or define for each "dialog". That's why its recommended to separate the base definitions and setups and then just define your dialog and any small changes that it needs, it can inherit the rest from the base classes, that way you do not have to write them over and over for each dialog. Share this post Link to post Share on other sites
chuiby 1 Posted July 18, 2012 Yes if it is a really simple dialog then it can be all defined in the description.ext of the mission or in the config.cpp of an addon. Dialog's are some of the more difficult things to code in Arma. Its not a simple yes or no, firstly dialog's don't go in .sqf files they go in .hpp files, or included in the file types as I stated above.Second unless it is an extremely simple dialog it is going to get messing fast putting it all into the description.ext or config.cpp and is generally considered bad practice. The preferred way is to separate the dialog from its base classes and put them in their own .hpp files and then using #preprocssor commands include them in the description.ext or config.cpp. With dialog's it is very important to use inheritance to help reduce the amount of code you have to write or define for each "dialog". That's why its recommended to separate the base definitions and setups and then just define your dialog and any small changes that it needs, it can inherit the rest from the base classes, that way you do not have to write them over and over for each dialog. Thanks for the answer, but what do you mean by "using inheriting to help reduce the amount of code..." and how can I use inheritance for my dialogs? Share this post Link to post Share on other sites
mikie boy 18 Posted July 18, 2012 in simple form - i take it to mean that you can use part of the main code to create other guis - one main description file for example - then several .hpp files for different guis which use the lines from the description files. its how i create mine :) Share this post Link to post Share on other sites
riouken 15 Posted July 18, 2012 For example here is a button: You have to have all of this defined to use a button. class cms_RscButton { access = 0; type = 1; text = ""; colorText[] = {0.8784,0.8471,0.651,1}; colorDisabled[] = {0.4,0.4,0.4,1}; colorBackground[] = {1,0.537,0,0.5}; colorBackgroundDisabled[] = {0.95,0.95,0.95,1}; colorBackgroundActive[] = {1,0.537,0,1}; colorFocused[] = {1,0.537,0,1}; colorShadow[] = {0.023529,0,0.0313725,1}; colorBorder[] = {0.023529,0,0.0313725,1}; soundEnter[] = {"",0.09,1}; soundPush[] = {"",0.09,1}; soundClick[] = {"\ca\ui\data\sound\new1",0.07,1}; soundEscape[] = {"",0.09,1}; style = 2; x = 0; y = 0; w = 0.095589; h = 0.039216; shadow = 2; font = "Zeppelin32"; sizeEx = 0.03921; offsetX = 0.003; offsetY = 0.003; offsetPressedX = 0.002; offsetPressedY = 0.002; borderSize = 0; }; We can do that once and put it in a file and #include it in the description.ext. Now we can use that button in our dialogs/displays. class mynew_button : cms_RscButton // Here we are inheriting from what we defined above so all we have to do below is put in a ID and the position of the button and any text we want it to say. { idc = 1600; text = "My new Button"; x = 0.729102 * safezoneW + safezoneX; y = 0.2875 * safezoneH + safezoneY; w = 0.0502084 * safezoneW; h = 0.0303703 * safezoneH; }; Share this post Link to post Share on other sites