Jump to content
Sign in to follow this  
Bon

how to get weapon names and icons

Recommended Posts

Hi all,

I have the classnames of a bunch of weapons and magazines, .e.g. "30Rnd_556x45_G36", now I want to add the names and icons of these into a dialog control as it is done in the gear menu, e.g. "G36 Mag", and the small icon right-hand side of it.

Does anybody know how to do it? Should be actually possible since ACE2 or Benny.'s Warfare are using a custom gear menu with these names and icons as well, but I have a hard time finding it out on my own with still no success.

Cheers, Bon.

EDIT: I managed to find out how to get the name:

_name = getText (configFile >> "CfgMagazines" >> "30Rnd_556x45_G36" >> "displayName")),

for weapons I have to use the CfgWeapons config file of course.

Icons left. I assume it is stored in the config entry "icon" instead of "displayName", unfortunately I do not know how to extract this entry (getText and getArray return an empty string/array), also I don't know how this entry could look like, i.e. how to hanlde it. Is it perhaps the path to a .paa?

Edited by Bon

Share this post


Link to post
Share on other sites

Nop that returns an empty string only.

As I found out there is a config entry in CfgWeapons called "UIPicture", which, querried, returns a path to a .paa file.

_pic = getText (configFile >> "CfgWeapons" >> "G36a" >> "uipicture");

Unfortunately, using this picture in a dialog, or simply putting it into a parseText string no icon or picture appears at all,

e.g.

_pic = getText (configFile >> "CfgWeapons" >> "G36a" >> "uipicture");
hint parseText "Test: <img image=_pic/> Test2";

returns Test:

Edited by Bon

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  

×