Jump to content
gc8

Custom controls in layout

Recommended Posts

Hi

Does anyone know if it's possible to add your GUI controls to arma so that you can use the layout editor in the options to change your control position?

 

I think some mod did this but I can't remember which one

 

thx!

 

Share this post


Link to post
Share on other sites

Ace 3 does it  for their stamina bar, if that helps.

Share this post


Link to post
Share on other sites
57 minutes ago, Mr H. said:

Ace 3 does it  for their stamina bar, if that helps.

 

Thanks, at least I now know it's possible. But Ace3 is probably a big mod , hard to find anything from there...

Share this post


Link to post
Share on other sites
3 hours ago, Mr H. said:

Have a look here:

 

Thanks I went through the scripts there but didn't find anything

Share this post


Link to post
Share on other sites
On 4/29/2019 at 5:15 PM, gc8 said:

if it's possible to add your GUI controls to arma so that you can use the layout editor in the options to change your control position?

What exactly do you mean by this?

  1. Add your own control type to the gui editors right click ( insert element ) list.
  2. You just want to import your own gui so you can reposition controls.

1. Most probably do-able, but you will need to overwrite \a3\functions_f\gui\editor\gui_init.sqf where the list of supported control types is kept.

2. You can import any ui you have created into the editor by Ctrl+i then enter the path to your ui e.g missionConfigfile >> "MyDisplay". BI's own displays can also be imported configfile >> "RscDisplayInventory" will display the inventory ui in the editor.

 

EDIT: I see what you mean now was confused by your wording. You mean add UI elements so that they are editable via Options > Game > Layout.

Share this post


Link to post
Share on other sites

I think he means HUD elements like the stamina bar for exemple. In the game options you can choose the position of these element's on the screen and the game saves the position. (Or else I completely misunderstood and my comments above are absolutely irrelevant ) 😉

Share this post


Link to post
Share on other sites
1 hour ago, Mr H. said:

Or else I completely misunderstood and my comments above are absolutely irrelevant

No I think its me 😃

 

@gc8 Look at RscDisplayOptionsLayout along with its script \a3\ui_f\scripts\gui\rscdisplayoptionslayout.sqf and CfgUIGrids. Should give you a starting point to track down how to add a control.

\a3\functions_f\gui\fn_guigridtoprofile.sqf will show how the config entry under CfgUIGrids > ... > Variables > ... > saveToProfile decides what information to save( e.g x,y,w,h ) along with the profileNamespace variable name that is used.

Share this post


Link to post
Share on other sites

@Larrow thanks! I took a look on those scripts but it seems CfgUIGrids holds all the controls editable in the layout editor which would mean it's not possible to add new controls via mission script but addon is required. Hope I'm wrong though.

Share this post


Link to post
Share on other sites
2 hours ago, gc8 said:

would mean it's not possible to add new controls via mission script but addon is required. Hope I'm wrong though.

Correct, you would need some form of mod to provide access to the config entries.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/1/2019 at 2:43 PM, Larrow said:

Correct, you would need some form of mod to provide access to the config entries.

 

Returning back to this as I now have mod to put this stuff into. What I don't understand is how can you add more entries to CfgUIGrids? Does arma allow you to add sub classes to already existing class? I don't even know where CfgUIGrids is defined.

If anyone got example or something it would be great

 

thx! 

Share this post


Link to post
Share on other sites

Ok figured how to add new classes to CfgUIGrids.

But the problem I now have is I can't figure how to put the preset in the config because arma config viewer is giving syntax error on the variables.

 

I mean this:


 

grid_weapon[] = {["((safezoneX + safezoneW) -         (10 *             (            ((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 *             (            ((safezoneW / safezoneH) min 1.2) / 40))","(safezoneY + 0.5 *             (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))","(10 *             (            ((safezoneW / safezoneH) min 1.2) / 40))","(4.5 *             (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"],"(            ((safezoneW / safezoneH) min 1.2) / 40)","(            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
                    


 

The [ & ] inside give me parse error when I copy & paste that to my config.cpp

I don't know is the problem in config export or what but I can't figure proper syntax for those grid_ entries

 

 

Edit: Ok nevermind it was array inside array in config. didn't know that was possible in config!

Share this post


Link to post
Share on other sites

Does anyone know what are the two last lines in grid position for the layout?

 

I mean the ones in bold:

 

grid_weapon[] = {

 

["((safezoneX + safezoneW) -         (10 *             (            ((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 *           (          ((safezoneW / safezoneH) min 1.2) / 40))",

"(safezoneY + 0.5 *             (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))",

"(10 *             (            ((safezoneW / safezoneH) min 1.2) / 40))",

"(4.5 *             (            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))"],

 

"(            ((safezoneW / safezoneH) min 1.2) / 40)",

"(            (            ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"

 

};
                    

 

 

They have something to do with width & height but I don't know exactly what. Maybe max or min sizes...

Share this post


Link to post
Share on other sites

Think I found it, this page suggests it's grid(W/H):  https://community.bistudio.com/wiki/BIS_fnc_GUIgrid

 

although I think the return value in that wiki page is wrong, it's just [x,y,w,h]

 

 

 

Edited by gc8
wrong return
  • Like 1

Share this post


Link to post
Share on other sites

See my explanation hidden in the last spoiler of this post.

Basically its creating what BI deem a safe area of your screen, based of your resolution height, into grids. 40 grids wide by 25 grids height.

  • Like 1
  • Thanks 1

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

×