Jump to content
Sign in to follow this  
drill

UniAddonConf - menu for configurating addons parameters

Recommended Posts

Hello. I would like to introduce my little addon "UniAddonConf" which realizes an easy to use and expand menu for configurating various parameters of addons (and, possibly, missions).

image.pngimage.pngimage.png

Main advantages of UAC:

1. Easy to add new parameter to the menu. In most common case it's enough to execute just one script command.

2. All parameters are placed inside sections, the order of parameters in which they appear in menu could be manipulated through assigning sorting strings.

3. Automatic profile saving/reading.

4. The menu is very flexible. It is possible to have various types of parameters (both predefined in UAC addon and custom), to define the way for saving and reading of parameters values (if the default is not appropriate), to disable UAC profile saving/reading or to define the exact way of doing that.

5. The interface of the menu is mostly consistent to ArmA 3 original menus.

6. All functions of UAC could safely be called at any time (including the most early init handlers) --- all of them are non-blocking, automatically initializing and more-or-less syncronized.

There github repository for UAC addon:

https://github.com/TheDrill/uniaddonconf

and its wiki:

https://github.com/TheDrill/uniaddonconf/wiki

Here download links for current version of UAC. UAC addon itselfs:

https://www.dropbox.com/s/pbvhpxhyn2vwhcz/d_uac_v6.8.zip?dl=0

and its accessory adapter addons:

https://www.dropbox.com/s/nr50zlxefewvrkc/d_uac_v6_adapters.zip?dl=0

Old first post of this topic:

Functions the UAC registers are divided on private and public. The functions which start with "_" are private and shouldn't be used directly. All public functions have descriptions (though, I'm afraid, not on a good English).

At the moment UAC has 2 built-in types:

1. Keybinding type.

2. Boolean type.

It is possible to add custom types (though it would be needed to provide dialog interface to change its value).

The most easy way to register parameter of "keybinding" or "boolean" type is to use one of the following functions:

   D_UniAddonConf_fnc_registerKeyBindingVariable
  D_UniAddonConf_fnc_registerBooleanVariable

For example, if you have a variable

   myKeyBindingVariable = [55, false, false, false];

which contains a key combination for some action (the first one is key code, then follows shift, ctrl, alt statuses), then to register it to UAC is enough to issue the command:

	 ["myKeyBindingVariable", "My section", "SORTINGSTRING", "Description for the parameter"] call D_UniAddonConf_fnc_registerKeyBindingVariable;

This command would create section "My section" and add there an entry "Description for the parameter", which would be binded to the value of variable myKeyBindingVariable. The "SORTINGSTRING" is used to determine the position of the parameter in the list and could be any string (or array of numbers), even "". The default value for the parameter would be then the value of the variable before registration ([55, false, false, false]). The new values for the parameter (or the ones from user profile) would automatically assigned to the variable by UAC.

In a similar manner, to register boolean variable

   myBooleanVariable = false;

is enough to issue the command:

	 ["myBooleanVariable", "My section", "SORTINGSTRING", "Description for the parameter"] call D_UniAddonConf_fnc_registerBooleanVariable;

The more general ways for registering parameters are functions:

   D_UniAddonConf_fnc_registerVariable
  D_UniAddonConf_fnc_registerParameter

D_UniAddonConf_fnc_registerVariable is just simplified version of D_UniAddonConf_fnc_registerParameter. It all the same as functions for registering keybindings and boolean with the exception that it's needed to explicitly define the type (for built-in types: D_UniAddonConf_fnc_type_boolean or D_UniAddonConf_fnc_type_keyBinding) here.

D_UniAddonConf_fnc_registerParameter is the most general registration function. Here you should additionaly provide functions a pair of functions for reading/writing value of the parameter (D_UniAddonConf_fnc_registerVariable provides here the functions which just read the value of variable and writes new value to the parameter).

Several other functions and features are provided for manipulating the menu. See the attached addons for more examples.

UAC menu also provides 3 default sections:

	localize "STR_Addons__D_UniAddonConf_Section_Keys"
localize "STR_Addons__D_UniAddonConf_Section_General"
localize "STR_Addons__D_UniAddonConf_Section_MissionSpecific"

which could be used when registering new parameters.

Link to download the UniAddonConf addon:

D_UniAddonConf_v5.6.zip

And here some "adaptor" addons, which include the AGM, BWA and CSE menus to UAC, addons which adds parameters for TFAR radion and TuA3 radio (used on tsgames.ru project), addon for simple manipulations on the menu entries:

D_AGM_to_UAC_v5.1.zip

D_BWA_to_UAC_v5.1.zip

D_CSE_to_UAC_v5.1.zip

D_TFAR_to_UAC_v5.1.zip

D_TuA3TS3_to_UAC_v5.1.zip

UAC_menu_config_v5.2.zip

These addons provide a good example on what and how could be done with UAC.

A bit of comment about versioning. The first number in version is interface functions version (if it rises, then there's some incompatible changes in functions names/arguments), the second number is an actual version of an addon.

Edited by Drill

Share this post


Link to post
Share on other sites

A new version of addon has been made.

Download link:

D_UniAddonConf_v5.7.zip

Changes:

  1. New built-in parameter types were defined:
    • enum --- (D_UniAddonConf_fnc_type_enum) variables of this type might have value only from fixed predefined collection of values. Each value has string label which would be displayed to the user. The convenient function for registration such variables is D_UniAddonConf_fnc_registerEnumVariable, see its comments for more info.
    • number --- (D_UniAddonConf_fnc_type_number) the basic number type. By default any number is valid for the variables of that type. However, it's possible to define "transformation" function which would apply more detailed constraints on possible values (for example, all integers in [0;100]). The convenient function for registration such variables is D_UniAddonConf_fnc_registerNumberVariable, see its comments for more info.
    • string --- (D_UniAddonConf_fnc_type_string) the basic string type. By default any string is valid. It's also possible to define "validation" function to define detailed constraints on possible value (for example, all strings with length >= 1). The convenient function for registration such variables is D_UniAddonConf_fnc_registerStringVariable, see its comments for more info.
    • procedure --- (D_UniAddonConf_fnc_type_procedure) this is pseudo-type. A parameter of that type doesn't have any value and its only purpuse is to run predefined code (function) when a user clicks on it. It might be used, for example, to show custom menu from addon. The convenient function for registration such variables is D_UniAddonConf_fnc_registerProcedure, see its comments for more info.

[*]A new predefined section was defined: localize "STR_Addons__D_UniAddonConf_Section_Procedures"

[*]Added "hooks" for registerParameter function. To add/remove hooks the one has to use newly introduced functions:

  • D_UniAddonConf_fnc_addHook
  • D_UniAddonConf_fnc_removeHook

The hook is some function (code) which runs on call of registerParameter and has opportunity to modifiy its arguments or cancel the call at all. The hooks are introduced to UAC for easy menu manipulations: the one could easly rename parameters, change their section, change its default value, totaly remove it and so on using hooks. This feature is mostly intended for reorganizing menu for addon packs without modifying the original addons. It's not recommended to use it for any other purpose, use it with caution. The best place for adding the hook is in preinit eventhandler --- this way all registerParameter calls would be intercepted.

[*]UniAddonConf stores its entries in only one profile variable now (named "D_UniAddonConf_entries"). This way it takes less space and easier to be handled or cleared.

[*]A bit of optimizations has been done using new commands for manipulating arrays introduced in some version of ArmA 3 (which I missed before, unfortunatelly).

[*]Added button to set all parameters in current section to their default values.

Edited by Drill

Share this post


Link to post
Share on other sites

interesting addon

but you are missing a propper documentation (some wiki for example)

you should consider using either gitHub for the wiki or a very own server as currently its pretty hard to see where to start

Share this post


Link to post
Share on other sites

I'll try to make the documentation in gitHub then as soon as I have enough free time again. Thank you for the advice.

Share this post


Link to post
Share on other sites

I can't make it work with TFAR. Is it still working or its broken for TFAR?

Share this post


Link to post
Share on other sites

Hello, sorry for late answer - I didn't check the forum for some time. Yes, it is broken with TFAR, because the parameter names in newer TFAR has been changed. I can more-or-less easily repair it if someone needs it, though I'm planning to create universal CBA-to-UAC adapter at some moment which would automatically support TFAR (because its keybindings working through CBA).

As of my addon itself --- I've almost done the documentation wiki, and would try to public it and the newer version of UAC soon. Unfortunately, I'm both not too good in English and documentation writing, and have a bit lack of time --- so it took too much time.

Share this post


Link to post
Share on other sites

First of all, I have finished a new version 6.8 of UniAddonConf addon.

URL to main addon:

https://www.dropbox.com/s/pbvhpxhyn2vwhcz/d_uac_v6.8.zip?dl=0

URL to current adapters:

https://www.dropbox.com/s/nr50zlxefewvrkc/d_uac_v6_adapters.zip?dl=0

Changelog:

1. Addons have been renamed to conform to the names of other addons in ArmA 3. D_UniAddonConf was renamed to d_uac (and so the prefix in function names), names of adapters are all in lowercase now.

2. UAC menu don't store the value of parameter in profile if the value is equal to parameter's default value.

3. A bit reworked arguments order for some functions to be more consistent.

I hope this is the last interface-breaking update (unless there some really nasty problem shows up).

Secondly, I've at last done the very first version of documentation for UAC addon functions on github wiki. So here is the link for github repository:

https://github.com/TheDrill/uniaddonconf

and here is for the wiki:

https://github.com/TheDrill/uniaddonconf/wiki

Thirdly, I'll try to update TFAR adapter as soon as possible (though anyway that would take some days).

Share this post


Link to post
Share on other sites

New mod 6.8 available at withSIX. Download now by clicking:

banner-420x120.png

New mod 6.0 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and soon also publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way through withsix.wetransfer.com or add your notification at getsatisfaction.withsix.com.

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Thanks alot for the update, can't wait for the TFAR additions!

Share this post


Link to post
Share on other sites

A new adapter addon for UAC has been made: d_cba_to_uac. This addon adds all parameters from CBA keybinding to UAC menu. It also supports TFAR radio addon (as it uses CBA keybinging). The adapter was tested only with TFAR radio currently, if there is a problem with any another addon which uses CBA keybinding - please report.

URL for downloading:

https://www.dropbox.com/s/3lqlxohn4bj3faw/d_cba_to_uac_v6.1.zip?dl=0

It also could be downloaded from the github page.

There is also an update to the github wiki - value_handlers argument of d_uac_fnc_registerParameter is described more detailed.

Share this post


Link to post
Share on other sites

New addition frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

A little update to the addon has been made to fix a bug: Arma interrupt menu and UAC menu overlapped. It seams that the bug appeared due to Arma 3 update 1.40.

The updated version of UAC v6.9 could be downloaded from here:

https://www.dropbox.com/s/b4c908jvkya1cks/d_uac_v6.9.zip?dl=0

or from git:

https://github.com/TheDrill/uniaddonconf/tree/master/pbos

Share this post


Link to post
Share on other sites

New addition frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

New mod v5.1 available at withSIX. Download now by clicking:

banner-420x120.png

@Drill;

You are now able to manage your own promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and follow the quick and safe claim procedure to get connected to your work.

For now you can send new content or releases our way by using any filesharing service and add your notification at getsatisfaction.withsix.com.

Updated mod v6.9 available at withSIX. Download now by clicking:

banner-420x120.png

Share this post


Link to post
Share on other sites

New addition frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

New addition frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means soon you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

this looks really useful. have had so much difficulty with menus but am going to give your add on a try now. thanks for sharing!

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  

×